mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 07:14:20 +00:00
connection to container debugged
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
parent
e13a2a64fe
commit
bc461567f6
1 changed files with 16 additions and 8 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue