Chris4K commited on
Commit
c9ed3c5
·
verified ·
1 Parent(s): 42db5c5

Update app_chat.py

Browse files
Files changed (1) hide show
  1. app_chat.py +5 -1
app_chat.py CHANGED
@@ -46,10 +46,12 @@ def app_chat(agent_config):
46
  # Handle submission with the selected inference URL
47
  #app_agent_config()
48
 
49
- response = handle_submission(user_message, selected_tools, agent_config.url_endpoint, agent_config.document, agent_config.image)
50
 
51
  with st.chat_message("assistant"):
52
  if response is None:
 
 
53
  st.warning("The agent's response is None. Please try again. Generate an image of a flying horse.")
54
  elif isinstance(response, Image.Image):
55
  st.image(response)
@@ -61,6 +63,8 @@ def app_chat(agent_config):
61
  if "emojified_text" in response:
62
  st.markdown(f"{response['emojified_text']}")
63
  else:
 
 
64
  st.markdown(response)
65
  elif isinstance(response, list):
66
  for item in response:
 
46
  # Handle submission with the selected inference URL
47
  #app_agent_config()
48
 
49
+ response = handle_submission(user_message, selected_tools, agent_config.url_endpoint, agent_config.document, agent_config.image, agent_config.context)
50
 
51
  with st.chat_message("assistant"):
52
  if response is None:
53
+ chat_respone = handle_submission_chat(user_message, response)
54
+ st.write(chat_respone)
55
  st.warning("The agent's response is None. Please try again. Generate an image of a flying horse.")
56
  elif isinstance(response, Image.Image):
57
  st.image(response)
 
63
  if "emojified_text" in response:
64
  st.markdown(f"{response['emojified_text']}")
65
  else:
66
+ chat_respone = handle_submission_chat(user_message, response)
67
+ st.write(chat_respone)
68
  st.markdown(response)
69
  elif isinstance(response, list):
70
  for item in response: