Spaces:
No application file
No application file
app.py
Browse filesimport gradio as gr
# Dit is mijn "antwoordfunctie"
def chat(user_message, history=[]):
# history is een lijst van alle eerdere berichten
history.append(("Jij", user_message))
antwoord = "Angel zegt: " + user_message[::-1] # tijdelijk antwoord (om te testen draai ik jouw tekst om 😉)
history.append(("Angel", antwoord))
return history, history
with gr.Blocks() as demo:
chatbot = gr.Chatbot()
msg = gr.Textbox()
clear = gr.Button("Wissen")
def respond(message, history):
return chat(message, history)
msg.submit(respond, [msg, chatbot], [chatbot, chatbot])
clear.click(lambda: None, None, chatbot, queue=False)
demo.launch()