From 2ff911b08cc9c9bad90ba20f671335f9533e6849 Mon Sep 17 00:00:00 2001 From: Liu An Date: Mon, 9 Jun 2025 11:43:42 +0800 Subject: [PATCH] Fix: Set default rerank_model to empty string in Chat class (#8130) ### What problem does this PR solve? Previously when LLM.rerank_model was not configured: - SDK would pass None as the value - Database field with null=False constraint would reject it - Caused storage failures for unset rerank_model cases Now: - SDK checks for None value before database operations - Provides empty string as default when rerank_model is unset ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- sdk/python/ragflow_sdk/modules/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/python/ragflow_sdk/modules/chat.py b/sdk/python/ragflow_sdk/modules/chat.py index e85011504..39e681536 100644 --- a/sdk/python/ragflow_sdk/modules/chat.py +++ b/sdk/python/ragflow_sdk/modules/chat.py @@ -46,7 +46,7 @@ class Chat(Base): self.top_n = 8 self.top_k = 1024 self.variables = [{"key": "knowledge", "optional": True}] - self.rerank_model = None + self.rerank_model = "" self.empty_response = None self.opener = "Hi! I'm your assistant, what can I do for you?" self.show_quote = True