@promptbook/remote-server 0.86.10 → 0.86.22
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/README.md +35 -42
- package/esm/index.es.js +3113 -4003
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/types.index.d.ts +2 -0
- package/esm/typings/src/conversion/utils/extractVariablesFromScript.d.ts +5 -5
- package/esm/typings/src/execution/AbstractTaskResult.d.ts +3 -3
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +1 -1
- package/esm/typings/src/execution/utils/usageToHuman.d.ts +11 -1
- package/esm/typings/src/execution/utils/usageToWorktime.d.ts +9 -1
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +1 -1
- package/esm/typings/src/formats/text/TextFormatDefinition.d.ts +1 -1
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/package.json +2 -2
- package/umd/index.umd.js +3184 -4074
- package/umd/index.umd.js.map +1 -1
|
@@ -178,6 +178,7 @@ import type { string_css } from '../types/typeAliases';
|
|
|
178
178
|
import type { string_svg } from '../types/typeAliases';
|
|
179
179
|
import type { string_script } from '../types/typeAliases';
|
|
180
180
|
import type { string_javascript } from '../types/typeAliases';
|
|
181
|
+
import type { string_typescript } from '../types/typeAliases';
|
|
181
182
|
import type { string_json } from '../types/typeAliases';
|
|
182
183
|
import type { string_css_class } from '../types/typeAliases';
|
|
183
184
|
import type { string_css_property } from '../types/typeAliases';
|
|
@@ -459,6 +460,7 @@ export type { string_css };
|
|
|
459
460
|
export type { string_svg };
|
|
460
461
|
export type { string_script };
|
|
461
462
|
export type { string_javascript };
|
|
463
|
+
export type { string_typescript };
|
|
462
464
|
export type { string_json };
|
|
463
465
|
export type { string_css_class };
|
|
464
466
|
export type { string_css_property };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { string_javascript } from '../../types/typeAliases';
|
|
2
|
-
import type {
|
|
2
|
+
import type { string_typescript } from '../../types/typeAliases';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Extract all used variable names from ginen JavaScript/TypeScript script
|
|
5
5
|
*
|
|
6
|
-
* @param script
|
|
7
|
-
* @returns
|
|
6
|
+
* @param script JavaScript/TypeScript script
|
|
7
|
+
* @returns Set of variable names
|
|
8
8
|
* @throws {ParseError} if the script is invalid
|
|
9
9
|
* @public exported from `@promptbook/utils` <- Note: [👖] This is usable elsewhere than in Promptbook, so keeping in utils
|
|
10
10
|
*/
|
|
11
|
-
export declare function extractVariablesFromScript(script: string_javascript): Set<
|
|
11
|
+
export declare function extractVariablesFromScript(script: string_javascript | string_typescript): Set<string>;
|
|
12
12
|
/**
|
|
13
13
|
* TODO: [🔣] Support for multiple languages - python, java,...
|
|
14
14
|
*/
|
|
@@ -7,15 +7,15 @@ import type { ErrorJson } from '../errors/utils/ErrorJson';
|
|
|
7
7
|
*/
|
|
8
8
|
export type AbstractTaskResult = {
|
|
9
9
|
/**
|
|
10
|
-
* Whether the execution was successful, details are
|
|
10
|
+
* Whether the execution was successful, details are available in `executionReport`
|
|
11
11
|
*/
|
|
12
12
|
readonly isSuccessful: boolean;
|
|
13
13
|
/**
|
|
14
|
-
* Errors that occured during the execution, details are
|
|
14
|
+
* Errors that occured during the execution, details are available in `executionReport`
|
|
15
15
|
*/
|
|
16
16
|
readonly errors: ReadonlyDeep<ReadonlyArray<ErrorJson>>;
|
|
17
17
|
/**
|
|
18
|
-
* Warnings that occured during the execution, details are
|
|
18
|
+
* Warnings that occured during the execution, details are available in `executionReport`
|
|
19
19
|
*/
|
|
20
20
|
readonly warnings: ReadonlyDeep<ReadonlyArray<ErrorJson>>;
|
|
21
21
|
};
|
|
@@ -17,7 +17,7 @@ export type PipelineExecutorResult = AbstractTaskResult & {
|
|
|
17
17
|
*/
|
|
18
18
|
readonly outputParameters: Readonly<Parameters>;
|
|
19
19
|
/**
|
|
20
|
-
* Added usage of whole execution, detailed usage is
|
|
20
|
+
* Added usage of whole execution, detailed usage is available in `executionReport`
|
|
21
21
|
*/
|
|
22
22
|
readonly usage: ReadonlyDeep<PromptResultUsage>;
|
|
23
23
|
/**
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type { string_markdown } from '../../types/typeAliases';
|
|
2
2
|
import type { PromptResultUsage } from '../PromptResultUsage';
|
|
3
|
+
import type { UncertainNumber } from '../UncertainNumber';
|
|
4
|
+
/**
|
|
5
|
+
* Minimal usage information required to calculate worktime
|
|
6
|
+
*/
|
|
7
|
+
type PartialPromptResultUsage = Partial<PromptResultUsage> & {
|
|
8
|
+
price: UncertainNumber;
|
|
9
|
+
input: Pick<PromptResultUsage['input'], 'wordsCount'>;
|
|
10
|
+
output: Pick<PromptResultUsage['output'], 'wordsCount' | 'charactersCount'>;
|
|
11
|
+
};
|
|
3
12
|
/**
|
|
4
13
|
* Function `usageToHuman` will take usage and convert it to human readable report
|
|
5
14
|
*
|
|
6
15
|
* @public exported from `@promptbook/core`
|
|
7
16
|
*/
|
|
8
|
-
export declare function usageToHuman(usage:
|
|
17
|
+
export declare function usageToHuman(usage: PartialPromptResultUsage): string_markdown;
|
|
18
|
+
export {};
|
|
9
19
|
/**
|
|
10
20
|
* TODO: [🍓][🧞♂️] Use "$1" not "1 USD"
|
|
11
21
|
* TODO: [🍓][🧞♂️] Use markdown formatting like "Cost approximately **$1**"
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { PromptResultUsage } from '../PromptResultUsage';
|
|
2
2
|
import type { UncertainNumber } from '../UncertainNumber';
|
|
3
|
+
/**
|
|
4
|
+
* Minimal usage information required to calculate worktime
|
|
5
|
+
*/
|
|
6
|
+
type PartialPromptResultUsage = Pick<PromptResultUsage, 'input' | 'output'> & {
|
|
7
|
+
input: Pick<PromptResultUsage['input'], 'wordsCount'>;
|
|
8
|
+
output: Pick<PromptResultUsage['output'], 'wordsCount'>;
|
|
9
|
+
};
|
|
3
10
|
/**
|
|
4
11
|
* Function usageToWorktime will take usage and estimate saved worktime in hours of reading / writing
|
|
5
12
|
*
|
|
@@ -9,4 +16,5 @@ import type { UncertainNumber } from '../UncertainNumber';
|
|
|
9
16
|
*
|
|
10
17
|
* @public exported from `@promptbook/core`
|
|
11
18
|
*/
|
|
12
|
-
export declare function usageToWorktime(usage:
|
|
19
|
+
export declare function usageToWorktime(usage: PartialPromptResultUsage): UncertainNumber;
|
|
20
|
+
export {};
|
|
@@ -64,7 +64,7 @@ export type FormatDefinition<TValue extends TPartialValue, TPartialValue extends
|
|
|
64
64
|
* TODO: [♏] Add some prepare hook to modify prompt according to the format
|
|
65
65
|
* TODO: [🍓]`name` and `aliases` should be UPPERCASE only and interpreted as case-insensitive (via normalization)
|
|
66
66
|
* TODO: [🍓][👨⚖️] Compute TPartialValue dynamically - PartialString<TValue>
|
|
67
|
-
* TODO: [🍓][🧠] Should execution tools be
|
|
67
|
+
* TODO: [🍓][🧠] Should execution tools be available to heal, canBeValid and isValid?
|
|
68
68
|
* TODO: [🍓][🧠] llm Provider Bindings
|
|
69
69
|
* TODO: [🍓][🔼] Export via some package
|
|
70
70
|
*/
|
|
@@ -10,7 +10,7 @@ import type { FormatDefinition } from '../_common/FormatDefinition';
|
|
|
10
10
|
export declare const TextFormatDefinition: FormatDefinition<string, string, TODO_any, TODO_any>;
|
|
11
11
|
/**
|
|
12
12
|
* TODO: [1] Make type for XML Text and Schema
|
|
13
|
-
* TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages
|
|
13
|
+
* TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
|
|
14
14
|
* TODO: [🍓] In `TextFormatDefinition` implement simple `isValid`
|
|
15
15
|
* TODO: [🍓] In `TextFormatDefinition` implement partial `canBeValid`
|
|
16
16
|
* TODO: [🍓] In `TextFormatDefinition` implement `heal
|
|
@@ -57,7 +57,7 @@ export declare class MultipleLlmExecutionTools implements LlmExecutionTools {
|
|
|
57
57
|
callCommonModel(prompt: Prompt): Promise<PromptResult>;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
* TODO: [🧠][🎛] Aggregating multiple models - have result not only from one first
|
|
60
|
+
* TODO: [🧠][🎛] Aggregating multiple models - have result not only from one first available model BUT all of them
|
|
61
61
|
* TODO: [🏖] If no llmTools have for example not defined `callCompletionModel` this will still return object with defined `callCompletionModel` which just throws `PipelineExecutionError`, make it undefined instead
|
|
62
62
|
* Look how `countTotalUsage` (and `cacheLlmTools`) implements it
|
|
63
63
|
*/
|
|
@@ -272,6 +272,12 @@ export type string_script = string;
|
|
|
272
272
|
* For example `console.info("Hello World!")`
|
|
273
273
|
*/
|
|
274
274
|
export type string_javascript = string;
|
|
275
|
+
/**
|
|
276
|
+
* Semantic helper
|
|
277
|
+
*
|
|
278
|
+
* For example `console.info("Hello World!" as string)`
|
|
279
|
+
*/
|
|
280
|
+
export type string_typescript = string;
|
|
275
281
|
/**
|
|
276
282
|
* Semantic helper for JSON strings
|
|
277
283
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-server",
|
|
3
|
-
"version": "0.86.
|
|
3
|
+
"version": "0.86.22",
|
|
4
4
|
"description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"module": "./esm/index.es.js",
|
|
48
48
|
"typings": "./esm/typings/src/_packages/remote-server.index.d.ts",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@promptbook/core": "0.86.
|
|
50
|
+
"@promptbook/core": "0.86.22"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"colors": "1.4.0",
|