ai 6.0.261 → 6.0.263
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 +16 -0
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +2 -2
- package/src/generate-object/stream-object.ts +9 -2
- package/src/generate-text/stream-text.ts +8 -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.263" : "0.0.0-test";
|
|
168
168
|
|
|
169
169
|
// src/util/download/download.ts
|
|
170
170
|
var download = async ({
|
package/dist/internal/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.263",
|
|
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.179",
|
|
49
49
|
"@ai-sdk/provider": "3.0.15",
|
|
50
50
|
"@ai-sdk/provider-utils": "4.0.46"
|
|
51
51
|
},
|
|
@@ -51,6 +51,7 @@ import {
|
|
|
51
51
|
} from '../util/async-iterable-stream';
|
|
52
52
|
import { createStitchableStream } from '../util/create-stitchable-stream';
|
|
53
53
|
import type { DownloadFunction } from '../util/download/download-function';
|
|
54
|
+
import { notify } from '../util/notify';
|
|
54
55
|
import { now as originalNow } from '../util/now';
|
|
55
56
|
import { prepareRetries } from '../util/prepare-retries';
|
|
56
57
|
import { getOutputStrategy, type OutputStrategy } from './output-strategy';
|
|
@@ -462,7 +463,10 @@ class DefaultStreamObjectResult<
|
|
|
462
463
|
controller.enqueue(chunk);
|
|
463
464
|
|
|
464
465
|
if (chunk.type === 'error') {
|
|
465
|
-
|
|
466
|
+
void notify({
|
|
467
|
+
event: { error: wrapGatewayError(chunk.error) },
|
|
468
|
+
callbacks: onError,
|
|
469
|
+
});
|
|
466
470
|
}
|
|
467
471
|
},
|
|
468
472
|
});
|
|
@@ -877,7 +881,10 @@ class DefaultStreamObjectResult<
|
|
|
877
881
|
onError(error) {
|
|
878
882
|
const wrappedError = wrapGatewayError(error);
|
|
879
883
|
self.rejectResultPromises(wrappedError);
|
|
880
|
-
void
|
|
884
|
+
void notify({
|
|
885
|
+
event: { error: wrappedError },
|
|
886
|
+
callbacks: onError,
|
|
887
|
+
});
|
|
881
888
|
},
|
|
882
889
|
});
|
|
883
890
|
},
|
|
@@ -935,7 +935,10 @@ class DefaultStreamTextResult<
|
|
|
935
935
|
part.type === 'tool-input-delta' ||
|
|
936
936
|
part.type === 'raw'
|
|
937
937
|
) {
|
|
938
|
-
await
|
|
938
|
+
await notify({
|
|
939
|
+
event: { chunk: part },
|
|
940
|
+
callbacks: onChunk,
|
|
941
|
+
});
|
|
939
942
|
}
|
|
940
943
|
|
|
941
944
|
if (part.type === 'error') {
|
|
@@ -945,7 +948,10 @@ class DefaultStreamTextResult<
|
|
|
945
948
|
recordedNoOutputError = error;
|
|
946
949
|
}
|
|
947
950
|
|
|
948
|
-
await
|
|
951
|
+
await notify({
|
|
952
|
+
event: { error },
|
|
953
|
+
callbacks: onError,
|
|
954
|
+
});
|
|
949
955
|
}
|
|
950
956
|
|
|
951
957
|
if (part.type === 'text-start') {
|