Skip to content

Commit 43d6a5e

Browse files
authored
[JS] fix: assistant tool_outputs (#926)
## Linked issues closes: #925 ## Details Fix the missing `tool_call_id` issue when a turn contains multiple assistant runs #### Change details - One turn may execute several actions, but may some of them are required for assistant. Only return required tool calls to assistant. - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
1 parent 349f03f commit 43d6a5e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/packages/teams-ai/src/planners/AssistantsPlanner.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,10 @@ export class AssistantsPlanner<TState extends TurnState = TurnState> implements
289289
for (const action in actionOutputs) {
290290
const output = actionOutputs[action];
291291
const tool_call_id = tool_map[action];
292-
tool_outputs.push({ tool_call_id, output });
292+
if (tool_call_id !== undefined) {
293+
// Add required output only
294+
tool_outputs.push({ tool_call_id, output });
295+
}
293296
}
294297

295298
// Submit the tool outputs

0 commit comments

Comments
 (0)