|
@@ -331,6 +331,9 @@ static json oaicompat_completion_params_parse(
|
|
|
std::string response_type = json_value(response_format, "type", std::string());
|
|
std::string response_type = json_value(response_format, "type", std::string());
|
|
|
if (response_type == "json_object") {
|
|
if (response_type == "json_object") {
|
|
|
llama_params["json_schema"] = json_value(response_format, "schema", json::object());
|
|
llama_params["json_schema"] = json_value(response_format, "schema", json::object());
|
|
|
|
|
+ } else if (response_type == "json_schema") {
|
|
|
|
|
+ json json_schema = json_value(response_format, "json_schema", json::object());
|
|
|
|
|
+ llama_params["json_schema"] = json_value(json_schema, "schema", json::object());
|
|
|
} else if (!response_type.empty() && response_type != "text") {
|
|
} else if (!response_type.empty() && response_type != "text") {
|
|
|
throw std::runtime_error("response_format type must be one of \"text\" or \"json_object\", but got: " + response_type);
|
|
throw std::runtime_error("response_format type must be one of \"text\" or \"json_object\", but got: " + response_type);
|
|
|
}
|
|
}
|