File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
packages/agents-extensions/src Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @openai/agents-extensions ' : patch
3+ ---
4+
5+ fix: the aisdk extension should grab output when toolCalls is a blank array
6+
7+ When the output of a provider includes an empty tool calls array, we'd mistakenly skip over the text result. This patch checks for that condition.
Original file line number Diff line number Diff line change @@ -463,7 +463,10 @@ export class AiSdkModel implements Model {
463463 // Putting a text message here will let the agent loop to complete,
464464 // so adding this item only when the tool calls are empty.
465465 // Note that the same support is not available for streaming mode.
466- if ( ! result . toolCalls && result . text ) {
466+ if (
467+ ( ! result . toolCalls || result . toolCalls . length === 0 ) &&
468+ result . text
469+ ) {
467470 output . push ( {
468471 type : 'message' ,
469472 content : [ { type : 'output_text' , text : result . text } ] ,
You can’t perform that action at this time.
0 commit comments