From 59075a0b5847808194d8936db068a60c5f967bb8 Mon Sep 17 00:00:00 2001 From: 6ba3i <112825897+6ba3i@users.noreply.github.com> Date: Fri, 16 Jan 2026 17:47:12 +0800 Subject: [PATCH] Fix : p3 level sdk test error for update chat (#12654) ### What problem does this PR solve? fix for update chat failing ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- sdk/python/ragflow_sdk/modules/chat.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/python/ragflow_sdk/modules/chat.py b/sdk/python/ragflow_sdk/modules/chat.py index 53fcc1af9..474fa54b8 100644 --- a/sdk/python/ragflow_sdk/modules/chat.py +++ b/sdk/python/ragflow_sdk/modules/chat.py @@ -60,6 +60,12 @@ class Chat(Base): super().__init__(rag, res_dict) def update(self, update_message: dict): + if not isinstance(update_message, dict): + raise Exception("ValueError('`update_message` must be a dict')") + if update_message.get("llm") == {}: + raise Exception("ValueError('`llm` cannot be empty')") + if update_message.get("prompt") == {}: + raise Exception("ValueError('`prompt` cannot be empty')") res = self.put(f"/chats/{self.id}", update_message) res = res.json() if res.get("code") != 0: