ai 6.0.236 → 6.0.237

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -164,7 +164,7 @@ function detectMediaType({
164
164
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
165
165
 
166
166
  // src/version.ts
167
- var VERSION = true ? "6.0.236" : "0.0.0-test";
167
+ var VERSION = true ? "6.0.237" : "0.0.0-test";
168
168
 
169
169
  // src/util/download/download.ts
170
170
  var download = async ({
@@ -144,7 +144,7 @@ import {
144
144
  } from "@ai-sdk/provider-utils";
145
145
 
146
146
  // src/version.ts
147
- var VERSION = true ? "6.0.236" : "0.0.0-test";
147
+ var VERSION = true ? "6.0.237" : "0.0.0-test";
148
148
 
149
149
  // src/util/download/download.ts
150
150
  var download = async ({
@@ -2815,7 +2815,7 @@ To see `streamText` in action, check out [these examples](#examples).
2815
2815
  name: 'textStream',
2816
2816
  type: 'AsyncIterableStream<string>',
2817
2817
  description:
2818
- 'A text stream that returns only the generated text deltas. You can use it as either an AsyncIterable or a ReadableStream. When an error occurs, the stream will throw the error.',
2818
+ 'A text stream that returns only the generated text deltas. You can use it as either an AsyncIterable or a ReadableStream. Error parts are not surfaced in this stream. Use the `onError` callback or `fullStream` to observe them.',
2819
2819
  },
2820
2820
  {
2821
2821
  name: 'fullStream',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "6.0.236",
3
+ "version": "6.0.237",
4
4
  "description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@opentelemetry/api": "^1.9.0",
48
- "@ai-sdk/gateway": "3.0.158",
48
+ "@ai-sdk/gateway": "3.0.159",
49
49
  "@ai-sdk/provider": "3.0.14",
50
50
  "@ai-sdk/provider-utils": "4.0.40"
51
51
  },
@@ -999,7 +999,10 @@ export async function generateText<
999
999
  // insert error tool outputs for invalid tool calls:
1000
1000
  // TODO AI SDK 6: invalid inputs should not require output parts
1001
1001
  const invalidToolCalls = stepToolCalls.filter(
1002
- toolCall => toolCall.invalid && toolCall.dynamic,
1002
+ toolCall =>
1003
+ toolCall.invalid &&
1004
+ toolCall.dynamic &&
1005
+ !toolCall.providerExecuted,
1003
1006
  );
1004
1007
 
1005
1008
  clientToolOutputs = [];
@@ -318,18 +318,20 @@ export function runToolsTransformation<TOOLS extends ToolSet>({
318
318
  controller.enqueue(toolCall);
319
319
 
320
320
  if (toolCall.invalid) {
321
- enqueueToolResult({
322
- type: 'tool-error',
323
- toolCallId: toolCall.toolCallId,
324
- toolName: toolCall.toolName,
325
- input: toolCall.input,
326
- error: getErrorMessage(toolCall.error!),
327
- dynamic: true,
328
- title: toolCall.title,
329
- ...(toolCall.toolMetadata != null
330
- ? { toolMetadata: toolCall.toolMetadata }
331
- : {}),
332
- });
321
+ if (!toolCall.providerExecuted) {
322
+ enqueueToolResult({
323
+ type: 'tool-error',
324
+ toolCallId: toolCall.toolCallId,
325
+ toolName: toolCall.toolName,
326
+ input: toolCall.input,
327
+ error: getErrorMessage(toolCall.error!),
328
+ dynamic: true,
329
+ title: toolCall.title,
330
+ ...(toolCall.toolMetadata != null
331
+ ? { toolMetadata: toolCall.toolMetadata }
332
+ : {}),
333
+ });
334
+ }
333
335
  break;
334
336
  }
335
337
 
@@ -279,8 +279,9 @@ export interface StreamTextResult<
279
279
 
280
280
  /**
281
281
  * A text stream that returns only the generated text deltas. You can use it
282
- * as either an AsyncIterable or a ReadableStream. When an error occurs, the
283
- * stream will throw the error.
282
+ * as either an AsyncIterable or a ReadableStream. Error parts are not
283
+ * surfaced in this stream. Use the `onError` callback or `fullStream` to
284
+ * observe them.
284
285
  */
285
286
  readonly textStream: AsyncIterableStream<string>;
286
287