@promptbook/openai 0.28.0-6 → 0.28.0-8
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/typings/conversion/promptTemplatePipelineStringToJson-syntaxErrors.test.d.ts +1 -0
- package/esm/typings/conversion/promptTemplatePipelineStringToJson.test.d.ts +0 -3
- package/esm/typings/conversion/validatePromptTemplatePipelineJson-logicErrors.test.d.ts +1 -0
- package/esm/typings/conversion/validatePromptTemplatePipelineJson.test.d.ts +0 -3
- package/esm/typings/execution/UserInterfaceTools.d.ts +16 -1
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +4 -0
- package/esm/typings/types/Command.d.ts +8 -1
- package/esm/typings/types/PromptTemplatePipelineJson/PromptTemplateJson.d.ts +4 -0
- package/esm/typings/types/execution-report/executionReportJsonToString.test.d.ts +0 -3
- package/package.json +2 -2
- package/umd/typings/conversion/promptTemplatePipelineStringToJson-syntaxErrors.test.d.ts +1 -0
- package/umd/typings/conversion/promptTemplatePipelineStringToJson.test.d.ts +0 -3
- package/umd/typings/conversion/validatePromptTemplatePipelineJson-logicErrors.test.d.ts +1 -0
- package/umd/typings/conversion/validatePromptTemplatePipelineJson.test.d.ts +0 -3
- package/umd/typings/execution/UserInterfaceTools.d.ts +16 -1
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +4 -0
- package/umd/typings/types/Command.d.ts +8 -1
- package/umd/typings/types/PromptTemplatePipelineJson/PromptTemplateJson.d.ts +4 -0
- package/umd/typings/types/execution-report/executionReportJsonToString.test.d.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { number_integer, number_positive } from '../types/typeAliases';
|
|
1
2
|
/**
|
|
2
3
|
* Represents all the tools needed to interact with the user.
|
|
3
4
|
*
|
|
@@ -13,12 +14,20 @@ export interface UserInterfaceTools {
|
|
|
13
14
|
promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
|
|
14
15
|
}
|
|
15
16
|
export interface UserInterfaceToolsPromptDialogOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Prompt title
|
|
19
|
+
*
|
|
20
|
+
* Note: This is not a prompt to language model but a prompt to the user
|
|
21
|
+
* @example "Your name"
|
|
22
|
+
*/
|
|
23
|
+
promptTitle: string;
|
|
16
24
|
/**
|
|
17
25
|
* Prompt message
|
|
18
26
|
*
|
|
19
27
|
* Note: This is not a prompt to language model but a prompt to the user
|
|
28
|
+
* @example "Please enter your name, including your last name, title, etc."
|
|
20
29
|
*/
|
|
21
|
-
|
|
30
|
+
promptMessage: string;
|
|
22
31
|
/**
|
|
23
32
|
* Default value for the input/textarea
|
|
24
33
|
*/
|
|
@@ -27,4 +36,10 @@ export interface UserInterfaceToolsPromptDialogOptions {
|
|
|
27
36
|
* Placeholder for the input/textarea
|
|
28
37
|
*/
|
|
29
38
|
placeholder?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Priority of the prompt
|
|
41
|
+
*
|
|
42
|
+
* Note: This would be reflected for example into the UI z-index of the prompt modal
|
|
43
|
+
*/
|
|
44
|
+
priority: number_integer & number_positive;
|
|
30
45
|
}
|
|
@@ -6,7 +6,7 @@ import type { ExpectationAmount, ExpectationUnit } from './PromptTemplatePipelin
|
|
|
6
6
|
* Command is one piece of the prompt template which adds some logic to the prompt template or the whole pipeline.
|
|
7
7
|
* It is parsed from the markdown from ul/ol items - one command per one item.
|
|
8
8
|
*/
|
|
9
|
-
export type Command = PtbkUrlCommand | PtbkVersionCommand | ExecuteCommand | ModelCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
|
|
9
|
+
export type Command = PtbkUrlCommand | PtbkVersionCommand | ExecuteCommand | ModelCommand | JokerCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
|
|
10
10
|
/**
|
|
11
11
|
* PtpVersion command tells which version is .ptp file using
|
|
12
12
|
*
|
|
@@ -43,6 +43,13 @@ export interface ModelCommand {
|
|
|
43
43
|
readonly key: keyof ModelRequirements;
|
|
44
44
|
readonly value: any;
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Joker parameter is used instead of executing the prompt template if it meet the expectations requirements
|
|
48
|
+
*/
|
|
49
|
+
export interface JokerCommand {
|
|
50
|
+
readonly type: 'JOKER';
|
|
51
|
+
readonly parameterName: string_name;
|
|
52
|
+
}
|
|
46
53
|
/**
|
|
47
54
|
* Parameter command describes one parameter of the prompt template
|
|
48
55
|
*
|
|
@@ -75,6 +75,10 @@ interface PromptTemplateJsonCommon {
|
|
|
75
75
|
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
76
76
|
*/
|
|
77
77
|
readonly description?: string;
|
|
78
|
+
/**
|
|
79
|
+
* If theese parameters meet the expectations requirements, they are used instead of executing this prompt template
|
|
80
|
+
*/
|
|
81
|
+
readonly jokers?: Array<string>;
|
|
78
82
|
/**
|
|
79
83
|
* Type of the execution
|
|
80
84
|
* This determines if the prompt template is send to LLM, user or some scripting evaluation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/openai",
|
|
3
|
-
"version": "0.28.0-
|
|
3
|
+
"version": "0.28.0-8",
|
|
4
4
|
"description": "Library to supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"openai": "4.2.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@promptbook/core": "0.28.0-
|
|
40
|
+
"@promptbook/core": "0.28.0-8"
|
|
41
41
|
},
|
|
42
42
|
"main": "./umd/index.umd.js",
|
|
43
43
|
"module": "./esm/index.es.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { number_integer, number_positive } from '../types/typeAliases';
|
|
1
2
|
/**
|
|
2
3
|
* Represents all the tools needed to interact with the user.
|
|
3
4
|
*
|
|
@@ -13,12 +14,20 @@ export interface UserInterfaceTools {
|
|
|
13
14
|
promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
|
|
14
15
|
}
|
|
15
16
|
export interface UserInterfaceToolsPromptDialogOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Prompt title
|
|
19
|
+
*
|
|
20
|
+
* Note: This is not a prompt to language model but a prompt to the user
|
|
21
|
+
* @example "Your name"
|
|
22
|
+
*/
|
|
23
|
+
promptTitle: string;
|
|
16
24
|
/**
|
|
17
25
|
* Prompt message
|
|
18
26
|
*
|
|
19
27
|
* Note: This is not a prompt to language model but a prompt to the user
|
|
28
|
+
* @example "Please enter your name, including your last name, title, etc."
|
|
20
29
|
*/
|
|
21
|
-
|
|
30
|
+
promptMessage: string;
|
|
22
31
|
/**
|
|
23
32
|
* Default value for the input/textarea
|
|
24
33
|
*/
|
|
@@ -27,4 +36,10 @@ export interface UserInterfaceToolsPromptDialogOptions {
|
|
|
27
36
|
* Placeholder for the input/textarea
|
|
28
37
|
*/
|
|
29
38
|
placeholder?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Priority of the prompt
|
|
41
|
+
*
|
|
42
|
+
* Note: This would be reflected for example into the UI z-index of the prompt modal
|
|
43
|
+
*/
|
|
44
|
+
priority: number_integer & number_positive;
|
|
30
45
|
}
|
|
@@ -6,7 +6,7 @@ import type { ExpectationAmount, ExpectationUnit } from './PromptTemplatePipelin
|
|
|
6
6
|
* Command is one piece of the prompt template which adds some logic to the prompt template or the whole pipeline.
|
|
7
7
|
* It is parsed from the markdown from ul/ol items - one command per one item.
|
|
8
8
|
*/
|
|
9
|
-
export type Command = PtbkUrlCommand | PtbkVersionCommand | ExecuteCommand | ModelCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
|
|
9
|
+
export type Command = PtbkUrlCommand | PtbkVersionCommand | ExecuteCommand | ModelCommand | JokerCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
|
|
10
10
|
/**
|
|
11
11
|
* PtpVersion command tells which version is .ptp file using
|
|
12
12
|
*
|
|
@@ -43,6 +43,13 @@ export interface ModelCommand {
|
|
|
43
43
|
readonly key: keyof ModelRequirements;
|
|
44
44
|
readonly value: any;
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Joker parameter is used instead of executing the prompt template if it meet the expectations requirements
|
|
48
|
+
*/
|
|
49
|
+
export interface JokerCommand {
|
|
50
|
+
readonly type: 'JOKER';
|
|
51
|
+
readonly parameterName: string_name;
|
|
52
|
+
}
|
|
46
53
|
/**
|
|
47
54
|
* Parameter command describes one parameter of the prompt template
|
|
48
55
|
*
|
|
@@ -75,6 +75,10 @@ interface PromptTemplateJsonCommon {
|
|
|
75
75
|
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
76
76
|
*/
|
|
77
77
|
readonly description?: string;
|
|
78
|
+
/**
|
|
79
|
+
* If theese parameters meet the expectations requirements, they are used instead of executing this prompt template
|
|
80
|
+
*/
|
|
81
|
+
readonly jokers?: Array<string>;
|
|
78
82
|
/**
|
|
79
83
|
* Type of the execution
|
|
80
84
|
* This determines if the prompt template is send to LLM, user or some scripting evaluation
|