Manoj21k commited on
Commit
4488bd6
·
verified ·
1 Parent(s): 9b05a28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -13
app.py CHANGED
@@ -26,16 +26,13 @@ for msg in msgs.messages:
26
  st.chat_message(msg.type).write(msg.content)
27
 
28
  if prompt := st.chat_input():
29
- try:
30
- st.chat_message("human").write(prompt)
31
- msgs.add_user_message(prompt)
32
-
33
- with st.spinner("Waiting for response..."):
34
- res = get_prompt(prompt, api)
35
- if res:
36
- st.chat_message("ai").write(res)
37
- msgs.add_ai_message(res)
38
- else:
39
- st.error("No valid response received from the AI.")
40
- except:
41
- return "Something went wrong (:"
 
26
  st.chat_message(msg.type).write(msg.content)
27
 
28
  if prompt := st.chat_input():
29
+ st.chat_message("human").write(prompt)
30
+ msgs.add_user_message(prompt)
31
+
32
+ with st.spinner("Waiting for response..."):
33
+ res = get_prompt(prompt, api)
34
+ if res:
35
+ st.chat_message("ai").write(res)
36
+ msgs.add_ai_message(res)
37
+ else:
38
+ st.error("No valid response received from the AI.")