Upload app.py
Browse files
app.py
CHANGED
@@ -167,5 +167,20 @@ if user_query is not None and find_youtube_links(user_query) != "":
|
|
167 |
st.write(response)
|
168 |
|
169 |
st.session_state.chat_history.append(AIMessage(content=response))
|
170 |
-
|
171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
st.write(response)
|
168 |
|
169 |
st.session_state.chat_history.append(AIMessage(content=response))
|
170 |
+
|
171 |
+
|
172 |
+
if user_query is not None and user_query != "" and find_youtube_links(user_query) == "":
|
173 |
+
st.session_state.chat_history.append(HumanMessage(content=user_query))
|
174 |
+
|
175 |
+
with st.chat_message("Human"):
|
176 |
+
st.markdown(user_query)
|
177 |
+
|
178 |
+
response = get_response(user_query)
|
179 |
+
|
180 |
+
# Remove any unwanted prefixes from the response
|
181 |
+
response = response.replace("AI response:", "").replace("chat response:", "").replace("bot response:", "").strip()
|
182 |
+
|
183 |
+
with st.chat_message("AI"):
|
184 |
+
st.write(response)
|
185 |
+
|
186 |
+
st.session_state.chat_history.append(AIMessage(content=response))
|