mod3
Browse files
app.py
CHANGED
@@ -23,7 +23,8 @@ def respond(
|
|
23 |
# 建立 Chat 介面
|
24 |
demo = gr.ChatInterface(
|
25 |
fn=respond,
|
26 |
-
|
|
|
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 多輪對話範例(自動記憶上下文)",
|