generated from society-ai/simple-chatbot-openai
Meet your cheerful chat buddy! This app is your optimistic friend who always sees the bright side. From everyday questions to life’s big moments, get uplifting responses and positive vibes that’ll make you smile, no matter what you’re asking about!
Update app.py
All checks were successful
society-ai-hub-container-cache Actions Demo / build (push) Successful in 26s
All checks were successful
society-ai-hub-container-cache Actions Demo / build (push) Successful in 26s
This commit is contained in:
parent
b5390196f2
commit
b47383c2ba
5
app.py
5
app.py
@ -69,11 +69,6 @@ with gr.Blocks(css=BACKGROUND_CSS) as demo:
|
|||||||
history[-1]['content'] += f"\n[Error]: {str(e)}"
|
history[-1]['content'] += f"\n[Error]: {str(e)}"
|
||||||
yield history
|
yield history
|
||||||
|
|
||||||
def save_history(history):
|
|
||||||
"""Saves the conversation history to a text file."""
|
|
||||||
chat_history = "\n".join([f"{item['role'].capitalize()}: {item['content']}" for item in history])
|
|
||||||
return chat_history
|
|
||||||
|
|
||||||
# Set up the Gradio interface components
|
# Set up the Gradio interface components
|
||||||
msg.submit(user, [msg, user_name, emotion_picker, chatbot], [msg, chatbot], queue=False).then(
|
msg.submit(user, [msg, user_name, emotion_picker, chatbot], [msg, chatbot], queue=False).then(
|
||||||
bot, chatbot, chatbot
|
bot, chatbot, chatbot
|
||||||
|
Loading…
x
Reference in New Issue
Block a user