激活条件
仅当同时满足以下两个条件时:response_format设置为json_schema或json_object- 响应体是有效的 UTF-8,但包含可修复的 JSON 语法错误
修复内容
检测已修复的响应
限制
- 仅限非流式 — 不适用于流式响应
- 不会修复截断的输出
- 仅修复语法错误,不修复语义错误
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
ARouter 在使用 json_schema 或 json_object 响应格式时,自动修复格式错误的 JSON 响应。
response_format 设置为 json_schema 或 json_object| 问题 | 修复后 |
|---|---|
| Markdown 代码块 | {"key": "value"} |
| 尾随逗号 | {"a": 1, "b": 2} |
| 未加引号的键 | {"key": "value"} |
| 混合文本 + JSON | {"id": 1} |
| 单引号字符串 | {"key": "value"} |
{
"choices": [{"message": {"role": "assistant", "content": "{\"name\": \"John Doe\"}"}, "finish_reason": "stop"}],
"x_arouter": {"response_healed": true}
}