diff --git a/llama_stack/providers/remote/vector_io/weaviate/weaviate.py b/llama_stack/providers/remote/vector_io/weaviate/weaviate.py index adcadbc29..d7b920229 100644 --- a/llama_stack/providers/remote/vector_io/weaviate/weaviate.py +++ b/llama_stack/providers/remote/vector_io/weaviate/weaviate.py @@ -139,14 +139,22 @@ class WeaviateVectorIOAdapter( self.metadata_collection_name = "openai_vector_stores_metadata" def _get_client(self) -> weaviate.Client: - key = f"{self.config.weaviate_cluster_url}::{self.config.weaviate_api_key}" - if key in self.client_cache: - return self.client_cache[key] - - client = weaviate.connect_to_weaviate_cloud( - cluster_url=self.config.weaviate_cluster_url, - auth_credentials=Auth.api_key(self.config.weaviate_api_key), - ) + # if self.config.test_environment: + if True: + key = "local::test" + client = weaviate.connect_to_local( + host="localhost", + port="8080", + ) + else: + key = f"{self.config.weaviate_cluster_url}::{self.config.weaviate_api_key}" + if key in self.client_cache: + return self.client_cache[key] + print(f"connecting with {self.config.weaviate_cluster_url} and key {self.config.weaviate_api_key}") + client = weaviate.connect_to_weaviate_cloud( + cluster_url=self.config.weaviate_cluster_url, + auth_credentials=Auth.api_key(self.config.weaviate_api_key), + ) self.client_cache[key] = client return client