added support of API key based auth

This commit is contained in:
cs0lar
2023-04-12 19:09:52 +01:00
parent b7d0cc3b24
commit 530894608b
4 changed files with 7 additions and 2 deletions

View File

@@ -46,6 +46,8 @@ class WeaviateMemory(MemoryProviderSingleton):
def _build_auth_credentials(self, cfg):
if cfg.weaviate_username and cfg.weaviate_password:
return weaviate_auth.AuthClientPassword(cfg.weaviate_username, cfg.weaviate_password)
if cfg.weaviate_api_key:
return weaviate.auth.AuthApiKey(api_key=cfg.weaviate_api_key)
else:
return None