From 35ac17f3f131343d0f6e7efa330f328799846f6f Mon Sep 17 00:00:00 2001 From: ochafik Date: Wed, 30 Oct 2024 12:38:34 +0000 Subject: [PATCH] `tool-call`: fix missing initializer errors --- common/tool-call.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/common/tool-call.cpp b/common/tool-call.cpp index 8c6cdb950..5862921f5 100644 --- a/common/tool-call.cpp +++ b/common/tool-call.cpp @@ -207,8 +207,13 @@ static llama_tool_calls parse_llama_3_tool_calls(const json & tools, const std:: std::smatch match; if (std::regex_search(input, match, python_tag_regex)) { return { - match.prefix().str(), { - {"ipython", (json {{"code", match[1].str()}}).dump()}, + /* .content = */ match.prefix().str(), + /* .tool_calls = */ { + { + /* .name = */ "ipython", + /* .arguments = */ (json {{"code", match[1].str()}}).dump(), + /* .id = */ "", + }, } }; } @@ -224,8 +229,13 @@ static llama_tool_calls parse_functionary_v3_llama_3_1_tool_calls(const json & t std::smatch match; if (std::regex_search(input, match, python_tag_regex)) { return { - match.prefix().str(), { - {"ipython", (json {{"code", match[1].str()}}).dump()}, + /* .content = */ match.prefix().str(), + /* .tool_calls = */ { + { + /* .name = */ "ipython", + /* .arguments = */ (json {{"code", match[1].str()}}).dump(), + /* .id = */ "", + }, } }; }