Skip to content

Commit c66bc50

Browse files
committed
[fix] main_camera task_output out_json_str \n
1 parent b4007fc commit c66bc50

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

projects/llm_framework/main_camera/src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,14 @@ class llm_camera : public StackFlow {
213213
std::string base64_data;
214214
int ret = StackFlows::encode_base64(out_data, base64_data);
215215
std::string out_json_str;
216+
out_json_str.reserve(llm_channel->request_id_.size() + llm_channel->work_id_.size() + base64_data.size() + 108);
216217
out_json_str += R"({"request_id":")";
217218
out_json_str += llm_channel->request_id_;
218219
out_json_str += R"(","work_id":")";
219220
out_json_str += llm_channel->work_id_;
220221
out_json_str += R"(","object":"image.yuvraw.base64","error":{"code":0, "message":""},"data":")";
221222
out_json_str += base64_data;
222-
out_json_str += R"("}\n)";
223+
out_json_str += "\"}\n";
223224
llm_channel->send_raw_to_usr(out_json_str);
224225
}
225226
}

0 commit comments

Comments
 (0)