Skip to content

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

Fix: model type error. (#9308)

Kevin Hu5749aa30b099
diff --git a/agent/tools/retrieval.py b/agent/tools/retrieval.py
index cffbc75eaf..0469679567 100644
--- a/agent/tools/retrieval.py
+++ b/agent/tools/retrieval.py
@@ -86,7 +86,7 @@ class Retrieval(ToolBase, ABC):
kb_ids.append(id)
continue
kb_nm = self._canvas.get_variable_value(id)
- e, kb = KnowledgebaseService.get_by_name(kb_nm)
+ e, kb = KnowledgebaseService.get_by_name(kb_nm, self._canvas._tenant_id)
if not e:
raise Exception(f"Dataset({kb_nm}) does not exist.")
kb_ids.append(kb.id)
diff --git a/api/db/services/llm_service.py b/api/db/services/llm_service.py
index 68d7c5e840..f18db1b012 100644
--- a/api/db/services/llm_service.py
+++ b/api/db/services/llm_service.py
@@ -225,6 +225,9 @@ class TenantLLMService(CommonService):
if llm_id == llm["llm_name"]:
return llm["model_type"].split(",")[-1]
+ for llm in TenantLLMService.query(llm_name=llm_id):
+ return llm.model_type
+
for llm in LLMService.query(llm_name=llm_id):
return llm.model_type