@promptbook/markitdown 0.103.0-55 → 0.103.0-66
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 +91 -39
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +2 -2
- package/esm/typings/src/_packages/core.index.d.ts +6 -8
- package/esm/typings/src/_packages/types.index.d.ts +7 -1
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -1
- package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +3 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +5 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +52 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +14 -0
- package/esm/typings/src/book-components/icons/SendIcon.d.ts +3 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.d.ts +4 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.test.d.ts +4 -0
- package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +6 -0
- package/esm/typings/src/commitments/META_FONT/META_FONT.d.ts +42 -0
- package/esm/typings/src/commitments/USE/USE.d.ts +53 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +42 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +1 -0
- package/esm/typings/src/commitments/{IMPORTANT/IMPORTANT.d.ts → USE_MCP/USE_MCP.d.ts} +16 -5
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +38 -0
- package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +6 -0
- package/esm/typings/src/commitments/index.d.ts +93 -1
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +3 -1
- package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +1 -1
- package/esm/typings/src/playground/playground.d.ts +3 -0
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/esm/typings/src/utils/color/Color.d.ts +9 -1
- package/esm/typings/src/utils/color/css-colors.d.ts +1 -0
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +6 -0
- package/esm/typings/src/utils/random/CzechNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/EnglishNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/NamePool.d.ts +17 -0
- package/esm/typings/src/utils/random/getNamePool.d.ts +10 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +3 -3
- package/umd/index.umd.js +116 -64
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgent.d.ts +0 -29
- package/esm/typings/src/commitments/registry.d.ts +0 -68
- package/esm/typings/src/playground/playground1.d.ts +0 -2
package/esm/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mkdir, rm, readFile } from 'fs/promises';
|
|
2
|
-
import spaceTrim, { spaceTrim as spaceTrim$1 } from 'spacetrim';
|
|
2
|
+
import spaceTrim$2, { spaceTrim as spaceTrim$1 } from 'spacetrim';
|
|
3
3
|
import { SHA256 } from 'crypto-js';
|
|
4
4
|
import hexEncoder from 'crypto-js/enc-hex';
|
|
5
5
|
import { basename, join, dirname, isAbsolute } from 'path';
|
|
@@ -24,7 +24,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
24
24
|
* @generated
|
|
25
25
|
* @see https://github.com/webgptorg/promptbook
|
|
26
26
|
*/
|
|
27
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
27
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-66';
|
|
28
28
|
/**
|
|
29
29
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
30
30
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -47,6 +47,17 @@ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-55';
|
|
|
47
47
|
function keepUnused(...valuesToKeep) {
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Trims string from all 4 sides
|
|
52
|
+
*
|
|
53
|
+
* Note: This is a re-exported function from the `spacetrim` package which is
|
|
54
|
+
* Developed by same author @hejny as this package
|
|
55
|
+
*
|
|
56
|
+
* @public exported from `@promptbook/utils`
|
|
57
|
+
* @see https://github.com/hejny/spacetrim#usage
|
|
58
|
+
*/
|
|
59
|
+
const spaceTrim = spaceTrim$1;
|
|
60
|
+
|
|
50
61
|
/**
|
|
51
62
|
* @private util of `@promptbook/color`
|
|
52
63
|
* @de
|
|
@@ -95,6 +106,7 @@ function take(initialValue) {
|
|
|
95
106
|
* @public exported from `@promptbook/color`
|
|
96
107
|
*/
|
|
97
108
|
const CSS_COLORS = {
|
|
109
|
+
promptbook: '#79EAFD',
|
|
98
110
|
transparent: 'rgba(0,0,0,0)',
|
|
99
111
|
aliceblue: '#f0f8ff',
|
|
100
112
|
antiquewhite: '#faebd7',
|
|
@@ -295,21 +307,61 @@ class Color {
|
|
|
295
307
|
* @param color
|
|
296
308
|
* @returns Color object
|
|
297
309
|
*/
|
|
298
|
-
static from(color) {
|
|
299
|
-
if (color
|
|
310
|
+
static from(color, _isSingleValue = false) {
|
|
311
|
+
if (color === '') {
|
|
312
|
+
throw new Error(`Can not create color from empty string`);
|
|
313
|
+
}
|
|
314
|
+
else if (color instanceof Color) {
|
|
300
315
|
return take(color);
|
|
301
316
|
}
|
|
302
317
|
else if (Color.isColor(color)) {
|
|
303
318
|
return take(color);
|
|
304
319
|
}
|
|
305
320
|
else if (typeof color === 'string') {
|
|
306
|
-
|
|
321
|
+
try {
|
|
322
|
+
return Color.fromString(color);
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
// <- Note: Can not use `assertsError(error)` here because it causes circular dependency
|
|
326
|
+
if (_isSingleValue) {
|
|
327
|
+
throw error;
|
|
328
|
+
}
|
|
329
|
+
const parts = color.split(/[\s+,;|]/);
|
|
330
|
+
if (parts.length > 0) {
|
|
331
|
+
return Color.from(parts[0].trim(), true);
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
throw new Error(`Can not create color from given string "${color}"`);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
307
337
|
}
|
|
308
338
|
else {
|
|
309
339
|
console.error({ color });
|
|
310
340
|
throw new Error(`Can not create color from given object`);
|
|
311
341
|
}
|
|
312
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* Creates a new Color instance from miscellaneous formats
|
|
345
|
+
* It just does not throw error when it fails, it returns PROMPTBOOK_COLOR instead
|
|
346
|
+
*
|
|
347
|
+
* @param color
|
|
348
|
+
* @returns Color object
|
|
349
|
+
*/
|
|
350
|
+
static fromSafe(color) {
|
|
351
|
+
try {
|
|
352
|
+
return Color.from(color);
|
|
353
|
+
}
|
|
354
|
+
catch (error) {
|
|
355
|
+
// <- Note: Can not use `assertsError(error)` here because it causes circular dependency
|
|
356
|
+
console.warn(spaceTrim((block) => `
|
|
357
|
+
Color.fromSafe error:
|
|
358
|
+
${block(error.message)}
|
|
359
|
+
|
|
360
|
+
Returning default PROMPTBOOK_COLOR.
|
|
361
|
+
`));
|
|
362
|
+
return Color.fromString('promptbook');
|
|
363
|
+
}
|
|
364
|
+
}
|
|
313
365
|
/**
|
|
314
366
|
* Creates a new Color instance from miscellaneous string formats
|
|
315
367
|
*
|
|
@@ -919,7 +971,7 @@ const ADMIN_GITHUB_NAME = 'hejny';
|
|
|
919
971
|
*
|
|
920
972
|
* @public exported from `@promptbook/core`
|
|
921
973
|
*/
|
|
922
|
-
const PROMPTBOOK_COLOR = Color.
|
|
974
|
+
const PROMPTBOOK_COLOR = Color.fromString('promptbook');
|
|
923
975
|
// <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
924
976
|
/**
|
|
925
977
|
* Colors for syntax highlighting in the `<BookEditor/>`
|
|
@@ -1143,7 +1195,7 @@ class KnowledgeScrapeError extends Error {
|
|
|
1143
1195
|
function getErrorReportUrl(error) {
|
|
1144
1196
|
const report = {
|
|
1145
1197
|
title: `🐜 Error report from ${NAME}`,
|
|
1146
|
-
body: spaceTrim((block) => `
|
|
1198
|
+
body: spaceTrim$2((block) => `
|
|
1147
1199
|
|
|
1148
1200
|
|
|
1149
1201
|
\`${error.name || 'Error'}\` has occurred in the [${NAME}], please look into it @${ADMIN_GITHUB_NAME}.
|
|
@@ -2040,7 +2092,7 @@ function pipelineJsonToString(pipelineJson) {
|
|
|
2040
2092
|
pipelineString += '\n\n';
|
|
2041
2093
|
pipelineString += '```' + contentLanguage;
|
|
2042
2094
|
pipelineString += '\n';
|
|
2043
|
-
pipelineString += spaceTrim(content);
|
|
2095
|
+
pipelineString += spaceTrim$2(content);
|
|
2044
2096
|
// <- TODO: [main] !!3 Escape
|
|
2045
2097
|
// <- TODO: [🧠] Some clear strategy how to spaceTrim the blocks
|
|
2046
2098
|
pipelineString += '\n';
|
|
@@ -2161,7 +2213,7 @@ function checkSerializableAsJson(options) {
|
|
|
2161
2213
|
}
|
|
2162
2214
|
else if (typeof value === 'object') {
|
|
2163
2215
|
if (value instanceof Date) {
|
|
2164
|
-
throw new UnexpectedError(spaceTrim((block) => `
|
|
2216
|
+
throw new UnexpectedError(spaceTrim$2((block) => `
|
|
2165
2217
|
\`${name}\` is Date
|
|
2166
2218
|
|
|
2167
2219
|
Use \`string_date_iso8601\` instead
|
|
@@ -2180,7 +2232,7 @@ function checkSerializableAsJson(options) {
|
|
|
2180
2232
|
throw new UnexpectedError(`${name} is RegExp`);
|
|
2181
2233
|
}
|
|
2182
2234
|
else if (value instanceof Error) {
|
|
2183
|
-
throw new UnexpectedError(spaceTrim((block) => `
|
|
2235
|
+
throw new UnexpectedError(spaceTrim$2((block) => `
|
|
2184
2236
|
\`${name}\` is unserialized Error
|
|
2185
2237
|
|
|
2186
2238
|
Use function \`serializeError\`
|
|
@@ -2203,7 +2255,7 @@ function checkSerializableAsJson(options) {
|
|
|
2203
2255
|
}
|
|
2204
2256
|
catch (error) {
|
|
2205
2257
|
assertsError(error);
|
|
2206
|
-
throw new UnexpectedError(spaceTrim((block) => `
|
|
2258
|
+
throw new UnexpectedError(spaceTrim$2((block) => `
|
|
2207
2259
|
\`${name}\` is not serializable
|
|
2208
2260
|
|
|
2209
2261
|
${block(error.stack || error.message)}
|
|
@@ -2235,7 +2287,7 @@ function checkSerializableAsJson(options) {
|
|
|
2235
2287
|
}
|
|
2236
2288
|
}
|
|
2237
2289
|
else {
|
|
2238
|
-
throw new UnexpectedError(spaceTrim((block) => `
|
|
2290
|
+
throw new UnexpectedError(spaceTrim$2((block) => `
|
|
2239
2291
|
\`${name}\` is unknown type
|
|
2240
2292
|
|
|
2241
2293
|
Additional message for \`${name}\`:
|
|
@@ -3266,7 +3318,7 @@ function serializeError(error) {
|
|
|
3266
3318
|
const { name, message, stack } = error;
|
|
3267
3319
|
const { id } = error;
|
|
3268
3320
|
if (!Object.keys(ALL_ERRORS).includes(name)) {
|
|
3269
|
-
console.error(spaceTrim((block) => `
|
|
3321
|
+
console.error(spaceTrim$2((block) => `
|
|
3270
3322
|
|
|
3271
3323
|
Cannot serialize error with name "${name}"
|
|
3272
3324
|
|
|
@@ -3299,7 +3351,7 @@ function jsonParse(value) {
|
|
|
3299
3351
|
}
|
|
3300
3352
|
else if (typeof value !== 'string') {
|
|
3301
3353
|
console.error('Can not parse JSON from non-string value.', { text: value });
|
|
3302
|
-
throw new Error(spaceTrim(`
|
|
3354
|
+
throw new Error(spaceTrim$2(`
|
|
3303
3355
|
Can not parse JSON from non-string value.
|
|
3304
3356
|
|
|
3305
3357
|
The value type: ${typeof value}
|
|
@@ -3313,7 +3365,7 @@ function jsonParse(value) {
|
|
|
3313
3365
|
if (!(error instanceof Error)) {
|
|
3314
3366
|
throw error;
|
|
3315
3367
|
}
|
|
3316
|
-
throw new Error(spaceTrim((block) => `
|
|
3368
|
+
throw new Error(spaceTrim$2((block) => `
|
|
3317
3369
|
${block(error.message)}
|
|
3318
3370
|
|
|
3319
3371
|
The expected JSON text:
|
|
@@ -3366,7 +3418,7 @@ function deserializeError(error) {
|
|
|
3366
3418
|
message = `${name}: ${message}`;
|
|
3367
3419
|
}
|
|
3368
3420
|
if (stack !== undefined && stack !== '') {
|
|
3369
|
-
message = spaceTrim((block) => `
|
|
3421
|
+
message = spaceTrim$2((block) => `
|
|
3370
3422
|
${block(message)}
|
|
3371
3423
|
|
|
3372
3424
|
Original stack trace:
|
|
@@ -3878,14 +3930,14 @@ class MultipleLlmExecutionTools {
|
|
|
3878
3930
|
if (description === undefined) {
|
|
3879
3931
|
return headLine;
|
|
3880
3932
|
}
|
|
3881
|
-
return spaceTrim((block) => `
|
|
3933
|
+
return spaceTrim$2((block) => `
|
|
3882
3934
|
${headLine}
|
|
3883
3935
|
|
|
3884
3936
|
${ /* <- Note: Indenting the description: */block(description)}
|
|
3885
3937
|
`);
|
|
3886
3938
|
})
|
|
3887
3939
|
.join('\n\n');
|
|
3888
|
-
return spaceTrim((block) => `
|
|
3940
|
+
return spaceTrim$2((block) => `
|
|
3889
3941
|
Multiple LLM Providers:
|
|
3890
3942
|
|
|
3891
3943
|
${block(innerModelsTitlesAndDescriptions)}
|
|
@@ -3976,7 +4028,7 @@ class MultipleLlmExecutionTools {
|
|
|
3976
4028
|
// 1) OpenAI throw PipelineExecutionError: Parameter `{knowledge}` is not defined
|
|
3977
4029
|
// 2) AnthropicClaude throw PipelineExecutionError: Parameter `{knowledge}` is not defined
|
|
3978
4030
|
// 3) ...
|
|
3979
|
-
spaceTrim((block) => `
|
|
4031
|
+
spaceTrim$2((block) => `
|
|
3980
4032
|
All execution tools of ${this.title} failed:
|
|
3981
4033
|
|
|
3982
4034
|
${block(errors
|
|
@@ -3989,7 +4041,7 @@ class MultipleLlmExecutionTools {
|
|
|
3989
4041
|
throw new PipelineExecutionError(`You have not provided any \`LlmExecutionTools\` into ${this.title}`);
|
|
3990
4042
|
}
|
|
3991
4043
|
else {
|
|
3992
|
-
throw new PipelineExecutionError(spaceTrim((block) => `
|
|
4044
|
+
throw new PipelineExecutionError(spaceTrim$2((block) => `
|
|
3993
4045
|
You have not provided any \`LlmExecutionTools\` that support model variant "${prompt.modelRequirements.modelVariant}" into ${this.title}
|
|
3994
4046
|
|
|
3995
4047
|
Available \`LlmExecutionTools\`:
|
|
@@ -4022,7 +4074,7 @@ class MultipleLlmExecutionTools {
|
|
|
4022
4074
|
*/
|
|
4023
4075
|
function joinLlmExecutionTools(title, ...llmExecutionTools) {
|
|
4024
4076
|
if (llmExecutionTools.length === 0) {
|
|
4025
|
-
const warningMessage = spaceTrim(`
|
|
4077
|
+
const warningMessage = spaceTrim$2(`
|
|
4026
4078
|
You have not provided any \`LlmExecutionTools\`
|
|
4027
4079
|
This means that you won't be able to execute any prompts that require large language models like GPT-4 or Anthropic's Claude.
|
|
4028
4080
|
|
|
@@ -4339,14 +4391,14 @@ function $registeredScrapersMessage(availableScrapers) {
|
|
|
4339
4391
|
return { ...metadata, isMetadataAviailable, isInstalled, isAvailableInTools };
|
|
4340
4392
|
});
|
|
4341
4393
|
if (metadata.length === 0) {
|
|
4342
|
-
return spaceTrim(`
|
|
4394
|
+
return spaceTrim$2(`
|
|
4343
4395
|
**No scrapers are available**
|
|
4344
4396
|
|
|
4345
4397
|
This is a unexpected behavior, you are probably using some broken version of Promptbook
|
|
4346
4398
|
At least there should be available the metadata of the scrapers
|
|
4347
4399
|
`);
|
|
4348
4400
|
}
|
|
4349
|
-
return spaceTrim((block) => `
|
|
4401
|
+
return spaceTrim$2((block) => `
|
|
4350
4402
|
Available scrapers are:
|
|
4351
4403
|
${block(metadata
|
|
4352
4404
|
.map(({ packageName, className, isMetadataAviailable, isInstalled, mimeTypes, isAvailableInBrowser, isAvailableInTools, }, i) => {
|
|
@@ -4457,7 +4509,7 @@ const promptbookFetch = async (urlOrRequest, init) => {
|
|
|
4457
4509
|
else if (urlOrRequest instanceof Request) {
|
|
4458
4510
|
url = urlOrRequest.url;
|
|
4459
4511
|
}
|
|
4460
|
-
throw new PromptbookFetchError(spaceTrim((block) => `
|
|
4512
|
+
throw new PromptbookFetchError(spaceTrim$2((block) => `
|
|
4461
4513
|
Can not fetch "${url}"
|
|
4462
4514
|
|
|
4463
4515
|
Fetch error:
|
|
@@ -4618,7 +4670,7 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
4618
4670
|
const fileExtension = getFileExtension(filename);
|
|
4619
4671
|
const mimeType = extensionToMimeType(fileExtension || '');
|
|
4620
4672
|
if (!(await isFileExisting(filename, tools.fs))) {
|
|
4621
|
-
throw new NotFoundError(spaceTrim((block) => `
|
|
4673
|
+
throw new NotFoundError(spaceTrim$2((block) => `
|
|
4622
4674
|
Can not make source handler for file which does not exist:
|
|
4623
4675
|
|
|
4624
4676
|
File:
|
|
@@ -4711,7 +4763,7 @@ async function prepareKnowledgePieces(knowledgeSources, tools, options) {
|
|
|
4711
4763
|
// <- TODO: [🪓] Here should be no need for spreading new array, just `partialPieces = partialPiecesUnchecked`
|
|
4712
4764
|
break;
|
|
4713
4765
|
}
|
|
4714
|
-
console.warn(spaceTrim((block) => `
|
|
4766
|
+
console.warn(spaceTrim$2((block) => `
|
|
4715
4767
|
Cannot scrape knowledge from source despite the scraper \`${scraper.metadata.className}\` supports the mime type "${sourceHandler.mimeType}".
|
|
4716
4768
|
|
|
4717
4769
|
The source:
|
|
@@ -4727,7 +4779,7 @@ async function prepareKnowledgePieces(knowledgeSources, tools, options) {
|
|
|
4727
4779
|
// <- TODO: [🏮] Some standard way how to transform errors into warnings and how to handle non-critical fails during the tasks
|
|
4728
4780
|
}
|
|
4729
4781
|
if (partialPieces === null) {
|
|
4730
|
-
throw new KnowledgeScrapeError(spaceTrim((block) => `
|
|
4782
|
+
throw new KnowledgeScrapeError(spaceTrim$2((block) => `
|
|
4731
4783
|
Cannot scrape knowledge
|
|
4732
4784
|
|
|
4733
4785
|
The source:
|
|
@@ -5302,7 +5354,7 @@ const CsvFormatParser = {
|
|
|
5302
5354
|
const { value, outputParameterName, settings, mapCallback, onProgress } = options;
|
|
5303
5355
|
const csv = csvParse(value, settings);
|
|
5304
5356
|
if (csv.errors.length !== 0) {
|
|
5305
|
-
throw new CsvFormatError(spaceTrim((block) => `
|
|
5357
|
+
throw new CsvFormatError(spaceTrim$2((block) => `
|
|
5306
5358
|
CSV parsing error
|
|
5307
5359
|
|
|
5308
5360
|
Error(s) from CSV parsing:
|
|
@@ -5347,7 +5399,7 @@ const CsvFormatParser = {
|
|
|
5347
5399
|
const { value, settings, mapCallback, onProgress } = options;
|
|
5348
5400
|
const csv = csvParse(value, settings);
|
|
5349
5401
|
if (csv.errors.length !== 0) {
|
|
5350
|
-
throw new CsvFormatError(spaceTrim((block) => `
|
|
5402
|
+
throw new CsvFormatError(spaceTrim$2((block) => `
|
|
5351
5403
|
CSV parsing error
|
|
5352
5404
|
|
|
5353
5405
|
Error(s) from CSV parsing:
|
|
@@ -5557,7 +5609,7 @@ function mapAvailableToExpectedParameters(options) {
|
|
|
5557
5609
|
}
|
|
5558
5610
|
// Phase 2️⃣: Non-matching mapping
|
|
5559
5611
|
if (expectedParameterNames.size !== availableParametersNames.size) {
|
|
5560
|
-
throw new PipelineExecutionError(spaceTrim((block) => `
|
|
5612
|
+
throw new PipelineExecutionError(spaceTrim$2((block) => `
|
|
5561
5613
|
Can not map available parameters to expected parameters
|
|
5562
5614
|
|
|
5563
5615
|
Mapped parameters:
|
|
@@ -6342,7 +6394,7 @@ async function executeFormatSubvalues(options) {
|
|
|
6342
6394
|
return /* not await */ executeAttempts({ ...options, logLlmCall });
|
|
6343
6395
|
}
|
|
6344
6396
|
if (jokerParameterNames.length !== 0) {
|
|
6345
|
-
throw new UnexpectedError(spaceTrim((block) => `
|
|
6397
|
+
throw new UnexpectedError(spaceTrim$2((block) => `
|
|
6346
6398
|
JOKER parameters are not supported together with FOREACH command
|
|
6347
6399
|
|
|
6348
6400
|
[🧞♀️] This should be prevented in \`validatePipeline\`
|
|
@@ -6355,7 +6407,7 @@ async function executeFormatSubvalues(options) {
|
|
|
6355
6407
|
if (formatDefinition === undefined) {
|
|
6356
6408
|
throw new UnexpectedError(
|
|
6357
6409
|
// <- TODO: [🧠][🧐] Should be formats fixed per promptbook version or behave as plugins (=> change UnexpectedError)
|
|
6358
|
-
spaceTrim((block) => `
|
|
6410
|
+
spaceTrim$2((block) => `
|
|
6359
6411
|
Unsupported format "${task.foreach.formatName}"
|
|
6360
6412
|
|
|
6361
6413
|
Available formats:
|
|
@@ -6372,7 +6424,7 @@ async function executeFormatSubvalues(options) {
|
|
|
6372
6424
|
if (subvalueParser === undefined) {
|
|
6373
6425
|
throw new UnexpectedError(
|
|
6374
6426
|
// <- TODO: [🧠][🧐] Should be formats fixed per promptbook version or behave as plugins (=> change UnexpectedError)
|
|
6375
|
-
spaceTrim((block) => `
|
|
6427
|
+
spaceTrim$2((block) => `
|
|
6376
6428
|
Unsupported subformat name "${task.foreach.subformatName}" for format "${task.foreach.formatName}"
|
|
6377
6429
|
|
|
6378
6430
|
Available subformat names for format "${formatDefinition.formatName}":
|
|
@@ -6412,7 +6464,7 @@ async function executeFormatSubvalues(options) {
|
|
|
6412
6464
|
if (!(error instanceof PipelineExecutionError)) {
|
|
6413
6465
|
throw error;
|
|
6414
6466
|
}
|
|
6415
|
-
const highLevelError = new PipelineExecutionError(spaceTrim((block) => `
|
|
6467
|
+
const highLevelError = new PipelineExecutionError(spaceTrim$2((block) => `
|
|
6416
6468
|
${error.message}
|
|
6417
6469
|
|
|
6418
6470
|
This is error in FOREACH command when mapping ${formatDefinition.formatName} ${subvalueParser.subvalueName} data (${index + 1}/${length})
|
|
@@ -6436,7 +6488,7 @@ async function executeFormatSubvalues(options) {
|
|
|
6436
6488
|
...options,
|
|
6437
6489
|
priority: priority + index,
|
|
6438
6490
|
parameters: allSubparameters,
|
|
6439
|
-
pipelineIdentification: spaceTrim((block) => `
|
|
6491
|
+
pipelineIdentification: spaceTrim$2((block) => `
|
|
6440
6492
|
${block(pipelineIdentification)}
|
|
6441
6493
|
Subparameter index: ${index}
|
|
6442
6494
|
`),
|
|
@@ -6445,7 +6497,7 @@ async function executeFormatSubvalues(options) {
|
|
|
6445
6497
|
}
|
|
6446
6498
|
catch (error) {
|
|
6447
6499
|
if (length > BIG_DATASET_TRESHOLD) {
|
|
6448
|
-
console.error(spaceTrim((block) => `
|
|
6500
|
+
console.error(spaceTrim$2((block) => `
|
|
6449
6501
|
${error.message}
|
|
6450
6502
|
|
|
6451
6503
|
This is error in FOREACH command when processing ${formatDefinition.formatName} ${subvalueParser.subvalueName} data (${index + 1}/${length})
|
|
@@ -7317,8 +7369,8 @@ class MarkdownScraper {
|
|
|
7317
7369
|
knowledgeTextPieces.map(async (knowledgeTextPiece, i) => {
|
|
7318
7370
|
// Note: These are just default values, they will be overwritten by the actual values:
|
|
7319
7371
|
let name = `piece-${i}`;
|
|
7320
|
-
let title = spaceTrim(knowledgeTextPiece.substring(0, 100));
|
|
7321
|
-
const knowledgePieceContent = spaceTrim(knowledgeTextPiece);
|
|
7372
|
+
let title = spaceTrim$2(knowledgeTextPiece.substring(0, 100));
|
|
7373
|
+
const knowledgePieceContent = spaceTrim$2(knowledgeTextPiece);
|
|
7322
7374
|
let keywords = [];
|
|
7323
7375
|
const index = [];
|
|
7324
7376
|
/*
|
|
@@ -7331,7 +7383,7 @@ class MarkdownScraper {
|
|
|
7331
7383
|
isCrashedOnError: true,
|
|
7332
7384
|
});
|
|
7333
7385
|
const { title: titleRaw = 'Untitled' } = titleResult.outputParameters;
|
|
7334
|
-
title = spaceTrim(titleRaw) /* <- TODO: Maybe do in pipeline */;
|
|
7386
|
+
title = spaceTrim$2(titleRaw) /* <- TODO: Maybe do in pipeline */;
|
|
7335
7387
|
name = titleToName(title);
|
|
7336
7388
|
// --- Keywords
|
|
7337
7389
|
const keywordsResult = await prepareKeywordsExecutor({ knowledgePieceContent }).asPromise({
|