@xsai/stream-text 0.0.31 → 0.1.0-beta.2

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.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { FinishReason, Usage, ChatOptions } from '@xsai/shared-chat';
2
2
 
3
- interface ChunkResult {
3
+ interface StreamTextChunkResult {
4
4
  choices: {
5
5
  delta: {
6
6
  content: string;
@@ -17,7 +17,7 @@ interface ChunkResult {
17
17
  usage?: Usage;
18
18
  }
19
19
  interface StreamTextOptions extends ChatOptions {
20
- onChunk?: (chunk: ChunkResult) => Promise<void> | void;
20
+ onChunk?: (chunk: StreamTextChunkResult) => Promise<void> | void;
21
21
  /** if you want to disable stream, use `@xsai/generate-{text,object}` */
22
22
  stream?: never;
23
23
  streamOptions?: {
@@ -30,7 +30,7 @@ interface StreamTextOptions extends ChatOptions {
30
30
  };
31
31
  }
32
32
  interface StreamTextResult {
33
- chunkStream: ReadableStream<ChunkResult>;
33
+ chunkStream: ReadableStream<StreamTextChunkResult>;
34
34
  finishReason?: FinishReason;
35
35
  textStream: ReadableStream<string>;
36
36
  usage?: Usage;
@@ -40,4 +40,4 @@ interface StreamTextResult {
40
40
  */
41
41
  declare const streamText: (options: StreamTextOptions) => Promise<StreamTextResult>;
42
42
 
43
- export { type ChunkResult, type StreamTextOptions, type StreamTextResult, streamText as default, streamText };
43
+ export { type StreamTextChunkResult, type StreamTextOptions, type StreamTextResult, streamText };
package/dist/index.js CHANGED
@@ -52,4 +52,4 @@ const streamText = async (options) => chat({
52
52
  return { chunkStream, finishReason, textStream, usage };
53
53
  });
54
54
 
55
- export { streamText as default, streamText };
55
+ export { streamText };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xsai/stream-text",
3
3
  "type": "module",
4
- "version": "0.0.31",
4
+ "version": "0.1.0-beta.2",
5
5
  "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.",
6
6
  "author": "Moeru AI",
7
7
  "license": "MIT",