Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -3
src/streamlit_app.py
CHANGED
@@ -5,8 +5,7 @@ from langchain.memory import ConversationBufferMemory
|
|
5 |
import os
|
6 |
|
7 |
# Set OpenRouter API Key and Base URL
|
8 |
-
|
9 |
-
os.environ['OPENAI_API_BASE'] = 'https://openrouter.ai/api/v1'
|
10 |
|
11 |
if not api_key:
|
12 |
st.error("API key not found. Please set OPENAI_API_KEY in Space secrets.")
|
@@ -16,7 +15,8 @@ if not api_key:
|
|
16 |
llm = ChatOpenAI(
|
17 |
temperature=0.7,
|
18 |
model_name="deepseek/deepseek-chat-v3-0324:free",
|
19 |
-
openai_api_key=
|
|
|
20 |
)
|
21 |
|
22 |
# Set up memory
|
|
|
5 |
import os
|
6 |
|
7 |
# Set OpenRouter API Key and Base URL
|
8 |
+
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
|
|
|
9 |
|
10 |
if not api_key:
|
11 |
st.error("API key not found. Please set OPENAI_API_KEY in Space secrets.")
|
|
|
15 |
llm = ChatOpenAI(
|
16 |
temperature=0.7,
|
17 |
model_name="deepseek/deepseek-chat-v3-0324:free",
|
18 |
+
openai_api_key=OPENAI_API_KEY,
|
19 |
+
openai_api_base="https://openrouter.ai/api/v1"
|
20 |
)
|
21 |
|
22 |
# Set up memory
|