@promptbook/remote-client 0.61.0-27 โ 0.61.0-29
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/esm/index.es.js +2 -2
- package/esm/typings/src/execution/PipelineExecutor.d.ts +16 -4
- package/esm/typings/src/execution/PromptResult.d.ts +15 -0
- package/esm/typings/src/execution/createPipelineExecutor.d.ts +10 -2
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +2 -2
- package/esm/typings/src/prepare/preparePipeline.d.ts +1 -1
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +2 -2
- package/umd/typings/src/execution/PipelineExecutor.d.ts +16 -4
- package/umd/typings/src/execution/PromptResult.d.ts +15 -0
- package/umd/typings/src/execution/createPipelineExecutor.d.ts +10 -2
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -1
- package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +2 -2
- package/umd/typings/src/prepare/preparePipeline.d.ts +1 -1
- package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +1 -1
package/esm/index.es.js
CHANGED
|
@@ -208,13 +208,13 @@ var RemoteLlmExecutionTools = /** @class */ (function () {
|
|
|
208
208
|
}());
|
|
209
209
|
/**
|
|
210
210
|
* TODO: [๐] Allow to list compatible models with each variant
|
|
211
|
-
* TODO: [
|
|
211
|
+
* TODO: [๐ฏ] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable
|
|
212
212
|
*/
|
|
213
213
|
|
|
214
214
|
/**
|
|
215
215
|
* The version of the Promptbook library
|
|
216
216
|
*/
|
|
217
|
-
var PROMPTBOOK_VERSION = '0.61.0-
|
|
217
|
+
var PROMPTBOOK_VERSION = '0.61.0-28';
|
|
218
218
|
// TODO: !!!! List here all the versions and annotate + put into script
|
|
219
219
|
|
|
220
220
|
export { PROMPTBOOK_VERSION, RemoteLlmExecutionTools };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Promisable } from 'type-fest';
|
|
2
|
+
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
2
3
|
import { PipelineExecutionError } from '../errors/PipelineExecutionError';
|
|
3
4
|
import type { TaskProgress } from '../types/TaskProgress';
|
|
4
5
|
import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
|
|
@@ -10,6 +11,8 @@ import type { PromptResultUsage } from './PromptResultUsage';
|
|
|
10
11
|
*
|
|
11
12
|
* It can be created with `createPipelineExecutor` function.
|
|
12
13
|
*
|
|
14
|
+
* @@@ almost-JSON (what about errors)
|
|
15
|
+
*
|
|
13
16
|
* @see https://github.com/webgptorg/promptbook#executor
|
|
14
17
|
*/
|
|
15
18
|
export type PipelineExecutor = {
|
|
@@ -17,8 +20,16 @@ export type PipelineExecutor = {
|
|
|
17
20
|
};
|
|
18
21
|
/**
|
|
19
22
|
* @@@
|
|
23
|
+
*
|
|
24
|
+
* @@@ almost-JSON (what about errors)
|
|
20
25
|
*/
|
|
21
26
|
export type PipelineExecutorResult = {
|
|
27
|
+
/**
|
|
28
|
+
* Result parameters of the execution
|
|
29
|
+
*
|
|
30
|
+
* Note: If the execution was not successful, there are only some of the result parameters
|
|
31
|
+
*/
|
|
32
|
+
readonly outputParameters: Parameters;
|
|
22
33
|
/**
|
|
23
34
|
* Whether the execution was successful, details are aviable in `executionReport`
|
|
24
35
|
*/
|
|
@@ -40,13 +51,14 @@ export type PipelineExecutorResult = {
|
|
|
40
51
|
*/
|
|
41
52
|
readonly executionReport: ExecutionReportJson;
|
|
42
53
|
/**
|
|
43
|
-
*
|
|
54
|
+
* The prepared pipeline that was used for the execution
|
|
44
55
|
*
|
|
45
|
-
* Note: If
|
|
56
|
+
* Note: If you called `createPipelineExecutor` with fully prepared pipeline, this is the same object as this pipeline
|
|
57
|
+
* If you passed not fully prepared pipeline, this is same pipeline but fully prepared
|
|
46
58
|
*/
|
|
47
|
-
readonly
|
|
59
|
+
readonly preparedPipeline: PipelineJson;
|
|
48
60
|
};
|
|
49
61
|
/**
|
|
50
62
|
* TODO: [๐ง ] Should this file be in /execution or /types folder?
|
|
51
|
-
* TODO: [๐ท] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result
|
|
63
|
+
* TODO: [๐ท] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result - BUT maybe NOT?
|
|
52
64
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { string_date_iso8601 } from '../types/typeAliases';
|
|
2
2
|
import type { string_model_name } from '../types/typeAliases';
|
|
3
|
+
import type { string_prompt } from '../types/typeAliases';
|
|
3
4
|
import type { TODO_object } from '../utils/organization/TODO_object';
|
|
4
5
|
import type { EmbeddingVector } from './EmbeddingVector';
|
|
5
6
|
import type { PromptResultUsage } from './PromptResultUsage';
|
|
@@ -69,8 +70,22 @@ export type CommonPromptResult = {
|
|
|
69
70
|
* Usage of the prompt execution
|
|
70
71
|
*/
|
|
71
72
|
readonly usage: PromptResultUsage;
|
|
73
|
+
/**
|
|
74
|
+
* Exact text of the prompt (with all replacements)
|
|
75
|
+
*
|
|
76
|
+
* Note: This contains redundant information
|
|
77
|
+
*/
|
|
78
|
+
readonly rawPromptContent: string_prompt;
|
|
79
|
+
/**
|
|
80
|
+
* Raw request to the model
|
|
81
|
+
*
|
|
82
|
+
* Note: This contains redundant information
|
|
83
|
+
*/
|
|
84
|
+
readonly rawRequest: TODO_object | null;
|
|
72
85
|
/**
|
|
73
86
|
* Raw response from the model
|
|
87
|
+
*
|
|
88
|
+
* Note: This contains redundant information
|
|
74
89
|
*/
|
|
75
90
|
readonly rawResponse: TODO_object;
|
|
76
91
|
};
|
|
@@ -20,6 +20,16 @@ type CreatePipelineExecutorSettings = {
|
|
|
20
20
|
* @default false
|
|
21
21
|
*/
|
|
22
22
|
readonly isVerbose?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If you pass fully prepared pipeline, this does not matter
|
|
25
|
+
*
|
|
26
|
+
* Otherwise:
|
|
27
|
+
* If false or not set, warning is shown when pipeline is not prepared
|
|
28
|
+
* If true, warning is suppressed
|
|
29
|
+
*
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
readonly isNotPreparedWarningSupressed?: boolean;
|
|
23
33
|
};
|
|
24
34
|
/**
|
|
25
35
|
* Options for `createPipelineExecutor`
|
|
@@ -47,8 +57,6 @@ interface CreatePipelineExecutorOptions {
|
|
|
47
57
|
export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor;
|
|
48
58
|
export {};
|
|
49
59
|
/**
|
|
50
|
-
* TODO: !!!!! return `preparedPipeline` from execution
|
|
51
|
-
* TODO: !!!!! `isNotPreparedWarningSupressed`
|
|
52
60
|
* TODO: Use isVerbose here (not only pass to `preparePipeline`)
|
|
53
61
|
* TODO: [๐ช] Use maxParallelCount here (not only pass to `preparePipeline`)
|
|
54
62
|
* TODO: [โ] Probbably move expectations from templates to parameters
|
|
@@ -50,5 +50,5 @@ export declare class RemoteLlmExecutionTools implements LlmExecutionTools {
|
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* TODO: [๐] Allow to list compatible models with each variant
|
|
53
|
-
* TODO: [
|
|
53
|
+
* TODO: [๐ฏ] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable
|
|
54
54
|
*/
|
|
@@ -12,8 +12,8 @@ export declare function startRemoteServer(options: RemoteServerOptions): IDestro
|
|
|
12
12
|
/**
|
|
13
13
|
* TODO: [โ] Expose the collection to be able to connect to same collection via createCollectionFromUrl
|
|
14
14
|
* TODO: Handle progress - support streaming
|
|
15
|
-
* TODO: [
|
|
16
|
-
* TODO: [
|
|
15
|
+
* TODO: [๐ฏ] Do not hang up immediately but wait until client closes OR timeout
|
|
16
|
+
* TODO: [๐ฏ] Timeout on chat to free up resources
|
|
17
17
|
* TODO: [๐] Pass here some security token to prevent malitious usage and/or DDoS
|
|
18
18
|
* TODO: [0] Set unavailable models as undefined in `RemoteLlmExecutionTools` NOT throw error here
|
|
19
19
|
*/
|
|
@@ -12,6 +12,6 @@ export declare function preparePipeline(pipeline: PipelineJson, options: Prepare
|
|
|
12
12
|
* TODO: Write tests for `preparePipeline`
|
|
13
13
|
* TODO: [๐] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
14
14
|
* TODO: [๐ง] In future one preparation can take data from previous preparation and save tokens and time
|
|
15
|
-
* TODO: [๐]
|
|
15
|
+
* TODO: [๐] !!!!! Use here countTotalUsage
|
|
16
16
|
* TODO: [๐ ] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
17
17
|
*/
|
|
@@ -41,7 +41,7 @@ export type ExecutionReportJson = {
|
|
|
41
41
|
/**
|
|
42
42
|
* The prompt wich was executed
|
|
43
43
|
*/
|
|
44
|
-
readonly prompt: Omit<Prompt, 'pipelineUrl'
|
|
44
|
+
readonly prompt: Omit<Prompt, 'pipelineUrl'>;
|
|
45
45
|
/**
|
|
46
46
|
* Result of the prompt execution (if not failed during LLM execution)
|
|
47
47
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-client",
|
|
3
|
-
"version": "0.61.0-
|
|
3
|
+
"version": "0.61.0-29",
|
|
4
4
|
"description": "Supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
],
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@promptbook/core": "0.61.0-
|
|
50
|
+
"@promptbook/core": "0.61.0-29"
|
|
51
51
|
},
|
|
52
52
|
"main": "./umd/index.umd.js",
|
|
53
53
|
"module": "./esm/index.es.js",
|
package/umd/index.umd.js
CHANGED
|
@@ -212,13 +212,13 @@
|
|
|
212
212
|
}());
|
|
213
213
|
/**
|
|
214
214
|
* TODO: [๐] Allow to list compatible models with each variant
|
|
215
|
-
* TODO: [
|
|
215
|
+
* TODO: [๐ฏ] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable
|
|
216
216
|
*/
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
219
|
* The version of the Promptbook library
|
|
220
220
|
*/
|
|
221
|
-
var PROMPTBOOK_VERSION = '0.61.0-
|
|
221
|
+
var PROMPTBOOK_VERSION = '0.61.0-28';
|
|
222
222
|
// TODO: !!!! List here all the versions and annotate + put into script
|
|
223
223
|
|
|
224
224
|
exports.PROMPTBOOK_VERSION = PROMPTBOOK_VERSION;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Promisable } from 'type-fest';
|
|
2
|
+
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
2
3
|
import { PipelineExecutionError } from '../errors/PipelineExecutionError';
|
|
3
4
|
import type { TaskProgress } from '../types/TaskProgress';
|
|
4
5
|
import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
|
|
@@ -10,6 +11,8 @@ import type { PromptResultUsage } from './PromptResultUsage';
|
|
|
10
11
|
*
|
|
11
12
|
* It can be created with `createPipelineExecutor` function.
|
|
12
13
|
*
|
|
14
|
+
* @@@ almost-JSON (what about errors)
|
|
15
|
+
*
|
|
13
16
|
* @see https://github.com/webgptorg/promptbook#executor
|
|
14
17
|
*/
|
|
15
18
|
export type PipelineExecutor = {
|
|
@@ -17,8 +20,16 @@ export type PipelineExecutor = {
|
|
|
17
20
|
};
|
|
18
21
|
/**
|
|
19
22
|
* @@@
|
|
23
|
+
*
|
|
24
|
+
* @@@ almost-JSON (what about errors)
|
|
20
25
|
*/
|
|
21
26
|
export type PipelineExecutorResult = {
|
|
27
|
+
/**
|
|
28
|
+
* Result parameters of the execution
|
|
29
|
+
*
|
|
30
|
+
* Note: If the execution was not successful, there are only some of the result parameters
|
|
31
|
+
*/
|
|
32
|
+
readonly outputParameters: Parameters;
|
|
22
33
|
/**
|
|
23
34
|
* Whether the execution was successful, details are aviable in `executionReport`
|
|
24
35
|
*/
|
|
@@ -40,13 +51,14 @@ export type PipelineExecutorResult = {
|
|
|
40
51
|
*/
|
|
41
52
|
readonly executionReport: ExecutionReportJson;
|
|
42
53
|
/**
|
|
43
|
-
*
|
|
54
|
+
* The prepared pipeline that was used for the execution
|
|
44
55
|
*
|
|
45
|
-
* Note: If
|
|
56
|
+
* Note: If you called `createPipelineExecutor` with fully prepared pipeline, this is the same object as this pipeline
|
|
57
|
+
* If you passed not fully prepared pipeline, this is same pipeline but fully prepared
|
|
46
58
|
*/
|
|
47
|
-
readonly
|
|
59
|
+
readonly preparedPipeline: PipelineJson;
|
|
48
60
|
};
|
|
49
61
|
/**
|
|
50
62
|
* TODO: [๐ง ] Should this file be in /execution or /types folder?
|
|
51
|
-
* TODO: [๐ท] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result
|
|
63
|
+
* TODO: [๐ท] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result - BUT maybe NOT?
|
|
52
64
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { string_date_iso8601 } from '../types/typeAliases';
|
|
2
2
|
import type { string_model_name } from '../types/typeAliases';
|
|
3
|
+
import type { string_prompt } from '../types/typeAliases';
|
|
3
4
|
import type { TODO_object } from '../utils/organization/TODO_object';
|
|
4
5
|
import type { EmbeddingVector } from './EmbeddingVector';
|
|
5
6
|
import type { PromptResultUsage } from './PromptResultUsage';
|
|
@@ -69,8 +70,22 @@ export type CommonPromptResult = {
|
|
|
69
70
|
* Usage of the prompt execution
|
|
70
71
|
*/
|
|
71
72
|
readonly usage: PromptResultUsage;
|
|
73
|
+
/**
|
|
74
|
+
* Exact text of the prompt (with all replacements)
|
|
75
|
+
*
|
|
76
|
+
* Note: This contains redundant information
|
|
77
|
+
*/
|
|
78
|
+
readonly rawPromptContent: string_prompt;
|
|
79
|
+
/**
|
|
80
|
+
* Raw request to the model
|
|
81
|
+
*
|
|
82
|
+
* Note: This contains redundant information
|
|
83
|
+
*/
|
|
84
|
+
readonly rawRequest: TODO_object | null;
|
|
72
85
|
/**
|
|
73
86
|
* Raw response from the model
|
|
87
|
+
*
|
|
88
|
+
* Note: This contains redundant information
|
|
74
89
|
*/
|
|
75
90
|
readonly rawResponse: TODO_object;
|
|
76
91
|
};
|
|
@@ -20,6 +20,16 @@ type CreatePipelineExecutorSettings = {
|
|
|
20
20
|
* @default false
|
|
21
21
|
*/
|
|
22
22
|
readonly isVerbose?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If you pass fully prepared pipeline, this does not matter
|
|
25
|
+
*
|
|
26
|
+
* Otherwise:
|
|
27
|
+
* If false or not set, warning is shown when pipeline is not prepared
|
|
28
|
+
* If true, warning is suppressed
|
|
29
|
+
*
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
readonly isNotPreparedWarningSupressed?: boolean;
|
|
23
33
|
};
|
|
24
34
|
/**
|
|
25
35
|
* Options for `createPipelineExecutor`
|
|
@@ -47,8 +57,6 @@ interface CreatePipelineExecutorOptions {
|
|
|
47
57
|
export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor;
|
|
48
58
|
export {};
|
|
49
59
|
/**
|
|
50
|
-
* TODO: !!!!! return `preparedPipeline` from execution
|
|
51
|
-
* TODO: !!!!! `isNotPreparedWarningSupressed`
|
|
52
60
|
* TODO: Use isVerbose here (not only pass to `preparePipeline`)
|
|
53
61
|
* TODO: [๐ช] Use maxParallelCount here (not only pass to `preparePipeline`)
|
|
54
62
|
* TODO: [โ] Probbably move expectations from templates to parameters
|
|
@@ -50,5 +50,5 @@ export declare class RemoteLlmExecutionTools implements LlmExecutionTools {
|
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* TODO: [๐] Allow to list compatible models with each variant
|
|
53
|
-
* TODO: [
|
|
53
|
+
* TODO: [๐ฏ] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable
|
|
54
54
|
*/
|
|
@@ -12,8 +12,8 @@ export declare function startRemoteServer(options: RemoteServerOptions): IDestro
|
|
|
12
12
|
/**
|
|
13
13
|
* TODO: [โ] Expose the collection to be able to connect to same collection via createCollectionFromUrl
|
|
14
14
|
* TODO: Handle progress - support streaming
|
|
15
|
-
* TODO: [
|
|
16
|
-
* TODO: [
|
|
15
|
+
* TODO: [๐ฏ] Do not hang up immediately but wait until client closes OR timeout
|
|
16
|
+
* TODO: [๐ฏ] Timeout on chat to free up resources
|
|
17
17
|
* TODO: [๐] Pass here some security token to prevent malitious usage and/or DDoS
|
|
18
18
|
* TODO: [0] Set unavailable models as undefined in `RemoteLlmExecutionTools` NOT throw error here
|
|
19
19
|
*/
|
|
@@ -12,6 +12,6 @@ export declare function preparePipeline(pipeline: PipelineJson, options: Prepare
|
|
|
12
12
|
* TODO: Write tests for `preparePipeline`
|
|
13
13
|
* TODO: [๐] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
14
14
|
* TODO: [๐ง] In future one preparation can take data from previous preparation and save tokens and time
|
|
15
|
-
* TODO: [๐]
|
|
15
|
+
* TODO: [๐] !!!!! Use here countTotalUsage
|
|
16
16
|
* TODO: [๐ ] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
17
17
|
*/
|
|
@@ -41,7 +41,7 @@ export type ExecutionReportJson = {
|
|
|
41
41
|
/**
|
|
42
42
|
* The prompt wich was executed
|
|
43
43
|
*/
|
|
44
|
-
readonly prompt: Omit<Prompt, 'pipelineUrl'
|
|
44
|
+
readonly prompt: Omit<Prompt, 'pipelineUrl'>;
|
|
45
45
|
/**
|
|
46
46
|
* Result of the prompt execution (if not failed during LLM execution)
|
|
47
47
|
*/
|