AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
added support of API key based auth
cs0lar530894608b29
diff --git a/.env.template b/.env.templateindex c8c33dd8c0..207360052b 100644--- a/.env.template+++ b/.env.template@@ -24,5 +24,6 @@ USE_WEAVIATE_EMBEDDED=FalseWEAVIATE_EMBEDDED_PATH="/home/me/.local/share/weaviate"WEAVIATE_USERNAME=WEAVIATE_PASSWORD=+WEAVIATE_API_KEY=MEMORY_INDEX="auto-gpt"MEMORY_BACKEND="local"diff --git a/README.md b/README.mdindex 3f5163f7d5..9b7753b41e 100644--- a/README.md+++ b/README.md@@ -226,7 +226,7 @@ export PINECONE_ENV="Your pinecone region" # something like: us-east4-gcp## Weaviate Setup[Weaviate](https://weaviate.io/) is an open-source vector database. It allows to store data objects and vector embeddings from ML-models and scales seamlessly to billion of data objects. [An instance of Weaviate can be created locally (using Docker), on Kubernetes or using Weaviate Cloud Services](https://weaviate.io/developers/weaviate/quickstart).-Although still experimental, [Embedded Weaviate](https://weaviate.io/developers/weaviate/installation/embedded) is supported which allows the Auto-GPT process itself to start a Weaviate instance. To enable it, set `USE_WEAVIATE_EMBEDDED` to `True` and make sure you `pip install "weaviate-client>=3.15.4"`.+Although still experimental, [Embedded Weaviate](https://weaviate.io/developers/weaviate/installation/embedded) is supported which allows the Auto-GPT process itself to start a Weaviate instance. To enable it, set `USE_WEAVIATE_EMBEDDED` to `True` and make sure you `pip install "weaviate-client>=3.15.4"`.#### Setting up environment variables@@ -239,6 +239,7 @@ WEAVIATE_PORT="8080"WEAVIATE_PROTOCOL="http"WEAVIATE_USERNAME="your username"WEAVIATE_PASSWORD="your password"+WEAVIATE_API_KEY="your weaviate API key if you have one"WEAVIATE_EMBEDDED_PATH="/home/me/.local/share/weaviate" # this is optional and indicates where the data should be persisted when running an embedded instanceUSE_WEAVIATE_EMBEDDED=False # set to True to run Embedded WeaviateMEMORY_INDEX="Autogpt" # name of the index to create for the applicationdiff --git a/scripts/config.py b/scripts/config.pyindex 2c08f7627d..065e37dd4a 100644--- a/scripts/config.py+++ b/scripts/config.py@@ -74,7 +74,8 @@ class Config(metaclass=Singleton):self.weaviate_username = os.getenv("WEAVIATE_USERNAME", None)self.weaviate_password = os.getenv("WEAVIATE_PASSWORD", None)self.weaviate_scopes = os.getenv("WEAVIATE_SCOPES", None)- self.weaviate_embedded_path = os.getenv('WEAVIATE_EMBEDDED_PATH', '~/.local/share/weaviate')+ self.weaviate_embedded_path = os.getenv("WEAVIATE_EMBEDDED_PATH", "~/.local/share/weaviate")+ self.weaviate_api_key = os.getenv("WEAVIATE_API_KEY", None)self.use_weaviate_embedded = os.getenv("USE_WEAVIATE_EMBEDDED", "False") == "True"self.image_provider = os.getenv("IMAGE_PROVIDER")diff --git a/scripts/memory/weaviate.py b/scripts/memory/weaviate.pyindex 6de8be7005..b5710cb5d6 100644--- a/scripts/memory/weaviate.py+++ b/scripts/memory/weaviate.py@@ -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