@promptbook/legacy-documents 0.75.0-0 β 0.75.0-1
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 +49 -24
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +8 -0
- package/esm/typings/src/_packages/utils.index.d.ts +2 -2
- package/esm/typings/src/config.d.ts +1 -0
- package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +14 -0
- package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +6 -1
- package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +1 -1
- package/esm/typings/src/formfactors/chat/ChatFormfactorDefinition.d.ts +6 -1
- package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +4 -0
- package/esm/typings/src/formfactors/index.d.ts +26 -1
- package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +14 -0
- package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +14 -0
- package/esm/typings/src/pipeline/pipeline-interface/PipelineInterface.d.ts +2 -2
- package/esm/typings/src/pipeline/pipeline-interface/constants.d.ts +9 -0
- package/esm/typings/src/utils/expectation-counters/{config.d.ts β constants.d.ts} +3 -0
- package/package.json +2 -2
- package/umd/index.umd.js +49 -24
- package/umd/index.umd.js.map +1 -1
|
@@ -59,9 +59,12 @@ import { CsvFormatDefinition } from '../formats/csv/CsvFormatDefinition';
|
|
|
59
59
|
import { CsvFormatError } from '../formats/csv/CsvFormatError';
|
|
60
60
|
import { MANDATORY_CSV_SETTINGS } from '../formats/csv/CsvSettings';
|
|
61
61
|
import { TextFormatDefinition } from '../formats/text/TextFormatDefinition';
|
|
62
|
+
import { BoilerplateFormfactorDefinition } from '../formfactors/_boilerplate/BoilerplateFormfactorDefinition';
|
|
62
63
|
import { ChatFormfactorDefinition } from '../formfactors/chat/ChatFormfactorDefinition';
|
|
63
64
|
import { GenericFormfactorDefinition } from '../formfactors/generic/GenericFormfactorDefinition';
|
|
64
65
|
import { FORMFACTOR_DEFINITIONS } from '../formfactors/index';
|
|
66
|
+
import { SheetsFormfactorDefinition } from '../formfactors/sheets/SheetsFormfactorDefinition';
|
|
67
|
+
import { TranslatorFormfactorDefinition } from '../formfactors/translator/TranslatorFormfactorDefinition';
|
|
65
68
|
import { $llmToolsMetadataRegister } from '../llm-providers/_common/register/$llmToolsMetadataRegister';
|
|
66
69
|
import { $llmToolsRegister } from '../llm-providers/_common/register/$llmToolsRegister';
|
|
67
70
|
import { createLlmToolsFromConfiguration } from '../llm-providers/_common/register/createLlmToolsFromConfiguration';
|
|
@@ -75,6 +78,7 @@ import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlm
|
|
|
75
78
|
import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
76
79
|
import { _OpenAiAssistantMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
77
80
|
import { preparePersona } from '../personas/preparePersona';
|
|
81
|
+
import { GENERIC_PIPELINE_INTERFACE } from '../pipeline/pipeline-interface/constants';
|
|
78
82
|
import { getPipelineInterface } from '../pipeline/pipeline-interface/getPipelineInterface';
|
|
79
83
|
import { isPipelineImplementingInterface } from '../pipeline/pipeline-interface/isPipelineImplementingInterface';
|
|
80
84
|
import { isPipelineInterfacesEqual } from '../pipeline/pipeline-interface/isPipelineInterfacesEqual';
|
|
@@ -160,9 +164,12 @@ export { CsvFormatDefinition };
|
|
|
160
164
|
export { CsvFormatError };
|
|
161
165
|
export { MANDATORY_CSV_SETTINGS };
|
|
162
166
|
export { TextFormatDefinition };
|
|
167
|
+
export { BoilerplateFormfactorDefinition };
|
|
163
168
|
export { ChatFormfactorDefinition };
|
|
164
169
|
export { GenericFormfactorDefinition };
|
|
165
170
|
export { FORMFACTOR_DEFINITIONS };
|
|
171
|
+
export { SheetsFormfactorDefinition };
|
|
172
|
+
export { TranslatorFormfactorDefinition };
|
|
166
173
|
export { $llmToolsMetadataRegister };
|
|
167
174
|
export { $llmToolsRegister };
|
|
168
175
|
export { createLlmToolsFromConfiguration };
|
|
@@ -176,6 +183,7 @@ export { MultipleLlmExecutionTools };
|
|
|
176
183
|
export { _OpenAiMetadataRegistration };
|
|
177
184
|
export { _OpenAiAssistantMetadataRegistration };
|
|
178
185
|
export { preparePersona };
|
|
186
|
+
export { GENERIC_PIPELINE_INTERFACE };
|
|
179
187
|
export { getPipelineInterface };
|
|
180
188
|
export { isPipelineImplementingInterface };
|
|
181
189
|
export { isPipelineInterfacesEqual };
|
|
@@ -12,8 +12,8 @@ import { $currentDate } from '../utils/$currentDate';
|
|
|
12
12
|
import { $isRunningInBrowser } from '../utils/environment/$isRunningInBrowser';
|
|
13
13
|
import { $isRunningInNode } from '../utils/environment/$isRunningInNode';
|
|
14
14
|
import { $isRunningInWebWorker } from '../utils/environment/$isRunningInWebWorker';
|
|
15
|
-
import { CHARACTERS_PER_STANDARD_LINE } from '../utils/expectation-counters/
|
|
16
|
-
import { LINES_PER_STANDARD_PAGE } from '../utils/expectation-counters/
|
|
15
|
+
import { CHARACTERS_PER_STANDARD_LINE } from '../utils/expectation-counters/constants';
|
|
16
|
+
import { LINES_PER_STANDARD_PAGE } from '../utils/expectation-counters/constants';
|
|
17
17
|
import { countCharacters } from '../utils/expectation-counters/countCharacters';
|
|
18
18
|
import { countLines } from '../utils/expectation-counters/countLines';
|
|
19
19
|
import { countPages } from '../utils/expectation-counters/countPages';
|
|
@@ -192,5 +192,6 @@ export declare const IS_PIPELINE_LOGIC_VALIDATED: boolean;
|
|
|
192
192
|
*/
|
|
193
193
|
export declare const IS_COST_PREVENTED: boolean;
|
|
194
194
|
/**
|
|
195
|
+
* TODO: Extract `constants.ts` from `config.ts`
|
|
195
196
|
* TODO: [π§ ][π§ββοΈ] Maybe join remoteUrl and path into single value
|
|
196
197
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boilerplate is form of app that @@@
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/core`
|
|
5
|
+
*/
|
|
6
|
+
export declare const BoilerplateFormfactorDefinition: {
|
|
7
|
+
readonly name: "BOILERPLATE";
|
|
8
|
+
readonly description: "@@@";
|
|
9
|
+
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
10
|
+
readonly pipelineInterface: {
|
|
11
|
+
readonly inputParameterNames: readonly [];
|
|
12
|
+
readonly outputParameterNames: readonly [];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PipelineInterface } from '../../pipeline/pipeline-interface/PipelineInterface';
|
|
2
2
|
import type { string_markdown_text } from '../../types/typeAliases';
|
|
3
3
|
import type { string_name } from '../../types/typeAliases';
|
|
4
4
|
import type { string_promptbook_documentation_url } from '../../types/typeAliases';
|
|
5
|
+
import type { string_SCREAMING_CASE } from '../../utils/normalization/normalizeTo_SCREAMING_CASE';
|
|
5
6
|
/**
|
|
6
7
|
* @@@
|
|
7
8
|
*/
|
|
@@ -26,4 +27,8 @@ export type AbstractFormfactorDefinition = {
|
|
|
26
27
|
* @@@
|
|
27
28
|
*/
|
|
28
29
|
readonly documentationUrl: string_promptbook_documentation_url;
|
|
30
|
+
/**
|
|
31
|
+
* @@@
|
|
32
|
+
*/
|
|
33
|
+
readonly pipelineInterface: PipelineInterface;
|
|
29
34
|
};
|
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
* @public exported from `@promptbook/core`
|
|
5
5
|
*/
|
|
6
6
|
export declare const ChatFormfactorDefinition: {
|
|
7
|
-
readonly name: "
|
|
7
|
+
readonly name: "CHATBOT";
|
|
8
|
+
readonly aliasNames: readonly ["CHAT"];
|
|
8
9
|
readonly description: "@@@";
|
|
9
10
|
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
11
|
+
readonly pipelineInterface: {
|
|
12
|
+
readonly inputParameterNames: readonly ["previousTitle", "previousConversationSummary", "userMessage"];
|
|
13
|
+
readonly outputParameterNames: readonly ["title", "conversationSummary", "chatbotResponse"];
|
|
14
|
+
};
|
|
10
15
|
};
|
|
@@ -7,4 +7,8 @@ export declare const GenericFormfactorDefinition: {
|
|
|
7
7
|
readonly name: "GENERIC";
|
|
8
8
|
readonly description: "@@@";
|
|
9
9
|
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
10
|
+
readonly pipelineInterface: {
|
|
11
|
+
readonly inputParameterNames: readonly [];
|
|
12
|
+
readonly outputParameterNames: readonly [];
|
|
13
|
+
};
|
|
10
14
|
};
|
|
@@ -7,8 +7,33 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
|
|
|
7
7
|
readonly name: "GENERIC";
|
|
8
8
|
readonly description: "@@@";
|
|
9
9
|
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
10
|
+
readonly pipelineInterface: {
|
|
11
|
+
readonly inputParameterNames: readonly [];
|
|
12
|
+
readonly outputParameterNames: readonly [];
|
|
13
|
+
};
|
|
10
14
|
}, {
|
|
11
|
-
readonly name: "
|
|
15
|
+
readonly name: "CHATBOT";
|
|
16
|
+
readonly aliasNames: readonly ["CHAT"];
|
|
12
17
|
readonly description: "@@@";
|
|
13
18
|
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
19
|
+
readonly pipelineInterface: {
|
|
20
|
+
readonly inputParameterNames: readonly ["previousTitle", "previousConversationSummary", "userMessage"];
|
|
21
|
+
readonly outputParameterNames: readonly ["title", "conversationSummary", "chatbotResponse"];
|
|
22
|
+
};
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "TRANSLATOR";
|
|
25
|
+
readonly description: "@@@";
|
|
26
|
+
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
27
|
+
readonly pipelineInterface: {
|
|
28
|
+
readonly inputParameterNames: readonly ["inputMessage"];
|
|
29
|
+
readonly outputParameterNames: readonly ["outputMessage"];
|
|
30
|
+
};
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "SHEETS";
|
|
33
|
+
readonly description: "@@@";
|
|
34
|
+
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
35
|
+
readonly pipelineInterface: {
|
|
36
|
+
readonly inputParameterNames: readonly ["inputSheet"];
|
|
37
|
+
readonly outputParameterNames: readonly ["outputSheet"];
|
|
38
|
+
};
|
|
14
39
|
}];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sheets is form of app that @@@
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/core`
|
|
5
|
+
*/
|
|
6
|
+
export declare const SheetsFormfactorDefinition: {
|
|
7
|
+
readonly name: "SHEETS";
|
|
8
|
+
readonly description: "@@@";
|
|
9
|
+
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
10
|
+
readonly pipelineInterface: {
|
|
11
|
+
readonly inputParameterNames: readonly ["inputSheet"];
|
|
12
|
+
readonly outputParameterNames: readonly ["outputSheet"];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translator is form of app that @@@
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/core`
|
|
5
|
+
*/
|
|
6
|
+
export declare const TranslatorFormfactorDefinition: {
|
|
7
|
+
readonly name: "TRANSLATOR";
|
|
8
|
+
readonly description: "@@@";
|
|
9
|
+
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
10
|
+
readonly pipelineInterface: {
|
|
11
|
+
readonly inputParameterNames: readonly ["inputMessage"];
|
|
12
|
+
readonly outputParameterNames: readonly ["outputMessage"];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -8,13 +8,13 @@ export type PipelineInterface = {
|
|
|
8
8
|
*
|
|
9
9
|
* Note: Sorted alphabetically
|
|
10
10
|
*/
|
|
11
|
-
inputParameterNames:
|
|
11
|
+
readonly inputParameterNames: ReadonlyArray<string_parameter_name>;
|
|
12
12
|
/**
|
|
13
13
|
* @@@
|
|
14
14
|
*
|
|
15
15
|
* Note: Sorted alphabetically
|
|
16
16
|
*/
|
|
17
|
-
outputParameterNames:
|
|
17
|
+
readonly outputParameterNames: ReadonlyArray<string_parameter_name>;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* TODO: !!!!!! Change inputParameterNames to inputParameters<InputParameter>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/legacy-documents",
|
|
3
|
-
"version": "0.75.0-
|
|
3
|
+
"version": "0.75.0-1",
|
|
4
4
|
"description": "Supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"module": "./esm/index.es.js",
|
|
54
54
|
"typings": "./esm/typings/src/_packages/legacy-documents.index.d.ts",
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@promptbook/core": "0.75.0-
|
|
56
|
+
"@promptbook/core": "0.75.0-1"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"colors": "1.4.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.
|
|
26
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.75.0-0';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
*/
|
|
@@ -462,6 +462,7 @@
|
|
|
462
462
|
// Note: In normal situations, we check the pipeline logic:
|
|
463
463
|
true);
|
|
464
464
|
/**
|
|
465
|
+
* TODO: Extract `constants.ts` from `config.ts`
|
|
465
466
|
* TODO: [π§ ][π§ββοΈ] Maybe join remoteUrl and path into single value
|
|
466
467
|
*/
|
|
467
468
|
|
|
@@ -1704,18 +1705,18 @@
|
|
|
1704
1705
|
}
|
|
1705
1706
|
var _loop_1 = function (parameter) {
|
|
1706
1707
|
if (parameter.isInput && parameter.isOutput) {
|
|
1707
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim(function (block) { return "\n\n Parameter {".concat(parameter.name, "} can not be both input and output\n\n ").concat(block(pipelineIdentification), "\n "); }));
|
|
1708
|
+
throw new PipelineLogicError(spaceTrim.spaceTrim(function (block) { return "\n\n Parameter `{".concat(parameter.name, "}` can not be both input and output\n\n ").concat(block(pipelineIdentification), "\n "); }));
|
|
1708
1709
|
}
|
|
1709
1710
|
// Note: Testing that parameter is either intermediate or output BUT not created and unused
|
|
1710
1711
|
if (!parameter.isInput &&
|
|
1711
1712
|
!parameter.isOutput &&
|
|
1712
1713
|
!pipeline.templates.some(function (template) { return template.dependentParameterNames.includes(parameter.name); })) {
|
|
1713
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim(function (block) { return "\n Parameter {".concat(parameter.name, "} is created but not used\n\n You can declare {").concat(parameter.name, "} as output parameter by adding in the header:\n - OUTPUT PARAMETER `{").concat(parameter.name, "}` ").concat(parameter.description || '', "\n\n ").concat(block(pipelineIdentification), "\n\n "); }));
|
|
1714
|
+
throw new PipelineLogicError(spaceTrim.spaceTrim(function (block) { return "\n Parameter `{".concat(parameter.name, "}` is created but not used\n\n You can declare {").concat(parameter.name, "} as output parameter by adding in the header:\n - OUTPUT PARAMETER `{").concat(parameter.name, "}` ").concat(parameter.description || '', "\n\n ").concat(block(pipelineIdentification), "\n\n "); }));
|
|
1714
1715
|
}
|
|
1715
1716
|
// Note: Testing that parameter is either input or result of some template
|
|
1716
1717
|
if (!parameter.isInput &&
|
|
1717
1718
|
!pipeline.templates.some(function (template) { return template.resultingParameterName === parameter.name; })) {
|
|
1718
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim(function (block) { return "\n Parameter {".concat(parameter.name, "} is declared but not defined\n\n You can do one of these:\n 1) Remove declaration of {").concat(parameter.name, "}
|
|
1719
|
+
throw new PipelineLogicError(spaceTrim.spaceTrim(function (block) { return "\n Parameter `{".concat(parameter.name, "}` is declared but not defined\n\n You can do one of these:\n 1) Remove declaration of `{").concat(parameter.name, "}`\n 2) Add template that results in `-> {").concat(parameter.name, "}`\n\n ").concat(block(pipelineIdentification), "\n "); }));
|
|
1719
1720
|
}
|
|
1720
1721
|
};
|
|
1721
1722
|
try {
|
|
@@ -1743,7 +1744,7 @@
|
|
|
1743
1744
|
var _loop_2 = function (template) {
|
|
1744
1745
|
var e_4, _h, e_5, _j;
|
|
1745
1746
|
if (definedParameters.has(template.resultingParameterName)) {
|
|
1746
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim(function (block) { return "\n Parameter {".concat(template.resultingParameterName, "} is defined multiple times\n\n ").concat(block(pipelineIdentification), "\n "); }));
|
|
1747
|
+
throw new PipelineLogicError(spaceTrim.spaceTrim(function (block) { return "\n Parameter `{".concat(template.resultingParameterName, "}` is defined multiple times\n\n ").concat(block(pipelineIdentification), "\n "); }));
|
|
1747
1748
|
}
|
|
1748
1749
|
if (RESERVED_PARAMETER_NAMES.includes(template.resultingParameterName)) {
|
|
1749
1750
|
throw new PipelineLogicError(spaceTrim.spaceTrim(function (block) { return "\n Parameter name {".concat(template.resultingParameterName, "} is reserved, please use different name\n\n ").concat(block(pipelineIdentification), "\n "); }));
|
|
@@ -1756,7 +1757,7 @@
|
|
|
1756
1757
|
}
|
|
1757
1758
|
var _loop_4 = function (joker) {
|
|
1758
1759
|
if (!template.dependentParameterNames.includes(joker)) {
|
|
1759
|
-
throw new PipelineLogicError(spaceTrim.spaceTrim(function (block) { return "\n Parameter {".concat(joker, "} is used for {").concat(template.resultingParameterName, "} as joker but not in `dependentParameterNames`\n\n ").concat(block(pipelineIdentification), "\n "); }));
|
|
1760
|
+
throw new PipelineLogicError(spaceTrim.spaceTrim(function (block) { return "\n Parameter `{".concat(joker, "}` is used for {").concat(template.resultingParameterName, "} as joker but not in `dependentParameterNames`\n\n ").concat(block(pipelineIdentification), "\n "); }));
|
|
1760
1761
|
}
|
|
1761
1762
|
};
|
|
1762
1763
|
try {
|
|
@@ -1851,14 +1852,24 @@
|
|
|
1851
1852
|
if (currentlyResovedTemplates.length === 0) {
|
|
1852
1853
|
throw new PipelineLogicError(
|
|
1853
1854
|
// TODO: [π] DRY
|
|
1854
|
-
spaceTrim.spaceTrim(function (block) { return "\n\n Can not resolve some parameters:\n Either you are using a parameter that is not defined, or there are some circular dependencies.\n\n ".concat(block(pipelineIdentification), "\n\n Can not resolve
|
|
1855
|
+
spaceTrim.spaceTrim(function (block) { return "\n\n Can not resolve some parameters:\n Either you are using a parameter that is not defined, or there are some circular dependencies.\n\n ".concat(block(pipelineIdentification), "\n\n **Can not resolve:**\n ").concat(block(unresovedTemplates
|
|
1855
1856
|
.map(function (_a) {
|
|
1856
1857
|
var resultingParameterName = _a.resultingParameterName, dependentParameterNames = _a.dependentParameterNames;
|
|
1857
|
-
return "- Parameter {".concat(resultingParameterName, "} which depends on ").concat(dependentParameterNames
|
|
1858
|
-
.map(function (dependentParameterName) { return "{".concat(dependentParameterName, "}"); })
|
|
1858
|
+
return "- Parameter `{".concat(resultingParameterName, "}` which depends on ").concat(dependentParameterNames
|
|
1859
|
+
.map(function (dependentParameterName) { return "`{".concat(dependentParameterName, "}`"); })
|
|
1859
1860
|
.join(' and '));
|
|
1860
1861
|
})
|
|
1861
|
-
.join('\n')), "\n\n Resolved
|
|
1862
|
+
.join('\n')), "\n\n **Resolved:**\n ").concat(block(resovedParameters
|
|
1863
|
+
.filter(function (name) {
|
|
1864
|
+
return !RESERVED_PARAMETER_NAMES.includes(name);
|
|
1865
|
+
})
|
|
1866
|
+
.map(function (name) { return "- Parameter `{".concat(name, "}`"); })
|
|
1867
|
+
.join('\n')), "\n\n\n **Reserved (which are available):**\n ").concat(block(resovedParameters
|
|
1868
|
+
.filter(function (name) {
|
|
1869
|
+
return RESERVED_PARAMETER_NAMES.includes(name);
|
|
1870
|
+
})
|
|
1871
|
+
.map(function (name) { return "- Parameter `{".concat(name, "}`"); })
|
|
1872
|
+
.join('\n')), "\n\n\n "); }));
|
|
1862
1873
|
}
|
|
1863
1874
|
resovedParameters = __spreadArray(__spreadArray([], __read(resovedParameters), false), __read(currentlyResovedTemplates.map(function (_a) {
|
|
1864
1875
|
var resultingParameterName = _a.resultingParameterName;
|
|
@@ -1869,6 +1880,7 @@
|
|
|
1869
1880
|
while (unresovedTemplates.length > 0) {
|
|
1870
1881
|
_loop_3();
|
|
1871
1882
|
}
|
|
1883
|
+
// TODO: !!!!!! Test that pipeline interface implements declared formfactor interface
|
|
1872
1884
|
}
|
|
1873
1885
|
/**
|
|
1874
1886
|
* TODO: !! [π§ββοΈ] Do not allow joker + foreach
|
|
@@ -2806,8 +2818,8 @@
|
|
|
2806
2818
|
else if (errors.length > 1) {
|
|
2807
2819
|
throw new PipelineExecutionError(
|
|
2808
2820
|
// TODO: Tell which execution tools failed like
|
|
2809
|
-
// 1) OpenAI throw PipelineExecutionError: Parameter {knowledge} is not defined
|
|
2810
|
-
// 2) AnthropicClaude throw PipelineExecutionError: Parameter {knowledge} is not defined
|
|
2821
|
+
// 1) OpenAI throw PipelineExecutionError: Parameter `{knowledge}` is not defined
|
|
2822
|
+
// 2) AnthropicClaude throw PipelineExecutionError: Parameter `{knowledge}` is not defined
|
|
2811
2823
|
// 3) ...
|
|
2812
2824
|
spaceTrim__default["default"](function (block) { return "\n All execution tools failed:\n\n ".concat(block(errors
|
|
2813
2825
|
.map(function (error, i) { return "".concat(i + 1, ") **").concat(error.name || 'Error', ":** ").concat(error.message); })
|
|
@@ -4403,11 +4415,11 @@
|
|
|
4403
4415
|
for (var _b = __values(Object.entries(parameters)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
4404
4416
|
var _d = __read(_c.value, 2), parameterName = _d[0], parameterValue = _d[1];
|
|
4405
4417
|
if (parameterValue === RESERVED_PARAMETER_MISSING_VALUE) {
|
|
4406
|
-
throw new UnexpectedError("Parameter {".concat(parameterName, "} has missing value"));
|
|
4418
|
+
throw new UnexpectedError("Parameter `{".concat(parameterName, "}` has missing value"));
|
|
4407
4419
|
}
|
|
4408
4420
|
else if (parameterValue === RESERVED_PARAMETER_RESTRICTED) {
|
|
4409
4421
|
// TODO: [π΅]
|
|
4410
|
-
throw new UnexpectedError("Parameter {".concat(parameterName, "} is restricted to use"));
|
|
4422
|
+
throw new UnexpectedError("Parameter `{".concat(parameterName, "}` is restricted to use"));
|
|
4411
4423
|
}
|
|
4412
4424
|
}
|
|
4413
4425
|
}
|
|
@@ -4434,11 +4446,11 @@
|
|
|
4434
4446
|
throw new PipelineExecutionError('Parameter is already opened or not closed');
|
|
4435
4447
|
}
|
|
4436
4448
|
if (parameters[parameterName] === undefined) {
|
|
4437
|
-
throw new PipelineExecutionError("Parameter {".concat(parameterName, "} is not defined"));
|
|
4449
|
+
throw new PipelineExecutionError("Parameter `{".concat(parameterName, "}` is not defined"));
|
|
4438
4450
|
}
|
|
4439
4451
|
var parameterValue = parameters[parameterName];
|
|
4440
4452
|
if (parameterValue === undefined) {
|
|
4441
|
-
throw new PipelineExecutionError("Parameter {".concat(parameterName, "} is not defined"));
|
|
4453
|
+
throw new PipelineExecutionError("Parameter `{".concat(parameterName, "}` is not defined"));
|
|
4442
4454
|
}
|
|
4443
4455
|
parameterValue = parameterValue.toString();
|
|
4444
4456
|
if (parameterValue.includes('\n') && /^\s*\W{0,3}\s*$/.test(precol)) {
|
|
@@ -4494,6 +4506,9 @@
|
|
|
4494
4506
|
* @public exported from `@promptbook/utils`
|
|
4495
4507
|
*/
|
|
4496
4508
|
var LINES_PER_STANDARD_PAGE = 44;
|
|
4509
|
+
/**
|
|
4510
|
+
* TODO: [π§ ] Should be this `constants.ts` or `config.ts`?
|
|
4511
|
+
*/
|
|
4497
4512
|
|
|
4498
4513
|
/**
|
|
4499
4514
|
* Counts number of lines in the text
|
|
@@ -5225,7 +5240,7 @@
|
|
|
5225
5240
|
else if (!definedParameterNames.has(parameterName) && usedParameterNames.has(parameterName)) {
|
|
5226
5241
|
// Houston, we have a problem
|
|
5227
5242
|
// Note: Checking part is also done in `validatePipeline`, but itβs good to doublecheck
|
|
5228
|
-
throw new UnexpectedError(spaceTrim.spaceTrim(function (block) { return "\n Parameter {".concat(parameterName, "} is NOT defined\n BUT used in template \"").concat(currentTemplate.title || currentTemplate.name, "\"\n\n This should be catched in `validatePipeline`\n\n ").concat(block(pipelineIdentification), "\n\n "); }));
|
|
5243
|
+
throw new UnexpectedError(spaceTrim.spaceTrim(function (block) { return "\n Parameter `{".concat(parameterName, "}` is NOT defined\n BUT used in template \"").concat(currentTemplate.title || currentTemplate.name, "\"\n\n This should be catched in `validatePipeline`\n\n ").concat(block(pipelineIdentification), "\n\n "); }));
|
|
5229
5244
|
}
|
|
5230
5245
|
};
|
|
5231
5246
|
try {
|
|
@@ -5304,7 +5319,7 @@
|
|
|
5304
5319
|
var _loop_1 = function (parameter) {
|
|
5305
5320
|
if (parametersToPass[parameter.name] === undefined) {
|
|
5306
5321
|
// [4]
|
|
5307
|
-
$warnings.push(new PipelineExecutionError(spaceTrim.spaceTrim(function (block) { return "\n Parameter {".concat(parameter.name, "} should be an output parameter, but it was not generated during pipeline execution\n\n ").concat(block(pipelineIdentification), "\n "); })));
|
|
5322
|
+
$warnings.push(new PipelineExecutionError(spaceTrim.spaceTrim(function (block) { return "\n Parameter `{".concat(parameter.name, "}` should be an output parameter, but it was not generated during pipeline execution\n\n ").concat(block(pipelineIdentification), "\n "); })));
|
|
5308
5323
|
return "continue";
|
|
5309
5324
|
}
|
|
5310
5325
|
outputParameters[parameter.name] = parametersToPass[parameter.name] || '';
|
|
@@ -5391,7 +5406,7 @@
|
|
|
5391
5406
|
case 6: return [2 /*return*/, $asDeeplyFrozenSerializableJson("Unuccessful PipelineExecutorResult (with missing parameter {".concat(parameter.name, "}) PipelineExecutorResult"), {
|
|
5392
5407
|
isSuccessful: false,
|
|
5393
5408
|
errors: __spreadArray([
|
|
5394
|
-
new PipelineExecutionError("Parameter {".concat(parameter.name, "} is required as an input parameter"))
|
|
5409
|
+
new PipelineExecutionError("Parameter `{".concat(parameter.name, "}` is required as an input parameter"))
|
|
5395
5410
|
], __read(errors), false).map(serializeError),
|
|
5396
5411
|
warnings: [],
|
|
5397
5412
|
executionReport: executionReport,
|
|
@@ -5439,7 +5454,7 @@
|
|
|
5439
5454
|
case 3: return [2 /*return*/, { value: $asDeeplyFrozenSerializableJson(spaceTrim.spaceTrim(function (block) { return "\n Unuccessful PipelineExecutorResult (with extra parameter {".concat(parameter.name, "}) PipelineExecutorResult\n\n ").concat(block(pipelineIdentification), "\n "); }), {
|
|
5440
5455
|
isSuccessful: false,
|
|
5441
5456
|
errors: __spreadArray([
|
|
5442
|
-
new PipelineExecutionError(spaceTrim.spaceTrim(function (block) { return "\n Parameter {".concat(parameter.name, "} is passed as input parameter but it is not input\n\n ").concat(block(pipelineIdentification), "\n "); }))
|
|
5457
|
+
new PipelineExecutionError(spaceTrim.spaceTrim(function (block) { return "\n Parameter `{".concat(parameter.name, "}` is passed as input parameter but it is not input\n\n ").concat(block(pipelineIdentification), "\n "); }))
|
|
5443
5458
|
], __read(errors), false).map(serializeError),
|
|
5444
5459
|
warnings: warnings.map(serializeError),
|
|
5445
5460
|
executionReport: executionReport,
|
|
@@ -5513,14 +5528,24 @@
|
|
|
5513
5528
|
if (!(!currentTemplate && resolving_1.length === 0)) return [3 /*break*/, 1];
|
|
5514
5529
|
throw new UnexpectedError(
|
|
5515
5530
|
// TODO: [π] DRY
|
|
5516
|
-
spaceTrim.spaceTrim(function (block) { return "\n Can not resolve some parameters:\n\n ".concat(block(pipelineIdentification), "\n\n Can not resolve
|
|
5531
|
+
spaceTrim.spaceTrim(function (block) { return "\n Can not resolve some parameters:\n\n ".concat(block(pipelineIdentification), "\n\n **Can not resolve:**\n ").concat(block(unresovedTemplates_1
|
|
5517
5532
|
.map(function (_a) {
|
|
5518
5533
|
var resultingParameterName = _a.resultingParameterName, dependentParameterNames = _a.dependentParameterNames;
|
|
5519
|
-
return "- Parameter {".concat(resultingParameterName, "} which depends on ").concat(dependentParameterNames
|
|
5520
|
-
.map(function (dependentParameterName) { return "{".concat(dependentParameterName, "}"); })
|
|
5534
|
+
return "- Parameter `{".concat(resultingParameterName, "}` which depends on ").concat(dependentParameterNames
|
|
5535
|
+
.map(function (dependentParameterName) { return "`{".concat(dependentParameterName, "}`"); })
|
|
5521
5536
|
.join(' and '));
|
|
5522
5537
|
})
|
|
5523
|
-
.join('\n')), "\n\n Resolved
|
|
5538
|
+
.join('\n')), "\n\n **Resolved:**\n ").concat(block(resovedParameterNames_1
|
|
5539
|
+
.filter(function (name) {
|
|
5540
|
+
return !RESERVED_PARAMETER_NAMES.includes(name);
|
|
5541
|
+
})
|
|
5542
|
+
.map(function (name) { return "- Parameter `{".concat(name, "}`"); })
|
|
5543
|
+
.join('\n')), "\n\n **Reserved (which are available):**\n ").concat(block(resovedParameterNames_1
|
|
5544
|
+
.filter(function (name) {
|
|
5545
|
+
return RESERVED_PARAMETER_NAMES.includes(name);
|
|
5546
|
+
})
|
|
5547
|
+
.map(function (name) { return "- Parameter `{".concat(name, "}`"); })
|
|
5548
|
+
.join('\n')), "\n\n *Note: This should be catched in `validatePipeline`*\n "); }));
|
|
5524
5549
|
case 1:
|
|
5525
5550
|
if (!!currentTemplate) return [3 /*break*/, 3];
|
|
5526
5551
|
/* [π€ΉββοΈ] */ return [4 /*yield*/, Promise.race(resolving_1)];
|