mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-04-28 03:30:20 +00:00
parser: fix structured output bug (#22302)
* fix very stupid structured output bug * Things just cannot be too easy.
This commit is contained in:
parent
361fe72acb
commit
0adede866d
2 changed files with 72 additions and 10 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue