@aigne/core 0.0.4 → 0.0.5

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.
@@ -1,20 +1,22 @@
1
1
  export interface RunOptions {
2
2
  stream?: boolean;
3
3
  }
4
- export interface StreamingResponseDelta {
4
+ export interface RunnableResponseDelta<T> {
5
5
  delta: {
6
- content: string;
6
+ content?: string | null;
7
+ object?: Partial<T>;
7
8
  };
8
9
  }
9
- export type StreamingResponse<T> = ReadableStream<Partial<T> | StreamingResponseDelta>;
10
+ export type RunnableResponseStream<T> = ReadableStream<RunnableResponseDelta<T>>;
11
+ export type RunnableResponse<T> = T | RunnableResponseStream<T>;
10
12
  export interface Runnable<I extends {
11
13
  [key: string]: any;
12
14
  } = object, O = object> {
13
15
  run(input: I, options: RunOptions & {
14
16
  stream: true;
15
- }): Promise<StreamingResponse<O>>;
17
+ }): Promise<RunnableResponseStream<O>>;
16
18
  run(input: I, options?: RunOptions & {
17
19
  stream?: false;
18
20
  }): Promise<O>;
19
- run(input: I, options?: RunOptions): Promise<O | StreamingResponse<O>>;
21
+ run(input: I, options?: RunOptions): Promise<RunnableResponse<O>>;
20
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/core",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "AIGNE core library",
5
5
  "publishConfig": {
6
6
  "access": "public"