huchiahsi commited on
Commit
b7b61b1
·
1 Parent(s): 7277f03
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -23,7 +23,8 @@ def respond(
23
  # 建立 Chat 介面
24
  demo = gr.ChatInterface(
25
  fn=respond,
26
- chatbot=gr.Chatbot(type="messages"), # 避免預設 deprecated tuples
 
27
  textbox=gr.Textbox(placeholder="輸入訊息...", container=False, scale=7),
28
  title="Gemini 2 Chat",
29
  description="Gemini 2 多輪對話範例(自動記憶上下文)",
 
23
  # 建立 Chat 介面
24
  demo = gr.ChatInterface(
25
  fn=respond,
26
+ type="messages", # 指定使用 OpenAI-style 格式
27
+ chatbot=gr.Chatbot(), # ❌ 不要指定 type,會造成衝突
28
  textbox=gr.Textbox(placeholder="輸入訊息...", container=False, scale=7),
29
  title="Gemini 2 Chat",
30
  description="Gemini 2 多輪對話範例(自動記憶上下文)",