@hawk.so/types 0.6.5 → 0.7.0
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/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/src/ai/stream.d.ts +34 -0
- package/build/src/ai/stream.js +2 -0
- package/index.ts +2 -0
- package/package.json +1 -1
- package/src/ai/stream.ts +39 -0
- package/tsconfig.json +1 -1
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./src/ai/stream"), exports);
|
|
17
18
|
__exportStar(require("./src/auth/tokensPair"), exports);
|
|
18
19
|
__exportStar(require("./src/base/businessOperation/businessOperation"), exports);
|
|
19
20
|
__exportStar(require("./src/billing/planProlongrationPayload"), exports);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stream part that carries generated text.
|
|
3
|
+
*/
|
|
4
|
+
export type AiStreamTextDeltaPart = {
|
|
5
|
+
/**
|
|
6
|
+
* Discriminant of a text-carrying part.
|
|
7
|
+
*/
|
|
8
|
+
type: 'text-delta';
|
|
9
|
+
/**
|
|
10
|
+
* Text generated for this part.
|
|
11
|
+
*/
|
|
12
|
+
delta: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Stream part that carries a generation failure.
|
|
16
|
+
*/
|
|
17
|
+
export type AiStreamErrorPart = {
|
|
18
|
+
/**
|
|
19
|
+
* Discriminant of a failure-carrying part.
|
|
20
|
+
*/
|
|
21
|
+
type: 'error';
|
|
22
|
+
/**
|
|
23
|
+
* Description of the failure.
|
|
24
|
+
*/
|
|
25
|
+
errorText: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Discriminated union of parts an AI stream consists of.
|
|
29
|
+
*/
|
|
30
|
+
export type AiStreamPart = AiStreamTextDeltaPart | AiStreamErrorPart;
|
|
31
|
+
/**
|
|
32
|
+
* Asynchronous sequence of parts forming an AI-generated answer.
|
|
33
|
+
*/
|
|
34
|
+
export type AiStream = AsyncIterable<AiStreamPart>;
|
package/index.ts
CHANGED
package/package.json
CHANGED
package/src/ai/stream.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stream part that carries generated text.
|
|
3
|
+
*/
|
|
4
|
+
export type AiStreamTextDeltaPart = {
|
|
5
|
+
/**
|
|
6
|
+
* Discriminant of a text-carrying part.
|
|
7
|
+
*/
|
|
8
|
+
type: 'text-delta';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Text generated for this part.
|
|
12
|
+
*/
|
|
13
|
+
delta: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Stream part that carries a generation failure.
|
|
18
|
+
*/
|
|
19
|
+
export type AiStreamErrorPart = {
|
|
20
|
+
/**
|
|
21
|
+
* Discriminant of a failure-carrying part.
|
|
22
|
+
*/
|
|
23
|
+
type: 'error';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Description of the failure.
|
|
27
|
+
*/
|
|
28
|
+
errorText: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Discriminated union of parts an AI stream consists of.
|
|
33
|
+
*/
|
|
34
|
+
export type AiStreamPart = AiStreamTextDeltaPart | AiStreamErrorPart;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Asynchronous sequence of parts forming an AI-generated answer.
|
|
38
|
+
*/
|
|
39
|
+
export type AiStream = AsyncIterable<AiStreamPart>;
|
package/tsconfig.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
/* Basic Options */
|
|
4
4
|
// "incremental": true, /* Enable incremental compilation */
|
|
5
|
-
"target": "
|
|
5
|
+
"target": "es2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', 'ES2022', 'ES2023', 'ES2024', or 'ESNEXT'. */
|
|
6
6
|
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
|
7
7
|
// "lib": [], /* Specify library files to be included in the compilation. */
|
|
8
8
|
// "allowJs": true, /* Allow javascript files to be compiled. */
|