ai 3.0.29 → 3.0.31
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/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/react/dist/index.js +16 -16
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.mjs +16 -16
- package/react/dist/index.mjs.map +1 -1
package/dist/index.d.mts
CHANGED
@@ -762,9 +762,20 @@ declare class StreamTextResult<TOOLS extends Record<string, ExperimentalTool>> {
|
|
762
762
|
status?: number;
|
763
763
|
}): void;
|
764
764
|
/**
|
765
|
+
Converts the result to a streamed response object with a stream data part stream.
|
766
|
+
It can be used with the `useChat` and `useCompletion` hooks.
|
767
|
+
|
768
|
+
@param init Optional headers.
|
769
|
+
|
770
|
+
@return A response object.
|
771
|
+
*/
|
772
|
+
toAIStreamResponse(init?: ResponseInit): Response;
|
773
|
+
/**
|
765
774
|
Creates a simple text stream response.
|
766
775
|
Each text delta is encoded as UTF-8 and sent as a separate chunk.
|
767
776
|
Non-text-delta events are ignored.
|
777
|
+
|
778
|
+
@param init Optional headers and status code.
|
768
779
|
*/
|
769
780
|
toTextStreamResponse(init?: ResponseInit): Response;
|
770
781
|
}
|
package/dist/index.d.ts
CHANGED
@@ -762,9 +762,20 @@ declare class StreamTextResult<TOOLS extends Record<string, ExperimentalTool>> {
|
|
762
762
|
status?: number;
|
763
763
|
}): void;
|
764
764
|
/**
|
765
|
+
Converts the result to a streamed response object with a stream data part stream.
|
766
|
+
It can be used with the `useChat` and `useCompletion` hooks.
|
767
|
+
|
768
|
+
@param init Optional headers.
|
769
|
+
|
770
|
+
@return A response object.
|
771
|
+
*/
|
772
|
+
toAIStreamResponse(init?: ResponseInit): Response;
|
773
|
+
/**
|
765
774
|
Creates a simple text stream response.
|
766
775
|
Each text delta is encoded as UTF-8 and sent as a separate chunk.
|
767
776
|
Non-text-delta events are ignored.
|
777
|
+
|
778
|
+
@param init Optional headers and status code.
|
768
779
|
*/
|
769
780
|
toTextStreamResponse(init?: ResponseInit): Response;
|
770
781
|
}
|
package/dist/index.js
CHANGED
@@ -48,7 +48,7 @@ __export(streams_exports, {
|
|
48
48
|
MistralStream: () => MistralStream,
|
49
49
|
OpenAIStream: () => OpenAIStream,
|
50
50
|
ReplicateStream: () => ReplicateStream,
|
51
|
-
StreamData: () =>
|
51
|
+
StreamData: () => StreamData2,
|
52
52
|
StreamObjectResult: () => StreamObjectResult,
|
53
53
|
StreamTextResult: () => StreamTextResult,
|
54
54
|
StreamingTextResponse: () => StreamingTextResponse,
|
@@ -1546,9 +1546,22 @@ var StreamTextResult = class {
|
|
1546
1546
|
read();
|
1547
1547
|
}
|
1548
1548
|
/**
|
1549
|
+
Converts the result to a streamed response object with a stream data part stream.
|
1550
|
+
It can be used with the `useChat` and `useCompletion` hooks.
|
1551
|
+
|
1552
|
+
@param init Optional headers.
|
1553
|
+
|
1554
|
+
@return A response object.
|
1555
|
+
*/
|
1556
|
+
toAIStreamResponse(init) {
|
1557
|
+
return new StreamingTextResponse(this.toAIStream(), init);
|
1558
|
+
}
|
1559
|
+
/**
|
1549
1560
|
Creates a simple text stream response.
|
1550
1561
|
Each text delta is encoded as UTF-8 and sent as a separate chunk.
|
1551
1562
|
Non-text-delta events are ignored.
|
1563
|
+
|
1564
|
+
@param init Optional headers and status code.
|
1552
1565
|
*/
|
1553
1566
|
toTextStreamResponse(init) {
|
1554
1567
|
var _a;
|
@@ -1940,7 +1953,7 @@ function readableFromAsyncIterable(iterable) {
|
|
1940
1953
|
}
|
1941
1954
|
|
1942
1955
|
// streams/stream-data.ts
|
1943
|
-
var
|
1956
|
+
var StreamData2 = class {
|
1944
1957
|
constructor() {
|
1945
1958
|
this.encoder = new TextEncoder();
|
1946
1959
|
this.controller = null;
|
@@ -2036,7 +2049,7 @@ function createStreamDataTransformer() {
|
|
2036
2049
|
}
|
2037
2050
|
});
|
2038
2051
|
}
|
2039
|
-
var experimental_StreamData = class extends
|
2052
|
+
var experimental_StreamData = class extends StreamData2 {
|
2040
2053
|
};
|
2041
2054
|
|
2042
2055
|
// streams/anthropic-stream.ts
|