Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: Avoid deepcopy crash for OpenAI‑API‑compatible chat models (#17556)

Lynn0139d6f8c3fe
diff --git a/rag/advanced_rag/agentic_rag.py b/rag/advanced_rag/agentic_rag.py
index 149687402b..ac617d1c7e 100644
--- a/rag/advanced_rag/agentic_rag.py
+++ b/rag/advanced_rag/agentic_rag.py
@@ -30,7 +30,6 @@ model (no tool schema is bound onto it) and its ``async_chat*`` calls take
the fast non-tool-calling path.
"""
-from copy import deepcopy
import logging
import re
from typing import Any, List
@@ -83,7 +82,7 @@ class RAGTools:
thinking_mode: str = "medium",
):
self.tenant_ids = tenant_ids
- self.chat_mdl = deepcopy(chat_mdl)
+ self.chat_mdl = chat_mdl
self.embed_mdl = embed_mdl
self.thinking_mode = thinking_mode
self.field_map = {}