fix(stream-text): handle undefined arguments

fixed #235
This commit is contained in:
藍+85CD committed 2025-11-21 12:30:38 +08:00
1 parent 0df8c10739
commit 6507aece6b
2 files changed
+2 -2

No files matched your search

@@ -170,7 +170,7 @@ export const streamText = (options: WithUnknown<WithTelemetry<StreamTextOptions>
...toolCall,
function: {
...toolCall.function,
arguments: toolCall.function.arguments!,
arguments: toolCall.function.arguments ?? '',
},
}
pushEvent({ toolCallId: toolCall.id, toolName: toolCall.function.name!, type: 'tool-call-streaming-start' })
+1 -1
View File
@@ -152,7 +152,7 @@ export const streamText = (options: WithUnknown<StreamTextOptions>): StreamTextR
...toolCall,
function: {
...toolCall.function,
arguments: toolCall.function.arguments!,
arguments: toolCall.function.arguments ?? '',
},
}
pushEvent({ toolCallId: toolCall.id, toolName: toolCall.function.name!, type: 'tool-call-streaming-start' })