We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2050862 commit 3b83be2Copy full SHA for 3b83be2
src/chat/index.ts
@@ -707,7 +707,7 @@ export class OpenRouterChatLanguageModel implements LanguageModelV2 {
707
// Forward any unsent tool calls if finish reason is 'tool-calls'
708
if (finishReason === 'tool-calls') {
709
for (const toolCall of toolCalls) {
710
- if (!toolCall.sent) {
+ if (toolCall && !toolCall.sent) {
711
controller.enqueue({
712
type: 'tool-call',
713
toolCallId: toolCall.id ?? generateId(),
0 commit comments