ai 4.1.22 → 4.1.24
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 +12 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
@@ -2116,6 +2116,13 @@ interface StreamTextResult<TOOLS extends ToolSet, PARTIAL_OUTPUT> {
|
|
2116
2116
|
*/
|
2117
2117
|
readonly experimental_partialOutputStream: AsyncIterableStream<PARTIAL_OUTPUT>;
|
2118
2118
|
/**
|
2119
|
+
Consumes the stream without processing the parts.
|
2120
|
+
This is useful to force the stream to finish.
|
2121
|
+
It effectively removes the backpressure and allows the stream to finish,
|
2122
|
+
triggering the `onFinish` callback and the promise resolution.
|
2123
|
+
*/
|
2124
|
+
consumeStream(): Promise<void>;
|
2125
|
+
/**
|
2119
2126
|
Converts the result to a data stream.
|
2120
2127
|
|
2121
2128
|
@param data an optional StreamData object that will be merged into the stream.
|
package/dist/index.d.ts
CHANGED
@@ -2116,6 +2116,13 @@ interface StreamTextResult<TOOLS extends ToolSet, PARTIAL_OUTPUT> {
|
|
2116
2116
|
*/
|
2117
2117
|
readonly experimental_partialOutputStream: AsyncIterableStream<PARTIAL_OUTPUT>;
|
2118
2118
|
/**
|
2119
|
+
Consumes the stream without processing the parts.
|
2120
|
+
This is useful to force the stream to finish.
|
2121
|
+
It effectively removes the backpressure and allows the stream to finish,
|
2122
|
+
triggering the `onFinish` callback and the promise resolution.
|
2123
|
+
*/
|
2124
|
+
consumeStream(): Promise<void>;
|
2125
|
+
/**
|
2119
2126
|
Converts the result to a data stream.
|
2120
2127
|
|
2121
2128
|
@param data an optional StreamData object that will be merged into the stream.
|
package/dist/index.js
CHANGED
@@ -5504,8 +5504,6 @@ var DefaultStreamTextResult = class {
|
|
5504
5504
|
transform({ part }, controller) {
|
5505
5505
|
if (part.type === "text-delta") {
|
5506
5506
|
controller.enqueue(part.textDelta);
|
5507
|
-
} else if (part.type === "error") {
|
5508
|
-
controller.error(part.error);
|
5509
5507
|
}
|
5510
5508
|
}
|
5511
5509
|
})
|
@@ -5523,6 +5521,11 @@ var DefaultStreamTextResult = class {
|
|
5523
5521
|
)
|
5524
5522
|
);
|
5525
5523
|
}
|
5524
|
+
async consumeStream() {
|
5525
|
+
const stream = this.fullStream;
|
5526
|
+
for await (const part of stream) {
|
5527
|
+
}
|
5528
|
+
}
|
5526
5529
|
get experimental_partialOutputStream() {
|
5527
5530
|
if (this.output == null) {
|
5528
5531
|
throw new NoOutputSpecifiedError();
|