RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
fix MiniMax chat bug (#1733)
黄腾29f7f8b81ece
diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.pyindex 48dc29ba09..0a88f30272 100644--- a/rag/llm/chat_model.py+++ b/rag/llm/chat_model.py@@ -564,12 +564,15 @@ class MiniMaxChat(Base):)for resp in response.text.split("\n\n")[:-1]:resp = json.loads(resp[6:])- if "delta" in resp["choices"][0]:+ text = ""+ if "choices" in resp and "delta" in resp["choices"][0]:text = resp["choices"][0]["delta"]["content"]- else:- continueans += text- total_tokens += num_tokens_from_string(text)+ total_tokens = (+ total_tokens + num_tokens_from_string(text)+ if "usage" not in resp+ else resp["usage"]["total_tokens"]+ )yield ansexcept Exception as e: