openai: pretty indent json response

This commit is contained in:
ochafik 2024-05-22 03:51:49 +01:00
parent c8458fa5f7
commit a39e6e0758

View file

@ -3535,7 +3535,7 @@ int main(int argc, char ** argv) {
if (!result.error && result.stop) { if (!result.error && result.stop) {
json result_oai = format_final_response_oaicompat(data, result.data, completion_id); json result_oai = format_final_response_oaicompat(data, result.data, completion_id);
res.set_content(result_oai.dump(-1, ' ', false, json::error_handler_t::replace), "application/json; charset=utf-8"); res.set_content(result_oai.dump(2, ' ', false, json::error_handler_t::replace), "application/json; charset=utf-8");
} else { } else {
res_error(res, result.data); res_error(res, result.data);
} }