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.
- package/CHANGELOG.md +8 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -12
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +1 -1
- package/package.json +2 -2
- package/src/generate-text/generate-text.ts +4 -1
- package/src/generate-text/run-tools-transformation.ts +14 -12
- package/src/generate-text/stream-text-result.ts +3 -2
package/dist/internal/index.js
CHANGED
|
@@ -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.
|
|
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 ({
|
package/dist/internal/index.mjs
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
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 =>
|
|
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
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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.
|
|
283
|
-
* stream
|
|
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
|
|