File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/orchestration/src/util Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -155,16 +155,16 @@ function mergeToolCalls(
155
155
const existingToolCall = mergedToolCalls . find (
156
156
tc => tc . id === toolCall . id
157
157
) ;
158
- // TODO: THIS
159
158
if ( existingToolCall ) {
160
159
// Merge existing tool call with incoming tool call
160
+ existingToolCall . id = toolCall . id ?? existingToolCall . id ;
161
161
existingToolCall . function . name =
162
162
toolCall . function ?. name ?? existingToolCall . function . name ;
163
163
existingToolCall . function . arguments =
164
- toolCall . function ? .arguments ?? existingToolCall . function . arguments ;
164
+ existingToolCall . function . arguments + ( toolCall . function ? .arguments ?? '' ) ;
165
165
} else {
166
166
// Add new tool call
167
- mergedToolCalls . push ( transformStreamingToolCall ( toolCall ) ) ;
167
+ mergedToolCalls . push ( transformStreamingToolCall ( toolCall ) ) ;
168
168
}
169
169
}
170
170
return mergedToolCalls ;
You can’t perform that action at this time.
0 commit comments