Spaces:
Sleeping
Sleeping
import gradio as gr | |
# Yksinkertainen vastausfunktio | |
def chatbot(message, history): | |
# history on lista viesteistä [(käyttäjä, botti), ...] | |
history = history or [] | |
vastaus = f"Vastasit: {message}" | |
history.append((message, vastaus)) | |
return history, history | |
# Gradio-sovellus | |
demo = gr.ChatInterface(fn=chatbot) | |
demo.launch() | |