Update app.py
Browse files
app.py
CHANGED
@@ -96,22 +96,19 @@ def handle_submission():
|
|
96 |
# Display the agent's response
|
97 |
if isinstance(response, str):
|
98 |
# Display the text response
|
|
|
99 |
st.write(response)
|
100 |
-
elif isinstance(response,
|
101 |
-
#
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
st.image(img)
|
109 |
-
elif "Audio" in response_keys:
|
110 |
-
# Handle audio response (replace with your audio rendering code)
|
111 |
-
st.audio(response["Audio"])
|
112 |
-
# Add more conditions for other types if needed
|
113 |
else:
|
114 |
# Handle unrecognized response type
|
|
|
115 |
st.warning("Unrecognized response type.")
|
116 |
|
117 |
|
|
|
96 |
# Display the agent's response
|
97 |
if isinstance(response, str):
|
98 |
# Display the text response
|
99 |
+
print("text")
|
100 |
st.write(response)
|
101 |
+
elif isinstance(response, Image):
|
102 |
+
# Display the image response
|
103 |
+
print("image")
|
104 |
+
st.image(response)
|
105 |
+
elif isinstance(response, Audio):
|
106 |
+
print("audio")
|
107 |
+
# Handle audio response (replace with your audio rendering code)
|
108 |
+
st.audio(response)
|
|
|
|
|
|
|
|
|
|
|
109 |
else:
|
110 |
# Handle unrecognized response type
|
111 |
+
print("warning")
|
112 |
st.warning("Unrecognized response type.")
|
113 |
|
114 |
|