Muhammad-Izhan commited on
Commit
f637ab2
·
verified ·
1 Parent(s): a0b2284

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +6 -1
src/streamlit_app.py CHANGED
@@ -8,10 +8,15 @@ import os
8
  os.environ["OPENAI_API_KEY"] = st.secrets["OPENAI_API_KEY"]
9
  os.environ['OPENAI_API_BASE'] = 'https://openrouter.ai/api/v1'
10
 
 
 
 
 
11
  # Set up the model
12
  llm = ChatOpenAI(
13
  temperature=0.7,
14
- model_name="deepseek/deepseek-chat-v3-0324:free" # correct model path
 
15
  )
16
 
17
  # Set up memory
 
8
  os.environ["OPENAI_API_KEY"] = st.secrets["OPENAI_API_KEY"]
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.")
13
+ st.stop()
14
+
15
  # Set up the model
16
  llm = ChatOpenAI(
17
  temperature=0.7,
18
+ model_name="deepseek/deepseek-chat-v3-0324:free",
19
+ openai_api_key=api_key,
20
  )
21
 
22
  # Set up memory