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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 6.0.263
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [1e70580]
|
|
8
|
+
- @ai-sdk/gateway@3.0.179
|
|
9
|
+
|
|
10
|
+
## 6.0.262
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 30526e9: Prevent exceptions in streaming `onChunk` and `onError` callbacks from terminating the stream or masking provider errors.
|
|
15
|
+
- Updated dependencies [7de3226]
|
|
16
|
+
- Updated dependencies [504da15]
|
|
17
|
+
- @ai-sdk/gateway@3.0.178
|
|
18
|
+
|
|
3
19
|
## 6.0.261
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
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.263" : "0.0.0-test";
|
|
1308
1308
|
|
|
1309
1309
|
// src/util/download/download.ts
|
|
1310
1310
|
var download = async ({
|
|
@@ -7291,14 +7291,20 @@ var DefaultStreamTextResult = class {
|
|
|
7291
7291
|
controller.enqueue(chunk);
|
|
7292
7292
|
const { part } = chunk;
|
|
7293
7293
|
if (part.type === "text-delta" || part.type === "reasoning-delta" || part.type === "source" || part.type === "tool-call" || part.type === "tool-result" || part.type === "tool-input-start" || part.type === "tool-input-delta" || part.type === "raw") {
|
|
7294
|
-
await (
|
|
7294
|
+
await notify({
|
|
7295
|
+
event: { chunk: part },
|
|
7296
|
+
callbacks: onChunk
|
|
7297
|
+
});
|
|
7295
7298
|
}
|
|
7296
7299
|
if (part.type === "error") {
|
|
7297
7300
|
const error = wrapGatewayError(part.error);
|
|
7298
7301
|
if (NoOutputGeneratedError.isInstance(error)) {
|
|
7299
7302
|
recordedNoOutputError = error;
|
|
7300
7303
|
}
|
|
7301
|
-
await
|
|
7304
|
+
await notify({
|
|
7305
|
+
event: { error },
|
|
7306
|
+
callbacks: onError
|
|
7307
|
+
});
|
|
7302
7308
|
}
|
|
7303
7309
|
if (part.type === "text-start") {
|
|
7304
7310
|
activeTextContent[part.id] = {
|
|
@@ -11428,7 +11434,10 @@ var DefaultStreamObjectResult = class {
|
|
|
11428
11434
|
transform(chunk, controller) {
|
|
11429
11435
|
controller.enqueue(chunk);
|
|
11430
11436
|
if (chunk.type === "error") {
|
|
11431
|
-
|
|
11437
|
+
void notify({
|
|
11438
|
+
event: { error: wrapGatewayError(chunk.error) },
|
|
11439
|
+
callbacks: onError
|
|
11440
|
+
});
|
|
11432
11441
|
}
|
|
11433
11442
|
}
|
|
11434
11443
|
});
|
|
@@ -11753,7 +11762,10 @@ var DefaultStreamObjectResult = class {
|
|
|
11753
11762
|
onError(error2) {
|
|
11754
11763
|
const wrappedError = wrapGatewayError(error2);
|
|
11755
11764
|
self.rejectResultPromises(wrappedError);
|
|
11756
|
-
void
|
|
11765
|
+
void notify({
|
|
11766
|
+
event: { error: wrappedError },
|
|
11767
|
+
callbacks: onError
|
|
11768
|
+
});
|
|
11757
11769
|
}
|
|
11758
11770
|
});
|
|
11759
11771
|
}
|