mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-05-03 08:47:48 +08:00
fix: handle null response in LLM and improve JSON parsing in agent (#13187)
Fixes AttributeError in _remove_reasoning_content() when LLM returns None, and improves JSON parsing regex for markdown code fences in agent_with_tools.py
This commit is contained in:
@ -265,6 +265,8 @@ class LLMBundle(LLM4Tenant):
|
||||
generation.end()
|
||||
|
||||
def _remove_reasoning_content(self, txt: str) -> str:
|
||||
if txt is None:
|
||||
return None
|
||||
first_think_start = txt.find("<think>")
|
||||
if first_think_start == -1:
|
||||
return txt
|
||||
|
||||
Reference in New Issue
Block a user