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/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -2347,8 +2347,9 @@ interface StreamTextResult<TOOLS extends ToolSet, OUTPUT extends Output> {
|
|
|
2347
2347
|
readonly providerMetadata: PromiseLike<ProviderMetadata | undefined>;
|
|
2348
2348
|
/**
|
|
2349
2349
|
* A text stream that returns only the generated text deltas. You can use it
|
|
2350
|
-
* as either an AsyncIterable or a ReadableStream.
|
|
2351
|
-
* stream
|
|
2350
|
+
* as either an AsyncIterable or a ReadableStream. Error parts are not
|
|
2351
|
+
* surfaced in this stream. Use the `onError` callback or `fullStream` to
|
|
2352
|
+
* observe them.
|
|
2352
2353
|
*/
|
|
2353
2354
|
readonly textStream: AsyncIterableStream<string>;
|
|
2354
2355
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -2347,8 +2347,9 @@ interface StreamTextResult<TOOLS extends ToolSet, OUTPUT extends Output> {
|
|
|
2347
2347
|
readonly providerMetadata: PromiseLike<ProviderMetadata | undefined>;
|
|
2348
2348
|
/**
|
|
2349
2349
|
* A text stream that returns only the generated text deltas. You can use it
|
|
2350
|
-
* as either an AsyncIterable or a ReadableStream.
|
|
2351
|
-
* stream
|
|
2350
|
+
* as either an AsyncIterable or a ReadableStream. Error parts are not
|
|
2351
|
+
* surfaced in this stream. Use the `onError` callback or `fullStream` to
|
|
2352
|
+
* observe them.
|
|
2352
2353
|
*/
|
|
2353
2354
|
readonly textStream: AsyncIterableStream<string>;
|
|
2354
2355
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1304,7 +1304,7 @@ function detectMediaType({
|
|
|
1304
1304
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
1305
1305
|
|
|
1306
1306
|
// src/version.ts
|
|
1307
|
-
var VERSION = true ? "6.0.
|
|
1307
|
+
var VERSION = true ? "6.0.237" : "0.0.0-test";
|
|
1308
1308
|
|
|
1309
1309
|
// src/util/download/download.ts
|
|
1310
1310
|
var download = async ({
|
|
@@ -4941,7 +4941,7 @@ async function generateText({
|
|
|
4941
4941
|
}
|
|
4942
4942
|
}
|
|
4943
4943
|
const invalidToolCalls = stepToolCalls.filter(
|
|
4944
|
-
(toolCall) => toolCall.invalid && toolCall.dynamic
|
|
4944
|
+
(toolCall) => toolCall.invalid && toolCall.dynamic && !toolCall.providerExecuted
|
|
4945
4945
|
);
|
|
4946
4946
|
clientToolOutputs = [];
|
|
4947
4947
|
for (const toolCall of invalidToolCalls) {
|
|
@@ -6818,16 +6818,18 @@ function runToolsTransformation({
|
|
|
6818
6818
|
toolCallsByToolCallId.set(toolCall.toolCallId, toolCall);
|
|
6819
6819
|
controller.enqueue(toolCall);
|
|
6820
6820
|
if (toolCall.invalid) {
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6821
|
+
if (!toolCall.providerExecuted) {
|
|
6822
|
+
enqueueToolResult({
|
|
6823
|
+
type: "tool-error",
|
|
6824
|
+
toolCallId: toolCall.toolCallId,
|
|
6825
|
+
toolName: toolCall.toolName,
|
|
6826
|
+
input: toolCall.input,
|
|
6827
|
+
error: (0, import_provider_utils19.getErrorMessage)(toolCall.error),
|
|
6828
|
+
dynamic: true,
|
|
6829
|
+
title: toolCall.title,
|
|
6830
|
+
...toolCall.toolMetadata != null ? { toolMetadata: toolCall.toolMetadata } : {}
|
|
6831
|
+
});
|
|
6832
|
+
}
|
|
6831
6833
|
break;
|
|
6832
6834
|
}
|
|
6833
6835
|
const tool2 = tools == null ? void 0 : tools[toolCall.toolName];
|