parser: fix structured output bug (#22302)
* fix very stupid structured output bug * Things just cannot be too easy.
This commit is contained in:
committed by
GitHub
parent
361fe72acb
commit
0adede866d
@@ -947,7 +947,9 @@ json oaicompat_chat_params_parse(
|
||||
json response_format = json_value(body, "response_format", json::object());
|
||||
std::string response_type = json_value(response_format, "type", std::string());
|
||||
if (response_type == "json_object") {
|
||||
json_schema = json_value(response_format, "schema", json::object());
|
||||
if (response_format.contains("schema") || json_schema.empty()) {
|
||||
json_schema = json_value(response_format, "schema", json::object());
|
||||
}
|
||||
} else if (response_type == "json_schema") {
|
||||
auto schema_wrapper = json_value(response_format, "json_schema", json::object());
|
||||
json_schema = json_value(schema_wrapper, "schema", json::object());
|
||||
|
||||
Reference in New Issue
Block a user