From 230865c4f751d47fd43f170f24085bc47082c90f Mon Sep 17 00:00:00 2001 From: ssccinng Date: Thu, 27 Feb 2025 16:08:54 +0800 Subject: [PATCH] Fix: stream post body (#5434) ### What problem does this PR solve? Fix stream post body ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- sdk/python/ragflow_sdk/modules/session.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/python/ragflow_sdk/modules/session.py b/sdk/python/ragflow_sdk/modules/session.py index 5f5ca6dc..f3089882 100644 --- a/sdk/python/ragflow_sdk/modules/session.py +++ b/sdk/python/ragflow_sdk/modules/session.py @@ -65,7 +65,7 @@ class Session(Base): return message def _ask_chat(self, question: str, stream: bool, **kwargs): - json_data = {"question": question, "stream": True, "session_id": self.id} + json_data = {"question": question, "stream": stream, "session_id": self.id} json_data.update(kwargs) res = self.post(f"/chats/{self.chat_id}/completions", json_data, stream=stream) @@ -73,7 +73,7 @@ class Session(Base): def _ask_agent(self, question: str, stream: bool): res = self.post(f"/agents/{self.agent_id}/completions", - {"question": question, "stream": True, "session_id": self.id}, stream=stream) + {"question": question, "stream": stream, "session_id": self.id}, stream=stream) return res def update(self, update_message):