From 16ec6ad34616dea8d6c66257509954b6baa43c87 Mon Sep 17 00:00:00 2001 From: Billy Bao Date: Mon, 27 Oct 2025 15:18:56 +0800 Subject: [PATCH] Fix: Pass kwargs in python api #10699 (#10808) ### What problem does this PR solve? Fix: Pass kwargs in python api #10699 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- sdk/python/ragflow_sdk/modules/session.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/python/ragflow_sdk/modules/session.py b/sdk/python/ragflow_sdk/modules/session.py index 899a48fa9..30d7aeea3 100644 --- a/sdk/python/ragflow_sdk/modules/session.py +++ b/sdk/python/ragflow_sdk/modules/session.py @@ -40,7 +40,7 @@ class Session(Base): If stream=False, returns a single Message object for the final answer. """ if self.__session_type == "agent": - res = self._ask_agent(question, stream) + res = self._ask_agent(question, stream, **kwargs) elif self.__session_type == "chat": res = self._ask_chat(question, stream, **kwargs) else: @@ -97,9 +97,11 @@ class Session(Base): json_data, stream=stream) return res - def _ask_agent(self, question: str, stream: bool): + def _ask_agent(self, question: str, stream: bool, **kwargs): + json_data = {"question": question, "stream": stream, "session_id": self.id} + json_data.update(kwargs) res = self.post(f"/agents/{self.agent_id}/completions", - {"question": question, "stream": stream, "session_id": self.id}, stream=stream) + json_data, stream=stream) return res def update(self, update_message):