File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,8 @@ inline std::string format_chat(const struct llama_model * model, const std::stri
7777 msg.content += " \n " + part[" text" ].get <std::string>();
7878 }
7979 }
80- } else {
81- throw std::runtime_error (" Invalid 'content' type (ref: https://github.com/ggerganov/llama.cpp/issues/8367)" );
80+ } else if (!(curr_msg. is_null () && curr_msg. contains ( " tool_calls " ))) {
81+ throw std::runtime_error (" Invalid 'content' type (ref: https://github.com/ggerganov/llama.cpp/issues/8367): " + curr_msg. dump () );
8282 }
8383 } else {
8484 throw std::runtime_error (" Missing 'content' (ref: https://github.com/ggerganov/llama.cpp/issues/8367)" );
@@ -474,6 +474,7 @@ static json format_final_response_oaicompat(const json & request, const json & r
474474 auto tools = json_value (request, " tools" , json::array ());
475475 json tool_calls;
476476 json message_content;
477+ printf (" # CONTENT: %s\n\n " , content.c_str ());
477478 if (json_value (request, " parse_tool_calls" , false )
478479 && !(parsed_tool_calls = parse_tool_calls (tools, chat_template, content)).tool_calls .empty ()) {
479480 finish_reason = " tool" ;
@@ -513,6 +514,7 @@ static json format_final_response_oaicompat(const json & request, const json & r
513514 }},
514515 {" id" , completion_id}
515516 };
517+ printf (" # RES: %s\n\n " , res.dump (2 ).c_str ());
516518
517519 // extra fields for debugging purposes
518520 if (verbose) {
You can’t perform that action at this time.
0 commit comments