Skip to content

Commit df3df91

Browse files
committed
Fix build errors in universal_weaviate_uploader.
1 parent 8c1c2d8 commit df3df91

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

python/rubin/rag/extra_scripts/universal_weaviate_uploader.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,20 @@ def push_docs_to_weaviate(
2121
# Load environment variables from .env file
2222
load_dotenv()
2323

24-
os.getenv("WEAVIATE_URL")
24+
openai_api_key = os.getenv("OPENAI_API_KEY")
25+
if openai_api_key is None:
26+
raise ValueError("OPENAI_API_KEY environment variable is not set")
27+
2528

2629
client = weaviate.connect_to_custom(
2730
http_host="localhost",
28-
http_port="8080",
31+
http_port=8080,
2932
http_secure=False,
3033
grpc_host="localhost",
31-
grpc_port="50051",
34+
grpc_port=50051,
3235
grpc_secure=False,
3336
headers={
34-
"X-OpenAI-Api-Key": os.getenv(
35-
"OPENAI_API_KEY"
36-
) # Or any other inference API keys
37+
"X-OpenAI-Api-Key": openai_api_key # Or any other inference API keys
3738
},
3839
)
3940

0 commit comments

Comments
 (0)