Skip to content

Commit 35ac17f

Browse files
author
ochafik
committed
tool-call: fix missing initializer errors
1 parent 3ebdb2b commit 35ac17f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

common/tool-call.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,13 @@ static llama_tool_calls parse_llama_3_tool_calls(const json & tools, const std::
207207
std::smatch match;
208208
if (std::regex_search(input, match, python_tag_regex)) {
209209
return {
210-
match.prefix().str(), {
211-
{"ipython", (json {{"code", match[1].str()}}).dump()},
210+
/* .content = */ match.prefix().str(),
211+
/* .tool_calls = */ {
212+
{
213+
/* .name = */ "ipython",
214+
/* .arguments = */ (json {{"code", match[1].str()}}).dump(),
215+
/* .id = */ "",
216+
},
212217
}
213218
};
214219
}
@@ -224,8 +229,13 @@ static llama_tool_calls parse_functionary_v3_llama_3_1_tool_calls(const json & t
224229
std::smatch match;
225230
if (std::regex_search(input, match, python_tag_regex)) {
226231
return {
227-
match.prefix().str(), {
228-
{"ipython", (json {{"code", match[1].str()}}).dump()},
232+
/* .content = */ match.prefix().str(),
233+
/* .tool_calls = */ {
234+
{
235+
/* .name = */ "ipython",
236+
/* .arguments = */ (json {{"code", match[1].str()}}).dump(),
237+
/* .id = */ "",
238+
},
229239
}
230240
};
231241
}

0 commit comments

Comments
 (0)