feat(api): use `json_repair` to fix invalid json while generating structured output (#18977)
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>pull/19070/head
parent
28a59ba344
commit
a147d2a200
Loading…
Reference in New Issue