File size: 571 Bytes
a3af861 7e7785e 269a0a9 7e7785e a3af861 269a0a9 7e7785e a3af861 7e7785e a3af861 269a0a9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import gradio as gr
def respond(message, chat_history):
# Bu aşamada Niko'nun basit bir test cevabı vermesini sağlıyoruz
bot_message = f"Merhaba! Ben Niko. Mesajını aldım: '{message}'"
chat_history.append({"role": "user", "content": message})
chat_history.append({"role": "assistant", "content": bot_message})
return "", chat_history
with gr.Blocks() as demo:
chatbot = gr.Chatbot(type="messages")
msg = gr.Textbox()
clear = gr.ClearButton([msg, chatbot])
msg.submit(respond, [msg, chatbot], [msg, chatbot])
demo.launch()
|