Update app_chat.py
Browse files- app_chat.py +4 -4
app_chat.py
CHANGED
@@ -42,14 +42,14 @@ def app_chat(agent_config):
|
|
42 |
|
43 |
if user_message := st.chat_input("Enter message"):
|
44 |
st.chat_message("user").markdown(user_message)
|
45 |
-
st.session_state.messages.append({"role": "user", "content": user_message})
|
46 |
|
47 |
selected_tools = [agent_config.tool_loader.tools[idx] for idx, checkbox in enumerate(agent_config.tool_checkboxes) if checkbox]
|
48 |
# Handle submission with the selected inference URL
|
49 |
#app_agent_config()
|
50 |
|
51 |
response = ""
|
52 |
-
|
53 |
with st.spinner('Please stand by ...'):
|
54 |
|
55 |
response = handle_submission(user_message, selected_tools, agent_config.url_endpoint, agent_config.document, agent_config.image, agent_config.context)
|
@@ -119,6 +119,6 @@ def app_chat(agent_config):
|
|
119 |
else:
|
120 |
st.warning("Unrecognized response type. Please try again. e.g. Generate an image of a flying horse.")
|
121 |
|
122 |
-
st.session_state.messages.append({"role": "assistant", "content":
|
123 |
-
st.session_state.messages.append({"role": "assistant", "content": response})
|
124 |
|
|
|
42 |
|
43 |
if user_message := st.chat_input("Enter message"):
|
44 |
st.chat_message("user").markdown(user_message)
|
45 |
+
st.session_state.messages.append({"role": "user", "content": user_message, "avatar": "🤗"})
|
46 |
|
47 |
selected_tools = [agent_config.tool_loader.tools[idx] for idx, checkbox in enumerate(agent_config.tool_checkboxes) if checkbox]
|
48 |
# Handle submission with the selected inference URL
|
49 |
#app_agent_config()
|
50 |
|
51 |
response = ""
|
52 |
+
chat_respone = ""
|
53 |
with st.spinner('Please stand by ...'):
|
54 |
|
55 |
response = handle_submission(user_message, selected_tools, agent_config.url_endpoint, agent_config.document, agent_config.image, agent_config.context)
|
|
|
119 |
else:
|
120 |
st.warning("Unrecognized response type. Please try again. e.g. Generate an image of a flying horse.")
|
121 |
|
122 |
+
st.session_state.messages.append({"role": "assistant", "content": chat_respone, "avatar": "🦖"})
|
123 |
+
st.session_state.messages.append({"role": "assistant", "content": response, "avatar": "🤖"})
|
124 |
|