Skip to content

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

Fix: use async_chat with sync wrapper in resume parser (#13320)

Yongteng Lei707de2461aee
diff --git a/rag/app/resume.py b/rag/app/resume.py
index 084f8c21b4..a6cf11eab5 100644
--- a/rag/app/resume.py
+++ b/rag/app/resume.py
@@ -1076,10 +1076,12 @@ def _call_llm(prompt: str, tenant_id , lang: str) -> Optional[dict]:
if attempt > 0:
gen_conf["seed"] = random.randint(0, 1000000)
- response = llm.chat(
- system=get_system_prompt(lang),
- history=[{"role": "user", "content": prompt}],
- gen_conf=gen_conf,
+ response = llm._run_coroutine_sync(
+ llm.async_chat(
+ system=get_system_prompt(lang),
+ history=[{"role": "user", "content": prompt}],
+ gen_conf=gen_conf,
+ )
)
cleaned = _clean_llm_json_response(response)
return _parse_json_with_repair(cleaned)