Chris4K commited on
Commit
b7d0dc8
·
verified ·
1 Parent(s): 003c5fb

Update app_chat.py

Browse files
Files changed (1) hide show
  1. app_chat.py +12 -2
app_chat.py CHANGED
@@ -55,13 +55,23 @@ def app_chat(agent_config):
55
  st.write(chat_respone)
56
  # st.warning("The agent's response is None. Please try again. Generate an image of a flying uncormn.")
57
  elif isinstance(response, Image.Image):
 
 
 
58
  st.image(response)
59
  elif isinstance(response, AudioSegment):
 
 
 
60
  st.audio(response)
61
- elif isinstance(response, int):
 
 
62
  st.markdown(response)
63
  elif isinstance(response, str):
64
- if "emojified_text" in response:
 
 
65
  st.markdown(f"{response['emojified_text']}")
66
  else:
67
  chat_respone = handle_submission_chat(user_message, response)
 
55
  st.write(chat_respone)
56
  # st.warning("The agent's response is None. Please try again. Generate an image of a flying uncormn.")
57
  elif isinstance(response, Image.Image):
58
+ agent_config.image = response
59
+ chat_respone = handle_submission_chat(user_message, "No context . Created an image.")
60
+ st.write(chat_respone)
61
  st.image(response)
62
  elif isinstance(response, AudioSegment):
63
+ agent_config.audio = response
64
+ chat_respone = handle_submission_chat(user_message, "No context . Created audio file.")
65
+ st.write(chat_respone)
66
  st.audio(response)
67
+ elif isinstance(response, int):
68
+ chat_respone = handle_submission_chat(user_message, response)
69
+ st.write(chat_respone)
70
  st.markdown(response)
71
  elif isinstance(response, str):
72
+ if "emojified_text" in response:
73
+ chat_respone = handle_submission_chat(user_message, "No context . Created the text with emojies.")
74
+ st.write(chat_respone)
75
  st.markdown(f"{response['emojified_text']}")
76
  else:
77
  chat_respone = handle_submission_chat(user_message, response)