cli : fix crash on invalid UTF-8 in prompt or files (#31563)
Assisted-by: Claude
This commit is contained in:
1 parent
8820b088de
commit
6c01da6278
1 file changed
+1
-1
@@ -362,7 +362,7 @@ bool cli_context::generate_completion(generated_content & content_out, cli_timin
|
||||
|
||||
ui::assistant_turn a;
|
||||
|
||||
std::string err = client.post_sse("/v1/chat/completions", body.dump(), should_stop, [&](const std::string & payload) {
|
||||
std::string err = client.post_sse("/v1/chat/completions", body.dump_safe(), should_stop, [&](const std::string & payload) {
|
||||
json chunk = json::parse_no_throw(payload);
|
||||
if (chunk.is_discarded()) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user