Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -405,14 +405,15 @@ def process_button_click(head, button_index, topic_desc, top_concept_index):
|
|
405 |
topic_text_index = 'topic_' + str(button_index)
|
406 |
topic_text = head.ca._df[topic_text_index][top_concept_index]
|
407 |
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
|
|
416 |
|
417 |
# ... (add response & image to message)
|
418 |
st.session_state.messages.append({"role": "user", "content": topic_desc, "topic": "ml", "image": None})
|
|
|
405 |
topic_text_index = 'topic_' + str(button_index)
|
406 |
topic_text = head.ca._df[topic_text_index][top_concept_index]
|
407 |
|
408 |
+
with st.chat_message("assistant"):
|
409 |
+
response = head.answering_agent.generate_response_topic(topic_desc, topic_text, head.get_conversation(), head.selected_mode)
|
410 |
+
image, caption = head.answering_agent.generate_image(topic_text)
|
411 |
+
topic = topic_desc
|
412 |
+
|
413 |
+
st.session_state.topic_matrix[top_concept_index][button_index] += 1
|
414 |
+
|
415 |
+
st.write(response)
|
416 |
+
if image and caption != "": st.image(image, caption)
|
417 |
|
418 |
# ... (add response & image to message)
|
419 |
st.session_state.messages.append({"role": "user", "content": topic_desc, "topic": "ml", "image": None})
|