omersaidd commited on
Commit
745d95f
·
verified ·
1 Parent(s): a3bcd4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -44,12 +44,21 @@ def chat_with_dify(message, history):
44
  return f"İstek gönderilirken hata: {str(e)}"
45
 
46
  # Gradio arayüzünü oluştur
47
- with gr.Blocks() as demo:
48
- gr.Markdown("# Etikos AI Chatbot")
 
 
 
 
49
 
 
 
 
50
  chatbot = gr.Chatbot(height=400)
51
- msg = gr.Textbox(placeholder="Mesajınızı buraya yazın...")
52
- clear = gr.Button("Konuşmayı Temizle")
 
 
53
 
54
  def respond(message, chat_history):
55
  bot_message = chat_with_dify(message, chat_history)
@@ -58,6 +67,7 @@ with gr.Blocks() as demo:
58
 
59
  # Buton olayları
60
  msg.submit(respond, [msg, chatbot], [msg, chatbot])
 
61
  clear.click(lambda: [], outputs=[chatbot])
62
  clear.click(lambda: "", outputs=[msg])
63
 
 
44
  return f"İstek gönderilirken hata: {str(e)}"
45
 
46
  # Gradio arayüzünü oluştur
47
+ with gr.Blocks(theme=gr.themes.Default(primary_hue="black")) as demo:
48
+ with gr.Row():
49
+ with gr.Column(scale=4):
50
+ gr.Markdown("# Etikos AI Chatbot")
51
+ with gr.Column(scale=1, min_width=100):
52
+ gr.Image(value="logo.png", label="", show_label=False, height=50, container=False)
53
 
54
+ with gr.Row():
55
+ clear = gr.Button("Konuşmayı Temizle")
56
+
57
  chatbot = gr.Chatbot(height=400)
58
+
59
+ with gr.Row():
60
+ msg = gr.Textbox(label="Mesajınız", placeholder="Mesajınızı buraya yazın...")
61
+ send = gr.Button("Gönder")
62
 
63
  def respond(message, chat_history):
64
  bot_message = chat_with_dify(message, chat_history)
 
67
 
68
  # Buton olayları
69
  msg.submit(respond, [msg, chatbot], [msg, chatbot])
70
+ send.click(respond, [msg, chatbot], [msg, chatbot])
71
  clear.click(lambda: [], outputs=[chatbot])
72
  clear.click(lambda: "", outputs=[msg])
73