@ai-sdk/provider-utils
Advanced tools
+6
-0
| # @ai-sdk/provider-utils | ||
| ## 5.0.6 | ||
| ### Patch Changes | ||
| - ac306ed: Fix `StreamingToolCallTracker` finalizing streaming tool calls on parsable partial JSON. Tool calls now only finalize during stream flush, restoring the behavior of #13137: a parsable argument buffer can still be the prefix of a longer argument string, so finalizing early could act on truncated tool inputs. | ||
| ## 5.0.5 | ||
@@ -4,0 +10,0 @@ |
+1
-1
| { | ||
| "name": "@ai-sdk/provider-utils", | ||
| "version": "5.0.5", | ||
| "version": "5.0.6", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -7,3 +7,2 @@ import { | ||
| import { generateId as defaultGenerateId } from './generate-id'; | ||
| import { isParsableJson } from './parse-json'; | ||
@@ -192,7 +191,6 @@ /** | ||
| // Check if tool call is complete | ||
| // (some providers send the full tool call in one chunk) | ||
| if (isParsableJson(toolCall.function.arguments)) { | ||
| this.finishToolCall(toolCall); | ||
| } | ||
| // Tool calls must not finalize before the stream ends: a parsable | ||
| // argument buffer can still be the prefix of a longer argument string, | ||
| // so acting on it early would use truncated inputs (see #13137). | ||
| // Finalization happens in flush(). | ||
| } | ||
@@ -216,7 +214,2 @@ | ||
| } | ||
| // Check if tool call is complete | ||
| if (isParsableJson(toolCall.function.arguments)) { | ||
| this.finishToolCall(toolCall); | ||
| } | ||
| } | ||
@@ -223,0 +216,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
763332
-0.03%13179
-0.09%