mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Log llm response on exception (#6750)
### What problem does this PR solve? Log llm response on exception ### Type of change - [x] Refactoring
This commit is contained in:
@ -56,7 +56,8 @@ class Extractor:
|
||||
response = self._llm.chat(system_msg[0]["content"], hist, conf)
|
||||
response = re.sub(r"<think>.*</think>", "", response, flags=re.DOTALL)
|
||||
if response.find("**ERROR**") >= 0:
|
||||
raise Exception(response)
|
||||
logging.warning(f"Extractor._chat got error. response: {response}")
|
||||
return ""
|
||||
set_llm_cache(self._llm.llm_name, system, response, history, gen_conf)
|
||||
return response
|
||||
|
||||
|
||||
Reference in New Issue
Block a user