@promptbook/openai 0.28.0-7 → 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.
@@ -1,4 +1 @@
1
1
  export {};
2
- /**
3
- * TODO: [💥] Some system to automatically generate tests for all the templates in the folder
4
- */
@@ -1,4 +1 @@
1
1
  export {};
2
- /**
3
- * TODO: [💥] Some system to automatically generate tests for all the templates in the folder
4
- */
@@ -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
- prompt: string;
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
  }
@@ -0,0 +1,4 @@
1
+ export {};
2
+ /**
3
+ * TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPtpExecutor.test.ts"
4
+ */
@@ -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
@@ -1,4 +1 @@
1
1
  export {};
2
- /**
3
- * TODO: [💥] Some system to automatically generate tests for all the templates in the folder
4
- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/openai",
3
- "version": "0.28.0-7",
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-7"
40
+ "@promptbook/core": "0.28.0-8"
41
41
  },
42
42
  "main": "./umd/index.umd.js",
43
43
  "module": "./esm/index.es.js",
@@ -1,4 +1 @@
1
1
  export {};
2
- /**
3
- * TODO: [💥] Some system to automatically generate tests for all the templates in the folder
4
- */
@@ -1,4 +1 @@
1
1
  export {};
2
- /**
3
- * TODO: [💥] Some system to automatically generate tests for all the templates in the folder
4
- */
@@ -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
- prompt: string;
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
  }
@@ -0,0 +1,4 @@
1
+ export {};
2
+ /**
3
+ * TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPtpExecutor.test.ts"
4
+ */
@@ -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
@@ -1,4 +1 @@
1
1
  export {};
2
- /**
3
- * TODO: [💥] Some system to automatically generate tests for all the templates in the folder
4
- */