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: Anthropic param error (#3327)
Kevin Hu34d1daac676f
diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.pyindex ebc48954c0..9060fd4508 100644--- a/rag/llm/chat_model.py+++ b/rag/llm/chat_model.py@@ -1249,6 +1249,8 @@ class AnthropicChat(Base):self.system = systemif "max_tokens" not in gen_conf:gen_conf["max_tokens"] = 4096+ if "presence_penalty" in gen_conf: del gen_conf["presence_penalty"]+ if "frequency_penalty" in gen_conf: del gen_conf["frequency_penalty"]ans = ""try:@@ -1278,6 +1280,8 @@ class AnthropicChat(Base):self.system = systemif "max_tokens" not in gen_conf:gen_conf["max_tokens"] = 4096+ if "presence_penalty" in gen_conf: del gen_conf["presence_penalty"]+ if "frequency_penalty" in gen_conf: del gen_conf["frequency_penalty"]ans = ""total_tokens = 0@@ -1290,11 +1294,11 @@ class AnthropicChat(Base):**gen_conf,)for res in response.iter_lines():- res = res.decode("utf-8")- if "content_block_delta" in res and "data" in res:- text = json.loads(res[6:])["delta"]["text"]+ if res.type == 'content_block_delta':+ text = res.delta.textans += texttotal_tokens += num_tokens_from_string(text)+ yield ansexcept Exception as e:yield ans + "\n**ERROR**: " + str(e)