From bc461567f638b874648d74ceb684af0d0d7ab236 Mon Sep 17 00:00:00 2001 From: Francisco Javier Arceo Date: Sat, 26 Jul 2025 21:20:02 -0400 Subject: [PATCH] connection to container debugged Signed-off-by: Francisco Javier Arceo --- .../remote/vector_io/weaviate/weaviate.py | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) 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