Skip to content

Commit 5e3509e

Browse files
refactor: update weaviate tool environment variable names
Co-Authored-By: root@a10k.co <root@a10k.co>
1 parent 8a99ea2 commit 5e3509e

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

agentstack/tools/weaviate/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ def search_collection(
2222
Returns:
2323
str: JSON string containing search results
2424
"""
25-
url = os.environ.get("WEAVIATE_TOOL_URL")
26-
api_key = os.environ.get("WEAVIATE_TOOL_API_KEY")
27-
openai_key = os.environ.get("WEAVIATE_TOOL_OPENAI_API_KEY")
25+
url = os.environ.get("WEAVIATE_URL")
26+
api_key = os.environ.get("WEAVIATE_API_KEY")
27+
openai_key = os.environ.get("WEAVIATE_OPENAI_API_KEY") or \
28+
os.environ.get("OPENAI_API_KEY")
2829

2930
if not url or not api_key or not openai_key:
3031
raise ValueError("Missing required environment variables")
@@ -69,9 +70,10 @@ def create_collection(
6970
Returns:
7071
str: Success message
7172
"""
72-
url = os.environ.get("WEAVIATE_TOOL_URL")
73-
api_key = os.environ.get("WEAVIATE_TOOL_API_KEY")
74-
openai_key = os.environ.get("WEAVIATE_TOOL_OPENAI_API_KEY")
73+
url = os.environ.get("WEAVIATE_URL")
74+
api_key = os.environ.get("WEAVIATE_API_KEY")
75+
openai_key = os.environ.get("WEAVIATE_OPENAI_API_KEY") or \
76+
os.environ.get("OPENAI_API_KEY")
7577

7678
if not url or not api_key or not openai_key:
7779
raise ValueError("Missing required environment variables")

agentstack/tools/weaviate/config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"url": "https://github.com/weaviate/weaviate-python-client",
44
"category": "vector-store",
55
"env": {
6-
"WEAVIATE_TOOL_URL": null,
7-
"WEAVIATE_TOOL_API_KEY": null,
8-
"WEAVIATE_TOOL_OPENAI_API_KEY": null
6+
"WEAVIATE_URL": null,
7+
"WEAVIATE_API_KEY": null,
8+
"WEAVIATE_OPENAI_API_KEY": null
99
},
1010
"dependencies": [
1111
"weaviate-client>=3.0.0",

0 commit comments

Comments
 (0)