File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -621,6 +621,11 @@ class BackendServiceImpl final : public backend::Backend::Service {
621621 content_val = msg.content ();
622622 }
623623
624+ // If content is an object (e.g., from tool call failures), convert to string
625+ if (content_val.is_object ()) {
626+ content_val = content_val.dump ();
627+ }
628+
624629 // If content is a string and this is the last user message with images/audio, combine them
625630 if (content_val.is_string () && is_last_user_msg && has_images_or_audio) {
626631 json content_array = json::array ();
@@ -1046,6 +1051,11 @@ class BackendServiceImpl final : public backend::Backend::Service {
10461051 content_val = msg.content ();
10471052 }
10481053
1054+ // If content is an object (e.g., from tool call failures), convert to string
1055+ if (content_val.is_object ()) {
1056+ content_val = content_val.dump ();
1057+ }
1058+
10491059 // If content is a string and this is the last user message with images/audio, combine them
10501060 if (content_val.is_string () && is_last_user_msg && has_images_or_audio) {
10511061 json content_array = json::array ();
You can’t perform that action at this time.
0 commit comments