Skip to content

Commit 47a0f34

Browse files
committed
fix deltas of tool_call.name
1 parent 79c137f commit 47a0f34

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

common/chat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ std::vector<common_chat_msg_diff> common_chat_msg_diff::compute_diffs(const comm
101101
if (!args_diff.empty() || pref.id != newf.id) {
102102
auto & diff = diffs.emplace_back();
103103
diff.tool_call_index = idx;
104-
diff.tool_call_delta.name = newf.name;
105104
if (pref.id != newf.id) {
106105
diff.tool_call_delta.id = newf.id;
106+
diff.tool_call_delta.name = newf.name;
107107
}
108108
diff.tool_call_delta.arguments = args_diff;
109109
}

tools/server/tests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def make_any_request(
341341
tool_call['id'] = tc['id']
342342
fct = tc['function']
343343
if fct.get('name') is not None:
344-
tool_call['function']['name'] = fct['name']
344+
tool_call['function']['name'] = tool_call['function'].get('name', '') + fct['name']
345345
if fct.get('arguments') is not None:
346346
assert len(fct['arguments']) > 0, f'Expected non empty arguments delta!'
347347
tool_call['function']['arguments'] += fct['arguments']

0 commit comments

Comments
 (0)