connection to container debugged

Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
Francisco Javier Arceo 2025-07-26 21:20:02 -04:00
parent e13a2a64fe
commit bc461567f6

View file

@ -139,14 +139,22 @@ class WeaviateVectorIOAdapter(
self.metadata_collection_name = "openai_vector_stores_metadata" self.metadata_collection_name = "openai_vector_stores_metadata"
def _get_client(self) -> weaviate.Client: def _get_client(self) -> weaviate.Client:
key = f"{self.config.weaviate_cluster_url}::{self.config.weaviate_api_key}" # if self.config.test_environment:
if key in self.client_cache: if True:
return self.client_cache[key] key = "local::test"
client = weaviate.connect_to_local(
client = weaviate.connect_to_weaviate_cloud( host="localhost",
cluster_url=self.config.weaviate_cluster_url, port="8080",
auth_credentials=Auth.api_key(self.config.weaviate_api_key), )
) 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 self.client_cache[key] = client
return client return client