Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,12 +63,8 @@ vector_store = FAISS.from_texts(
|
|
| 63 |
metadatas=metadatas
|
| 64 |
)
|
| 65 |
# Step 5: Initialize the LLM
|
| 66 |
-
#openai_api_key = os.getenv("tauhid") # Fetch the key using the actual secret name
|
| 67 |
-
|
| 68 |
openai_api_key = os.getenv("tauhid")
|
| 69 |
-
|
| 70 |
-
if not openai_api_key:
|
| 71 |
-
raise ValueError("tauhid environment variable is not set. Please add it to the Space Secrets.")
|
| 72 |
|
| 73 |
# Initialize the LLM
|
| 74 |
llm = ChatOpenAI(
|
|
|
|
| 63 |
metadatas=metadatas
|
| 64 |
)
|
| 65 |
# Step 5: Initialize the LLM
|
|
|
|
|
|
|
| 66 |
openai_api_key = os.getenv("tauhid")
|
| 67 |
+
print(f"API key retrieved: {'[NOT FOUND]' if not openai_api_key else '[FOUND - first 4 chars: ' + openai_api_key[:4] + ']'}")
|
|
|
|
|
|
|
| 68 |
|
| 69 |
# Initialize the LLM
|
| 70 |
llm = ChatOpenAI(
|