From 707de2461aee972fff1154400dc9d87e6d0b92a2 Mon Sep 17 00:00:00 2001 From: Yongteng Lei Date: Mon, 2 Mar 2026 19:51:06 +0800 Subject: [PATCH] Fix: use async_chat with sync wrapper in resume parser (#13320) ### What problem does this PR solve? Fix AttributeError when calling llm.chat() in resume parser. LLMBundle only has async_chat method, not chat method. Use `_run_coroutine_sync` wrapper to call async_chat synchronously. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/app/resume.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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)