mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-05-13 11:58:15 +08:00

When generating JSON schema using an LLM in the structured output feature, models may occasionally return invalid JSON, which prevents clients from correctly parsing the response and can lead to UI breakage. This commit addresses the issue by introducing `json_repair` to automatically fix invalid JSON strings returned by the LLM, ensuring smoother functionality and better client-side handling of structured outputs. Co-authored-by: lizb <lizb@sugon.com>