Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -267,7 +267,7 @@ def load_chain(tools_list, llm):
|
|
267 |
# async def set_chain_state_api_key(api_key):
|
268 |
async def set_openai_key(api_key):
|
269 |
# Set the API key for chain_state
|
270 |
-
chain_state.api_key = api_key
|
271 |
|
272 |
# async def set_express_chain_state_api_key(api_key):
|
273 |
# # Set the API key for express_chain_state
|
@@ -324,12 +324,13 @@ async def set_openai_api_key(api_key):
|
|
324 |
embeddings_state, qa_chain_state, and memory_state.
|
325 |
"""
|
326 |
try:
|
327 |
-
await
|
328 |
-
await
|
329 |
-
await
|
330 |
-
await
|
331 |
-
await
|
332 |
-
await
|
|
|
333 |
except Exception as e:
|
334 |
# Handle the error, e.g., log the error message or show an alert to the user
|
335 |
print(f"Error setting OpenAI API key: {e}")
|
|
|
267 |
# async def set_chain_state_api_key(api_key):
|
268 |
async def set_openai_key(api_key):
|
269 |
# Set the API key for chain_state
|
270 |
+
# chain_state.api_key = api_key
|
271 |
|
272 |
# async def set_express_chain_state_api_key(api_key):
|
273 |
# # Set the API key for express_chain_state
|
|
|
324 |
embeddings_state, qa_chain_state, and memory_state.
|
325 |
"""
|
326 |
try:
|
327 |
+
await set_openai_key(api_key)
|
328 |
+
# await set_chain_state_api_key(api_key)
|
329 |
+
# await set_express_chain_state_api_key(api_key)
|
330 |
+
# await set_llm_state_api_key(api_key)
|
331 |
+
# await set_embeddings_state_api_key(api_key)
|
332 |
+
# await set_qa_chain_state_api_key(api_key)
|
333 |
+
# await set_memory_state_api_key(api_key)
|
334 |
except Exception as e:
|
335 |
# Handle the error, e.g., log the error message or show an alert to the user
|
336 |
print(f"Error setting OpenAI API key: {e}")
|