Skip to content

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

Fix:empty chat model fallback (#15477)

buua436eaa19bdb02aa
diff --git a/api/apps/restful_apis/chat_api.py b/api/apps/restful_apis/chat_api.py
index ed1805be36..acb8f8f81a 100644
--- a/api/apps/restful_apis/chat_api.py
+++ b/api/apps/restful_apis/chat_api.py
@@ -1203,7 +1203,7 @@ async def session_completion(chat_id_in_arg=""):
return get_data_error_result(message=f"Cannot use specified model {chat_model_id}.")
dia.llm_id = chat_model_id
dia.llm_setting = chat_model_config
- else:
+ elif not dia.llm_id:
logging.info("empty chat_model_id in req, use default chat model.")
_, tenant_info = TenantService.get_by_id(dia.tenant_id)
if not tenant_info or not tenant_info.llm_id: