Skip to content

Commit

Permalink
Modify conversation submission flow in app.py
Browse files Browse the repository at this point in the history
- Adjust submit_conversation call to remove redundant outputs
- Add submit_conversation call after updating dataframe to ensure consistent conversation tracking
  • Loading branch information
davidberenstein1957 committed Feb 10, 2025
1 parent c5f8c61 commit 81490b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,10 @@ def submit_conversation(dataframe, conversation_id, session_id, language):
outputs=[chatbot, chat_input],
).then(respond, inputs=[chatbot, language], outputs=[chatbot]).then(
lambda: gr.Textbox(interactive=True), None, [chat_input]
).then(update_dataframe, inputs=[dataframe, chatbot], outputs=[dataframe])
).then(update_dataframe, inputs=[dataframe, chatbot], outputs=[dataframe]).then(
submit_conversation,
inputs=[dataframe, conversation_id, session_id, language],
)

chatbot.like(
fn=wrangle_like_data,
Expand All @@ -476,7 +479,6 @@ def submit_conversation(dataframe, conversation_id, session_id, language):
).then(
submit_conversation,
inputs=[dataframe, conversation_id, session_id, language],
outputs=[dataframe, chatbot],
)

chatbot.retry(
Expand Down

0 comments on commit 81490b8

Please sign in to comment.