fix: Fix broken structured output when using $refs in json_schema (#21699)

This commit is contained in:
Galunid
2026-04-11 01:26:36 +02:00
committed by GitHub
parent 81069a808a
commit b136b62cf9
2 changed files with 21 additions and 4 deletions
+4
View File
@@ -69,6 +69,10 @@ common_chat_params peg_generator::generate_parser(const common_chat_template &
auto schema = function.contains("parameters") ? function.at("parameters") : json::object();
builder.resolve_refs(schema);
});
if (has_response_format) {
auto schema = inputs.json_schema;
builder.resolve_refs(schema);
}
parser.build_grammar(builder, data.grammar_lazy);
});