Update app.py
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ models_without_temperature = [
|
|
77 |
# Function to call OpenAI API
|
78 |
def get_ai_response(prompt, history):
|
79 |
if not client:
|
80 |
-
return
|
81 |
|
82 |
try:
|
83 |
# Use the system prompt from the session state
|
@@ -162,18 +162,6 @@ with st.sidebar:
|
|
162 |
|
163 |
st.markdown("---")
|
164 |
|
165 |
-
# Chat History Section
|
166 |
-
st.markdown("### Chat History")
|
167 |
-
for conv_id, conv_data in st.session_state.conversations.items():
|
168 |
-
if st.button(conv_data["title"], key=f"hist_{conv_id}"):
|
169 |
-
st.session_state.current_conversation_id = conv_id
|
170 |
-
st.experimental_rerun()
|
171 |
-
|
172 |
-
# New Chat Button
|
173 |
-
if st.button("+ New Chat"):
|
174 |
-
create_new_chat()
|
175 |
-
st.experimental_rerun()
|
176 |
-
|
177 |
# Main chat window
|
178 |
with st.container():
|
179 |
current_id = st.session_state.current_conversation_id
|
|
|
77 |
# Function to call OpenAI API
|
78 |
def get_ai_response(prompt, history):
|
79 |
if not client:
|
80 |
+
return "No API key provided. Running in demo mode."
|
81 |
|
82 |
try:
|
83 |
# Use the system prompt from the session state
|
|
|
162 |
|
163 |
st.markdown("---")
|
164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
# Main chat window
|
166 |
with st.container():
|
167 |
current_id = st.session_state.current_conversation_id
|