@promptbook/remote-server 0.44.0-4 → 0.44.0-6
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 +1 -1
- package/esm/typings/_packages/utils.index.d.ts +3 -2
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.d.ts +4 -0
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.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/PromptbookJson/PromptTemplateJson.d.ts +1 -0
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
- package/umd/typings/_packages/utils.index.d.ts +3 -2
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.d.ts +4 -0
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.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/PromptbookJson/PromptTemplateJson.d.ts +1 -0
package/esm/index.es.js
CHANGED
|
@@ -89,7 +89,7 @@ var PromptbookExecutionError = /** @class */ (function (_super) {
|
|
|
89
89
|
/**
|
|
90
90
|
* The version of the Promptbook library
|
|
91
91
|
*/
|
|
92
|
-
var PROMPTBOOK_VERSION = '0.44.0-
|
|
92
|
+
var PROMPTBOOK_VERSION = '0.44.0-5';
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptbookString';
|
|
2
2
|
import { parseNumber } from '../conversion/utils/parseNumber';
|
|
3
3
|
import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
|
|
4
|
+
import { checkExpectations, isPassingExpectations } from '../execution/utils/checkExpectations';
|
|
4
5
|
import { replaceParameters } from '../execution/utils/replaceParameters';
|
|
5
6
|
import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
|
|
6
7
|
import { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
@@ -40,9 +41,9 @@ import { removeQuotes } from '../utils/removeQuotes';
|
|
|
40
41
|
import { trimCodeBlock } from '../utils/trimCodeBlock';
|
|
41
42
|
import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
|
|
42
43
|
import { unwrapResult } from '../utils/unwrapResult';
|
|
43
|
-
export { assertsExecutionSuccessful, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, extractAllBlocksFromMarkdown, // <- [🌻]
|
|
44
|
+
export { assertsExecutionSuccessful, checkExpectations, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, extractAllBlocksFromMarkdown, // <- [🌻]
|
|
44
45
|
extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
|
|
45
|
-
extractOneBlockFromMarkdown, isValidJsonString, parseNumber, // <- [🌻]
|
|
46
|
+
extractOneBlockFromMarkdown, isPassingExpectations, isValidJsonString, parseNumber, // <- [🌻]
|
|
46
47
|
prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
|
|
47
48
|
export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
|
|
48
49
|
export { splitIntoSentences };
|
package/esm/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.d.ts
CHANGED
|
@@ -5,3 +5,7 @@ import type { Expectations } from '../../../../types/PromptbookJson/PromptTempla
|
|
|
5
5
|
* @private internal util for MockedFackedNaturalExecutionTools
|
|
6
6
|
*/
|
|
7
7
|
export declare function $fakeTextToExpectations(expectations: Expectations): string;
|
|
8
|
+
/**
|
|
9
|
+
* TODO: Implement better
|
|
10
|
+
* TODO: [💝] Unite object for expecting amount and format - use here also a format
|
|
11
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Expectations } from '../../types/PromptbookJson/PromptTemplateJson';
|
|
2
|
+
/**
|
|
3
|
+
* Function checkExpectations will check if the expectations on given value are met
|
|
4
|
+
*
|
|
5
|
+
* Note: There are two simmilar functions:
|
|
6
|
+
* - `checkExpectations` which throws an error if the expectations are not met
|
|
7
|
+
* - `isPassingExpectations` which returns a boolean
|
|
8
|
+
*
|
|
9
|
+
* @throws {ExpectError} if the expectations are not met
|
|
10
|
+
* @returns {void} Nothing
|
|
11
|
+
*/
|
|
12
|
+
export declare function checkExpectations(expectations: Expectations, value: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Function checkExpectations will check if the expectations on given value are met
|
|
15
|
+
*
|
|
16
|
+
* Note: There are two simmilar functions:
|
|
17
|
+
* - `checkExpectations` which throws an error if the expectations are not met
|
|
18
|
+
* - `isPassingExpectations` which returns a boolean
|
|
19
|
+
*
|
|
20
|
+
* @returns {boolean} True if the expectations are met
|
|
21
|
+
*/
|
|
22
|
+
export declare function isPassingExpectations(expectations: Expectations, value: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* TODO: [💝] Unite object for expecting amount and format
|
|
25
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -130,5 +130,6 @@ interface PromptTemplateJsonCommon {
|
|
|
130
130
|
}
|
|
131
131
|
export {};
|
|
132
132
|
/**
|
|
133
|
+
* TODO: [💝] Unite object for expecting amount and format - remove expectFormat
|
|
133
134
|
* TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
|
|
134
135
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-server",
|
|
3
|
-
"version": "0.44.0-
|
|
3
|
+
"version": "0.44.0-6",
|
|
4
4
|
"description": "Library to supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"spacetrim": "0.11.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@promptbook/core": "0.44.0-
|
|
42
|
+
"@promptbook/core": "0.44.0-6"
|
|
43
43
|
},
|
|
44
44
|
"main": "./umd/index.umd.js",
|
|
45
45
|
"module": "./esm/index.es.js",
|
package/umd/index.umd.js
CHANGED
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
/**
|
|
97
97
|
* The version of the Promptbook library
|
|
98
98
|
*/
|
|
99
|
-
var PROMPTBOOK_VERSION = '0.44.0-
|
|
99
|
+
var PROMPTBOOK_VERSION = '0.44.0-5';
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptbookString';
|
|
2
2
|
import { parseNumber } from '../conversion/utils/parseNumber';
|
|
3
3
|
import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
|
|
4
|
+
import { checkExpectations, isPassingExpectations } from '../execution/utils/checkExpectations';
|
|
4
5
|
import { replaceParameters } from '../execution/utils/replaceParameters';
|
|
5
6
|
import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
|
|
6
7
|
import { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
@@ -40,9 +41,9 @@ import { removeQuotes } from '../utils/removeQuotes';
|
|
|
40
41
|
import { trimCodeBlock } from '../utils/trimCodeBlock';
|
|
41
42
|
import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
|
|
42
43
|
import { unwrapResult } from '../utils/unwrapResult';
|
|
43
|
-
export { assertsExecutionSuccessful, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, extractAllBlocksFromMarkdown, // <- [🌻]
|
|
44
|
+
export { assertsExecutionSuccessful, checkExpectations, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, extractAllBlocksFromMarkdown, // <- [🌻]
|
|
44
45
|
extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
|
|
45
|
-
extractOneBlockFromMarkdown, isValidJsonString, parseNumber, // <- [🌻]
|
|
46
|
+
extractOneBlockFromMarkdown, isPassingExpectations, isValidJsonString, parseNumber, // <- [🌻]
|
|
46
47
|
prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
|
|
47
48
|
export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
|
|
48
49
|
export { splitIntoSentences };
|
package/umd/typings/execution/plugins/natural-execution-tools/mocked/fakeTextToExpectations.d.ts
CHANGED
|
@@ -5,3 +5,7 @@ import type { Expectations } from '../../../../types/PromptbookJson/PromptTempla
|
|
|
5
5
|
* @private internal util for MockedFackedNaturalExecutionTools
|
|
6
6
|
*/
|
|
7
7
|
export declare function $fakeTextToExpectations(expectations: Expectations): string;
|
|
8
|
+
/**
|
|
9
|
+
* TODO: Implement better
|
|
10
|
+
* TODO: [💝] Unite object for expecting amount and format - use here also a format
|
|
11
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Expectations } from '../../types/PromptbookJson/PromptTemplateJson';
|
|
2
|
+
/**
|
|
3
|
+
* Function checkExpectations will check if the expectations on given value are met
|
|
4
|
+
*
|
|
5
|
+
* Note: There are two simmilar functions:
|
|
6
|
+
* - `checkExpectations` which throws an error if the expectations are not met
|
|
7
|
+
* - `isPassingExpectations` which returns a boolean
|
|
8
|
+
*
|
|
9
|
+
* @throws {ExpectError} if the expectations are not met
|
|
10
|
+
* @returns {void} Nothing
|
|
11
|
+
*/
|
|
12
|
+
export declare function checkExpectations(expectations: Expectations, value: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Function checkExpectations will check if the expectations on given value are met
|
|
15
|
+
*
|
|
16
|
+
* Note: There are two simmilar functions:
|
|
17
|
+
* - `checkExpectations` which throws an error if the expectations are not met
|
|
18
|
+
* - `isPassingExpectations` which returns a boolean
|
|
19
|
+
*
|
|
20
|
+
* @returns {boolean} True if the expectations are met
|
|
21
|
+
*/
|
|
22
|
+
export declare function isPassingExpectations(expectations: Expectations, value: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* TODO: [💝] Unite object for expecting amount and format
|
|
25
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -130,5 +130,6 @@ interface PromptTemplateJsonCommon {
|
|
|
130
130
|
}
|
|
131
131
|
export {};
|
|
132
132
|
/**
|
|
133
|
+
* TODO: [💝] Unite object for expecting amount and format - remove expectFormat
|
|
133
134
|
* TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
|
|
134
135
|
*/
|