@promptbook/core 0.44.0-0 → 0.44.0-10
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 +745 -603
- package/esm/index.es.js.map +1 -1
- package/esm/typings/_packages/core.index.d.ts +2 -1
- package/esm/typings/_packages/utils.index.d.ts +21 -11
- package/esm/typings/config.d.ts +4 -0
- package/esm/typings/errors/PromptbookNotFoundError.d.ts +7 -0
- package/esm/typings/errors/{ExpectError.d.ts → _ExpectError.d.ts} +1 -0
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts +1 -1
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/MockedFackedNaturalExecutionTools.d.ts +19 -0
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.d.ts +11 -0
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.test.d.ts +1 -0
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/faked-completion.test.d.ts +1 -0
- package/esm/typings/execution/utils/checkExpectations.d.ts +25 -0
- package/esm/typings/execution/utils/checkExpectations.test.d.ts +1 -0
- package/esm/typings/types/Prompt.d.ts +8 -0
- package/esm/typings/types/PromptbookJson/PromptTemplateJson.d.ts +13 -4
- package/esm/typings/utils/expectation-counters/countSentences.d.ts +4 -0
- package/package.json +2 -1
- package/umd/index.umd.js +748 -606
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/_packages/core.index.d.ts +2 -1
- package/umd/typings/_packages/utils.index.d.ts +21 -11
- package/umd/typings/config.d.ts +4 -0
- package/umd/typings/errors/PromptbookNotFoundError.d.ts +7 -0
- package/umd/typings/errors/{ExpectError.d.ts → _ExpectError.d.ts} +1 -0
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts +1 -1
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/MockedFackedNaturalExecutionTools.d.ts +19 -0
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.d.ts +11 -0
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.test.d.ts +1 -0
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/faked-completion.test.d.ts +1 -0
- package/umd/typings/execution/utils/checkExpectations.d.ts +25 -0
- package/umd/typings/execution/utils/checkExpectations.test.d.ts +1 -0
- package/umd/typings/types/Prompt.d.ts +8 -0
- package/umd/typings/types/PromptbookJson/PromptTemplateJson.d.ts +13 -4
- package/umd/typings/utils/expectation-counters/countSentences.d.ts +4 -0
- package/esm/typings/errors/NotFoundError.d.ts +0 -7
- package/umd/typings/errors/NotFoundError.d.ts +0 -7
|
@@ -18,6 +18,17 @@ export type NaturalTemplateJson = PromptTemplateJsonCommon & {
|
|
|
18
18
|
*/
|
|
19
19
|
readonly modelRequirements: ModelRequirements;
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Expect this amount of each unit in the answer
|
|
23
|
+
*
|
|
24
|
+
* For example 5 words, 3 sentences, 2 paragraphs, ...
|
|
25
|
+
*
|
|
26
|
+
* Note: Expectations are performed after all postprocessing steps
|
|
27
|
+
*/
|
|
28
|
+
export type Expectations = Partial<Record<Lowercase<ExpectationUnit>, {
|
|
29
|
+
min?: ExpectationAmount;
|
|
30
|
+
max?: ExpectationAmount;
|
|
31
|
+
}>>;
|
|
21
32
|
/**
|
|
22
33
|
* Units of text measurement
|
|
23
34
|
*/
|
|
@@ -105,10 +116,7 @@ interface PromptTemplateJsonCommon {
|
|
|
105
116
|
*
|
|
106
117
|
* Note: Expectations are performed after all postprocessing steps
|
|
107
118
|
*/
|
|
108
|
-
readonly
|
|
109
|
-
min?: ExpectationAmount;
|
|
110
|
-
max?: ExpectationAmount;
|
|
111
|
-
}>>;
|
|
119
|
+
readonly expectations?: Expectations;
|
|
112
120
|
/**
|
|
113
121
|
* Expect this format of the answer
|
|
114
122
|
*
|
|
@@ -122,5 +130,6 @@ interface PromptTemplateJsonCommon {
|
|
|
122
130
|
}
|
|
123
131
|
export {};
|
|
124
132
|
/**
|
|
133
|
+
* TODO: [💝] Unite object for expecting amount and format - remove expectFormat
|
|
125
134
|
* TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
|
|
126
135
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/core",
|
|
3
|
-
"version": "0.44.0-
|
|
3
|
+
"version": "0.44.0-10",
|
|
4
4
|
"description": "Library to supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://www.npmjs.com/package/@promptbook/core",
|
|
36
36
|
"dependencies": {
|
|
37
|
+
"lorem-ipsum": "^2.0.8",
|
|
37
38
|
"spacetrim": "0.11.2"
|
|
38
39
|
},
|
|
39
40
|
"main": "./umd/index.umd.js",
|