From b670a5b19f177bbe0d25129f98943258405bddac Mon Sep 17 00:00:00 2001 From: liuwei Date: Thu, 13 Mar 2025 15:58:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=85=A5dify=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dify/dify_chat.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dify/dify_chat.py b/dify/dify_chat.py index 9efd30a..152366d 100644 --- a/dify/dify_chat.py +++ b/dify/dify_chat.py @@ -140,14 +140,16 @@ class DifyChat: "Accept": "text/event-stream" # 指定接受事件流 } + inputs_params = { + "query": query, + "conversation_id": session_id + } # 准备请求数据 data = { - "query": query, "sys.files": [], "user": user_id, - "inputs": { "query": query}, - "response_mode": "streaming", # 使用流式响应 - "conversation_id": session_id # 使用会话ID保持上下文 + "inputs": inputs_params, + "response_mode": "streaming" # 使用流式响应 } # 添加历史记录