mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-07-04 16:35:11 +08:00
fix: llm_generator.py JSONDecodeError (#8504)
This commit is contained in:
parent
6e37750fbd
commit
eaa7e9b1f0
@ -47,6 +47,8 @@ class LLMGenerator:
|
||||
)
|
||||
answer = response.message.content
|
||||
cleaned_answer = re.sub(r"^.*(\{.*\}).*$", r"\1", answer, flags=re.DOTALL)
|
||||
if cleaned_answer is None:
|
||||
return ""
|
||||
result_dict = json.loads(cleaned_answer)
|
||||
answer = result_dict["Your Output"]
|
||||
name = answer.strip()
|
||||
|
Loading…
x
Reference in New Issue
Block a user