有効化条件
以下の両方の条件が満たされた場合のみ: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}
}