@promptbook/types 0.59.0 → 0.60.0-3
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/README.md +5 -5
- package/esm/index.es.js +1 -1
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +23 -23
- package/esm/typings/src/_packages/node.index.d.ts +2 -2
- package/esm/typings/src/_packages/types.index.d.ts +11 -11
- package/esm/typings/src/_packages/utils.index.d.ts +9 -11
- package/esm/typings/src/config.d.ts +1 -1
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +12 -0
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +32 -0
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +23 -0
- package/esm/typings/src/conversion/prettify/PrettifyOptions.d.ts +1 -1
- package/{umd/typings/src/conversion/prettify/prettifyPromptbookString.d.ts → esm/typings/src/conversion/prettify/prettifyPipelineString.d.ts} +2 -2
- package/esm/typings/src/conversion/prettify/{renderPromptbookMermaid.d.ts → renderPipelineMermaidOptions.d.ts} +4 -4
- package/esm/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
- package/esm/typings/src/conversion/utils/extractVariables.d.ts +1 -1
- package/esm/typings/src/conversion/utils/parseCommand.d.ts +2 -2
- package/esm/typings/src/conversion/utils/parseNumber.d.ts +1 -1
- package/esm/typings/src/conversion/utils/renameParameter.d.ts +4 -4
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +13 -0
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +27 -0
- package/{umd/typings/src/errors/PromptbookLibraryError.d.ts → esm/typings/src/errors/CollectionError.d.ts} +2 -2
- package/esm/typings/src/errors/{PromptbookExecutionError.d.ts → ExecutionError.d.ts} +2 -2
- package/{umd/typings/src/errors/PromptbookNotFoundError.d.ts → esm/typings/src/errors/NotFoundError.d.ts} +2 -2
- package/{umd/typings/src/errors/PromptbookLogicError.d.ts → esm/typings/src/errors/PipelineLogicError.d.ts} +2 -2
- package/{umd/typings/src/errors/PromptbookReferenceError.d.ts → esm/typings/src/errors/ReferenceError.d.ts} +2 -2
- package/esm/typings/src/errors/{PromptbookSyntaxError.d.ts → SyntaxError.d.ts} +2 -2
- package/esm/typings/src/errors/TemplateError.d.ts +1 -1
- package/esm/typings/src/errors/_ExpectError.d.ts +2 -2
- package/esm/typings/src/execution/ExecutionTools.d.ts +1 -1
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +4 -4
- package/esm/typings/src/execution/PromptResult.d.ts +1 -1
- package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -1
- package/esm/typings/src/execution/createPromptbookExecutor.d.ts +3 -3
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +1 -1
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
- package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +1 -1
- package/esm/typings/src/library/PipelineCollection.d.ts +25 -0
- package/esm/typings/src/library/{SimplePromptbookLibrary.d.ts → SimplePipelineCollection.d.ts} +11 -11
- package/{umd/typings/src/library/constructors/createLibraryFromDirectory.d.ts → esm/typings/src/library/constructors/createCollectionFromDirectory.d.ts} +5 -5
- package/esm/typings/src/library/constructors/createCollectionFromJson.d.ts +12 -0
- package/esm/typings/src/library/constructors/createCollectionFromPromise.d.ts +22 -0
- package/esm/typings/src/library/constructors/{createLibraryFromUrl.d.ts → createCollectionFromUrl.d.ts} +5 -5
- package/esm/typings/src/library/constructors/createSubcollection.d.ts +12 -0
- package/esm/typings/src/library/libraryToJson.d.ts +5 -5
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -2
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +1 -1
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/computeUsage.d.ts +2 -2
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +2 -2
- package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -1
- package/esm/typings/src/types/Command.d.ts +4 -4
- package/esm/typings/src/types/Parameters.d.ts +1 -1
- package/esm/typings/src/types/{PromptbookJson/PromptbookJson.d.ts → PipelineJson/PipelineJson.d.ts} +4 -4
- package/{umd/typings/src/types/PromptbookString.d.ts → esm/typings/src/types/PipelineString.d.ts} +3 -3
- package/esm/typings/src/types/Prompt.d.ts +3 -3
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +2 -2
- package/esm/typings/src/types/execution-report/countWorkingDuration.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +2 -2
- package/esm/typings/src/utils/emojis.d.ts +2 -2
- package/esm/typings/src/utils/expectation-counters/countCharacters.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countLines.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countPages.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countParagraphs.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countWords.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/index.d.ts +2 -2
- package/esm/typings/src/utils/formatNumber.d.ts +1 -1
- package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +1 -1
- package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +1 -1
- package/esm/typings/src/utils/markdown/createMarkdownTable.d.ts +1 -1
- package/esm/typings/src/utils/markdown-json/MarkdownStructure.d.ts +1 -1
- package/esm/typings/src/utils/markdown-json/countMarkdownStructureDeepness.d.ts +1 -1
- package/esm/typings/src/utils/markdown-json/markdownToMarkdownStructure.d.ts +1 -1
- package/package.json +3 -3
- package/umd/index.umd.js +1 -1
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/src/_packages/core.index.d.ts +23 -23
- package/umd/typings/src/_packages/node.index.d.ts +2 -2
- package/umd/typings/src/_packages/types.index.d.ts +11 -11
- package/umd/typings/src/_packages/utils.index.d.ts +9 -11
- package/umd/typings/src/config.d.ts +1 -1
- package/umd/typings/src/conversion/pipelineJsonToString.d.ts +12 -0
- package/umd/typings/src/conversion/pipelineStringToJson.d.ts +32 -0
- package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +23 -0
- package/umd/typings/src/conversion/prettify/PrettifyOptions.d.ts +1 -1
- package/{esm/typings/src/conversion/prettify/prettifyPromptbookString.d.ts → umd/typings/src/conversion/prettify/prettifyPipelineString.d.ts} +2 -2
- package/umd/typings/src/conversion/prettify/{renderPromptbookMermaid.d.ts → renderPipelineMermaidOptions.d.ts} +4 -4
- package/umd/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
- package/umd/typings/src/conversion/utils/extractVariables.d.ts +1 -1
- package/umd/typings/src/conversion/utils/parseCommand.d.ts +2 -2
- package/umd/typings/src/conversion/utils/parseNumber.d.ts +1 -1
- package/umd/typings/src/conversion/utils/renameParameter.d.ts +4 -4
- package/umd/typings/src/conversion/validation/_importPipeline.d.ts +13 -0
- package/umd/typings/src/conversion/validation/validatePipeline.d.ts +27 -0
- package/{esm/typings/src/errors/PromptbookLibraryError.d.ts → umd/typings/src/errors/CollectionError.d.ts} +2 -2
- package/umd/typings/src/errors/{PromptbookExecutionError.d.ts → ExecutionError.d.ts} +2 -2
- package/{esm/typings/src/errors/PromptbookNotFoundError.d.ts → umd/typings/src/errors/NotFoundError.d.ts} +2 -2
- package/{esm/typings/src/errors/PromptbookLogicError.d.ts → umd/typings/src/errors/PipelineLogicError.d.ts} +2 -2
- package/{esm/typings/src/errors/PromptbookReferenceError.d.ts → umd/typings/src/errors/ReferenceError.d.ts} +2 -2
- package/umd/typings/src/errors/{PromptbookSyntaxError.d.ts → SyntaxError.d.ts} +2 -2
- package/umd/typings/src/errors/TemplateError.d.ts +1 -1
- package/umd/typings/src/errors/_ExpectError.d.ts +2 -2
- package/umd/typings/src/execution/ExecutionTools.d.ts +1 -1
- package/umd/typings/src/execution/LlmExecutionTools.d.ts +4 -4
- package/umd/typings/src/execution/PromptResult.d.ts +1 -1
- package/umd/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -1
- package/umd/typings/src/execution/createPromptbookExecutor.d.ts +3 -3
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
- package/umd/typings/src/execution/utils/checkExpectations.d.ts +1 -1
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
- package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +1 -1
- package/umd/typings/src/library/PipelineCollection.d.ts +25 -0
- package/umd/typings/src/library/{SimplePromptbookLibrary.d.ts → SimplePipelineCollection.d.ts} +11 -11
- package/{esm/typings/src/library/constructors/createLibraryFromDirectory.d.ts → umd/typings/src/library/constructors/createCollectionFromDirectory.d.ts} +5 -5
- package/umd/typings/src/library/constructors/createCollectionFromJson.d.ts +12 -0
- package/umd/typings/src/library/constructors/createCollectionFromPromise.d.ts +22 -0
- package/umd/typings/src/library/constructors/{createLibraryFromUrl.d.ts → createCollectionFromUrl.d.ts} +5 -5
- package/umd/typings/src/library/constructors/createSubcollection.d.ts +12 -0
- package/umd/typings/src/library/libraryToJson.d.ts +5 -5
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -3
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +3 -3
- package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -2
- package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +3 -3
- package/umd/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +1 -1
- package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +3 -3
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +3 -3
- package/umd/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
- package/umd/typings/src/llm-providers/openai/computeUsage.d.ts +2 -2
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +3 -3
- package/umd/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +2 -2
- package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -1
- package/umd/typings/src/types/Command.d.ts +4 -4
- package/umd/typings/src/types/Parameters.d.ts +1 -1
- package/umd/typings/src/types/{PromptbookJson/PromptbookJson.d.ts → PipelineJson/PipelineJson.d.ts} +4 -4
- package/{esm/typings/src/types/PromptbookString.d.ts → umd/typings/src/types/PipelineString.d.ts} +3 -3
- package/umd/typings/src/types/Prompt.d.ts +3 -3
- package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +2 -2
- package/umd/typings/src/types/execution-report/countWorkingDuration.d.ts +1 -1
- package/umd/typings/src/types/typeAliases.d.ts +2 -2
- package/umd/typings/src/utils/emojis.d.ts +2 -2
- package/umd/typings/src/utils/expectation-counters/countCharacters.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countLines.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countPages.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countParagraphs.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countWords.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/index.d.ts +2 -2
- package/umd/typings/src/utils/formatNumber.d.ts +1 -1
- package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +1 -1
- package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +1 -1
- package/umd/typings/src/utils/markdown/createMarkdownTable.d.ts +1 -1
- package/umd/typings/src/utils/markdown-json/MarkdownStructure.d.ts +1 -1
- package/umd/typings/src/utils/markdown-json/countMarkdownStructureDeepness.d.ts +1 -1
- package/umd/typings/src/utils/markdown-json/markdownToMarkdownStructure.d.ts +1 -1
- package/esm/typings/src/conversion/promptbookJsonToString.d.ts +0 -12
- package/esm/typings/src/conversion/promptbookStringToJson.d.ts +0 -32
- package/esm/typings/src/conversion/promptbookStringToJsonSync.d.ts +0 -23
- package/esm/typings/src/conversion/validation/_importPromptbook.d.ts +0 -13
- package/esm/typings/src/conversion/validation/validatePromptbook.d.ts +0 -27
- package/esm/typings/src/library/PromptbookLibrary.d.ts +0 -25
- package/esm/typings/src/library/constructors/createLibraryFromJson.d.ts +0 -12
- package/esm/typings/src/library/constructors/createLibraryFromPromise.d.ts +0 -22
- package/esm/typings/src/library/constructors/createSublibrary.d.ts +0 -12
- package/umd/typings/src/conversion/promptbookJsonToString.d.ts +0 -12
- package/umd/typings/src/conversion/promptbookStringToJson.d.ts +0 -32
- package/umd/typings/src/conversion/promptbookStringToJsonSync.d.ts +0 -23
- package/umd/typings/src/conversion/validation/_importPromptbook.d.ts +0 -13
- package/umd/typings/src/conversion/validation/validatePromptbook.d.ts +0 -27
- package/umd/typings/src/library/PromptbookLibrary.d.ts +0 -25
- package/umd/typings/src/library/constructors/createLibraryFromJson.d.ts +0 -12
- package/umd/typings/src/library/constructors/createLibraryFromPromise.d.ts +0 -22
- package/umd/typings/src/library/constructors/createSublibrary.d.ts +0 -12
- /package/esm/typings/{promptbook-library → promptbook-collection}/index.d.ts +0 -0
- /package/esm/typings/src/conversion/{promptbookStringToJson.test.d.ts → pipelineStringToJson.test.d.ts} +0 -0
- /package/esm/typings/src/conversion/{promptbookStringToJsonSync.test.d.ts → pipelineStringToJsonSync.test.d.ts} +0 -0
- /package/esm/typings/src/conversion/validation/{promptbookStringToJson-syntaxErrors.test.d.ts → pipelineStringToJson-syntaxErrors.test.d.ts} +0 -0
- /package/esm/typings/src/conversion/validation/{validatePromptbook-logicErrors.test.d.ts → validatePipeline-logicErrors.test.d.ts} +0 -0
- /package/esm/typings/src/conversion/validation/{validatePromptbook.test.d.ts → validatePipeline.test.d.ts} +0 -0
- /package/esm/typings/src/library/constructors/{createLibraryFromDirectory.test.d.ts → createCollectionFromDirectory.test.d.ts} +0 -0
- /package/esm/typings/src/library/constructors/{createLibraryFromJson.test.d.ts → createCollectionFromJson.test.d.ts} +0 -0
- /package/esm/typings/src/library/constructors/{createLibraryFromPromise.test.d.ts → createCollectionFromPromise.test.d.ts} +0 -0
- /package/esm/typings/src/types/{PromptbookJson → PipelineJson}/KnowledgeJson.d.ts +0 -0
- /package/esm/typings/src/types/{PromptbookJson → PipelineJson}/MaterialKnowledgePieceJson.d.ts +0 -0
- /package/esm/typings/src/types/{PromptbookJson → PipelineJson}/PromptTemplateJson.d.ts +0 -0
- /package/esm/typings/src/types/{PromptbookJson → PipelineJson}/PromptTemplateParameterJson.d.ts +0 -0
- /package/umd/typings/{promptbook-library → promptbook-collection}/index.d.ts +0 -0
- /package/umd/typings/src/conversion/{promptbookStringToJson.test.d.ts → pipelineStringToJson.test.d.ts} +0 -0
- /package/umd/typings/src/conversion/{promptbookStringToJsonSync.test.d.ts → pipelineStringToJsonSync.test.d.ts} +0 -0
- /package/umd/typings/src/conversion/validation/{promptbookStringToJson-syntaxErrors.test.d.ts → pipelineStringToJson-syntaxErrors.test.d.ts} +0 -0
- /package/umd/typings/src/conversion/validation/{validatePromptbook-logicErrors.test.d.ts → validatePipeline-logicErrors.test.d.ts} +0 -0
- /package/umd/typings/src/conversion/validation/{validatePromptbook.test.d.ts → validatePipeline.test.d.ts} +0 -0
- /package/umd/typings/src/library/constructors/{createLibraryFromDirectory.test.d.ts → createCollectionFromDirectory.test.d.ts} +0 -0
- /package/umd/typings/src/library/constructors/{createLibraryFromJson.test.d.ts → createCollectionFromJson.test.d.ts} +0 -0
- /package/umd/typings/src/library/constructors/{createLibraryFromPromise.test.d.ts → createCollectionFromPromise.test.d.ts} +0 -0
- /package/umd/typings/src/types/{PromptbookJson → PipelineJson}/KnowledgeJson.d.ts +0 -0
- /package/umd/typings/src/types/{PromptbookJson → PipelineJson}/MaterialKnowledgePieceJson.d.ts +0 -0
- /package/umd/typings/src/types/{PromptbookJson → PipelineJson}/PromptTemplateJson.d.ts +0 -0
- /package/umd/typings/src/types/{PromptbookJson → PipelineJson}/PromptTemplateParameterJson.d.ts +0 -0
|
@@ -5,7 +5,7 @@ import type { string_char_emoji } from '../types/typeAliasEmoji';
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://getemoji.com/
|
|
7
7
|
*
|
|
8
|
-
* @private within the
|
|
8
|
+
* @private within the package
|
|
9
9
|
* @deprecated Use /\p{Extended_Pictographic}/ instead
|
|
10
10
|
*/
|
|
11
11
|
export declare const EMOJIS_IN_CATEGORIES: Record<string, Array<string_char_emoji>>;
|
|
@@ -13,7 +13,7 @@ export declare const EMOJIS_IN_CATEGORIES: Record<string, Array<string_char_emoj
|
|
|
13
13
|
*
|
|
14
14
|
* All possible emoji chars like "🍆", "🍡", "🍤"...
|
|
15
15
|
*
|
|
16
|
-
* @private within the
|
|
16
|
+
* @private within the package
|
|
17
17
|
* @deprecated Use /\p{Extended_Pictographic}/ instead
|
|
18
18
|
*/
|
|
19
19
|
export declare const EMOJIS: Set<string_char_emoji>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ExpectationAmount } from '../../types/
|
|
2
|
-
import type { ExpectationUnit } from '../../types/
|
|
1
|
+
import type { ExpectationAmount } from '../../types/PipelineJson/PromptTemplateJson';
|
|
2
|
+
import type { ExpectationUnit } from '../../types/PipelineJson/PromptTemplateJson';
|
|
3
3
|
/**
|
|
4
4
|
* Index of all counter functions
|
|
5
5
|
*/
|
|
@@ -3,7 +3,7 @@ import type { string_name } from '../../types/typeAliases';
|
|
|
3
3
|
/**
|
|
4
4
|
* Add or modify an auto-generated section in a markdown file
|
|
5
5
|
*
|
|
6
|
-
* @private within the
|
|
6
|
+
* @private within the package
|
|
7
7
|
*/
|
|
8
8
|
export declare function addAutoGeneratedSection(content: string_markdown, options: {
|
|
9
9
|
sectionName: string_name;
|
|
@@ -31,7 +31,7 @@ type CreateMarkdownChartOptions = {
|
|
|
31
31
|
/**
|
|
32
32
|
* Function createMarkdownChart will draw a chart in markdown from ⬛+🟦 tiles
|
|
33
33
|
*
|
|
34
|
-
* @private within the
|
|
34
|
+
* @private within the package
|
|
35
35
|
*/
|
|
36
36
|
export declare function createMarkdownChart(options: CreateMarkdownChartOptions): string_markdown;
|
|
37
37
|
export {};
|
|
@@ -3,6 +3,6 @@ import type { string_markdown_text } from '../../types/typeAliases';
|
|
|
3
3
|
/**
|
|
4
4
|
* Create a markdown table from a 2D array of strings
|
|
5
5
|
*
|
|
6
|
-
* @private within the
|
|
6
|
+
* @private within the package
|
|
7
7
|
*/
|
|
8
8
|
export declare function createMarkdownTable(table: Array<Array<string_markdown_text>>): string_markdown;
|
|
@@ -2,6 +2,6 @@ import type { MarkdownStructure } from './MarkdownStructure';
|
|
|
2
2
|
/**
|
|
3
3
|
* Computes the deepness of the markdown structure.
|
|
4
4
|
*
|
|
5
|
-
* @private within the
|
|
5
|
+
* @private within the package
|
|
6
6
|
*/
|
|
7
7
|
export declare function countMarkdownStructureDeepness(markdownStructure: MarkdownStructure): number;
|
|
@@ -8,6 +8,6 @@ import type { MarkdownStructure } from './MarkdownStructure';
|
|
|
8
8
|
* @param markdown The markdown string to parse.
|
|
9
9
|
* @returns The MarkdownStructure object.
|
|
10
10
|
*
|
|
11
|
-
* @private within the
|
|
11
|
+
* @private within the package
|
|
12
12
|
*/
|
|
13
13
|
export declare function markdownToMarkdownStructure(markdown: string): MarkdownStructure;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/types",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.60.0-3",
|
|
4
|
+
"description": "Supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"repository": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@promptbook/core": "0.
|
|
48
|
+
"@promptbook/core": "0.60.0-3"
|
|
49
49
|
},
|
|
50
50
|
"main": "./umd/index.umd.js",
|
|
51
51
|
"module": "./esm/index.es.js",
|
package/umd/index.umd.js
CHANGED
package/umd/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../../../../src/types/
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../../../../src/types/PipelineJson/PromptTemplateJson.ts","../../../../src/version.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;;;;;CA2CA;;;KAGa,iBAAiB,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAW;CAmH/G;;;;;;CC/JA;;;KAGa,kBAAkB,GAAmB;;;;;;;;;;;"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { PromptbookSyntaxError } from '../errors/PromptbookSyntaxError';
|
|
1
|
+
import { pipelineJsonToString } from '../conversion/pipelineJsonToString';
|
|
2
|
+
import { pipelineStringToJson } from '../conversion/pipelineStringToJson';
|
|
3
|
+
import { pipelineStringToJsonSync } from '../conversion/pipelineStringToJsonSync';
|
|
4
|
+
import { prettifyPipelineString } from '../conversion/prettify/prettifyPipelineString';
|
|
5
|
+
import { validatePipeline } from '../conversion/validation/validatePipeline';
|
|
6
|
+
import { CollectionError } from '../errors/CollectionError';
|
|
7
|
+
import { ExecutionError } from '../errors/ExecutionError';
|
|
8
|
+
import { NotFoundError } from '../errors/NotFoundError';
|
|
9
|
+
import { PipelineLogicError } from '../errors/PipelineLogicError';
|
|
10
|
+
import { ReferenceError } from '../errors/ReferenceError';
|
|
11
|
+
import { SyntaxError } from '../errors/SyntaxError';
|
|
13
12
|
import { TemplateError } from '../errors/TemplateError';
|
|
14
13
|
import { UnexpectedError } from '../errors/UnexpectedError';
|
|
14
|
+
import { ExpectError } from '../errors/_ExpectError';
|
|
15
15
|
import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
|
|
16
16
|
import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
|
|
17
17
|
import { embeddingVectorToString } from '../execution/embeddingVectorToString';
|
|
@@ -22,23 +22,23 @@ import { CallbackInterfaceTools } from '../knowledge/dialogs/callback/CallbackIn
|
|
|
22
22
|
import type { CallbackInterfaceToolsOptions } from '../knowledge/dialogs/callback/CallbackInterfaceToolsOptions';
|
|
23
23
|
import { SimplePromptInterfaceTools } from '../knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools';
|
|
24
24
|
import { prepareKnowledgeFromMarkdown } from '../knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
25
|
+
import { createCollectionFromJson } from '../library/constructors/createCollectionFromJson';
|
|
26
|
+
import { createCollectionFromPromise } from '../library/constructors/createCollectionFromPromise';
|
|
27
|
+
import { createCollectionFromUrl } from '../library/constructors/createCollectionFromUrl';
|
|
28
|
+
import { createSubcollection } from '../library/constructors/createSubcollection';
|
|
29
29
|
import { libraryToJson } from '../library/libraryToJson';
|
|
30
30
|
import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools';
|
|
31
|
-
import {
|
|
31
|
+
import { ExecutionTypes } from '../types/ExecutionTypes';
|
|
32
32
|
import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';
|
|
33
33
|
import { ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
34
|
-
import {
|
|
34
|
+
import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
|
|
35
35
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
36
36
|
export { PROMPTBOOK_VERSION };
|
|
37
37
|
export { ExecutionTypes };
|
|
38
|
-
export { addUsage, assertsExecutionSuccessful, checkExpectations, embeddingVectorToString, executionReportJsonToString,
|
|
39
|
-
export {
|
|
38
|
+
export { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, addUsage, assertsExecutionSuccessful, checkExpectations, embeddingVectorToString, executionReportJsonToString, isPassingExpectations, prepareKnowledgeFromMarkdown, prettifyPipelineString, usageToWorktime, };
|
|
39
|
+
export { createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createSubcollection as createSublibrary, libraryToJson, };
|
|
40
40
|
export { SimplePromptInterfaceTools };
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
41
|
+
export { pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, validatePipeline };
|
|
42
|
+
export { MultipleLlmExecutionTools, createPromptbookExecutor };
|
|
43
43
|
export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
|
|
44
|
-
export {
|
|
44
|
+
export { CollectionError, ExecutionError, ExpectError, NotFoundError, PipelineLogicError, ReferenceError, SyntaxError, TemplateError, UnexpectedError, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createCollectionFromDirectory } from '../library/constructors/createCollectionFromDirectory';
|
|
2
2
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
3
3
|
export { PROMPTBOOK_VERSION };
|
|
4
|
-
export {
|
|
4
|
+
export { createCollectionFromDirectory };
|
|
@@ -2,32 +2,32 @@ import type { CommonExecutionToolsOptions } from '../execution/CommonExecutionTo
|
|
|
2
2
|
import { EmbeddingVector } from '../execution/EmbeddingVector';
|
|
3
3
|
import type { ExecutionTools } from '../execution/ExecutionTools';
|
|
4
4
|
import type { AvailableModel, LlmExecutionTools } from '../execution/LlmExecutionTools';
|
|
5
|
-
import type {
|
|
5
|
+
import type { PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptEmbeddingResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, UncertainNumber } from '../execution/PromptResult';
|
|
6
6
|
import type { PromptbookExecutor } from '../execution/PromptbookExecutor';
|
|
7
7
|
import type { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';
|
|
8
8
|
import type { UserInterfaceTools, UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
|
|
9
|
-
import type {
|
|
9
|
+
import type { PipelineCollection } from '../library/PipelineCollection';
|
|
10
10
|
import type { ExecutionType } from '../types/ExecutionTypes';
|
|
11
11
|
import type { ModelRequirements, ModelVariant } from '../types/ModelRequirements';
|
|
12
12
|
import type { Parameters } from '../types/Parameters';
|
|
13
|
+
import { KnowledgeJson } from '../types/PipelineJson/KnowledgeJson';
|
|
14
|
+
import { MaterialKnowledgePieceJson } from '../types/PipelineJson/MaterialKnowledgePieceJson';
|
|
15
|
+
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
16
|
+
import type { ExpectationAmount, ExpectationUnit, Expectations, LlmTemplateJson, PromptDialogJson, PromptTemplateJson, ScriptJson, SimpleTemplateJson } from '../types/PipelineJson/PromptTemplateJson';
|
|
17
|
+
import { EXPECTATION_UNITS } from '../types/PipelineJson/PromptTemplateJson';
|
|
18
|
+
import type { PromptTemplateParameterJson } from '../types/PipelineJson/PromptTemplateParameterJson';
|
|
19
|
+
import type { PipelineString } from '../types/PipelineString';
|
|
13
20
|
import type { Prompt } from '../types/Prompt';
|
|
14
|
-
import { KnowledgeJson } from '../types/PromptbookJson/KnowledgeJson';
|
|
15
|
-
import { MaterialKnowledgePieceJson } from '../types/PromptbookJson/MaterialKnowledgePieceJson';
|
|
16
|
-
import type { ExpectationAmount, Expectations, ExpectationUnit, LlmTemplateJson, PromptDialogJson, PromptTemplateJson, ScriptJson, SimpleTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
|
|
17
|
-
import { EXPECTATION_UNITS } from '../types/PromptbookJson/PromptTemplateJson';
|
|
18
|
-
import type { PromptTemplateParameterJson } from '../types/PromptbookJson/PromptTemplateParameterJson';
|
|
19
|
-
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
|
|
20
|
-
import type { PromptbookString } from '../types/PromptbookString';
|
|
21
21
|
import type { ScriptLanguage } from '../types/ScriptLanguage';
|
|
22
22
|
import type { TaskProgress } from '../types/TaskProgress';
|
|
23
23
|
import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
|
|
24
24
|
import type { string_char_emoji } from '../types/typeAliasEmoji';
|
|
25
|
-
import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname,
|
|
25
|
+
import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version } from '../types/typeAliases';
|
|
26
26
|
import type { FromtoItems } from '../utils/FromtoItems';
|
|
27
27
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
28
28
|
export { PROMPTBOOK_VERSION };
|
|
29
29
|
export { EXPECTATION_UNITS };
|
|
30
|
-
export type { AvailableModel,
|
|
30
|
+
export type { AvailableModel, CommonExecutionToolsOptions, EmbeddingVector, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, ExpectationUnit, Expectations, FromtoItems, KnowledgeJson, LlmExecutionTools, LlmTemplateJson, MaterialKnowledgePieceJson, ModelRequirements, ModelVariant, Parameters, PipelineCollection, PipelineJson, PipelineString, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptDialogJson, PromptEmbeddingResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, PromptTemplateJson, PromptTemplateParameterJson, PromptbookExecutor, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptJson, ScriptLanguage, SimpleTemplateJson, TaskProgress, UncertainNumber, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version, };
|
|
31
31
|
/**
|
|
32
32
|
* TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
|
|
33
33
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spaceTrim } from 'spacetrim';
|
|
2
|
-
import { renderPromptbookMermaid } from '../conversion/prettify/
|
|
2
|
+
import { renderPromptbookMermaid } from '../conversion/prettify/renderPipelineMermaidOptions';
|
|
3
3
|
import { extractParametersFromPromptTemplate } from '../conversion/utils/extractParametersFromPromptTemplate';
|
|
4
4
|
import { extractVariables } from '../conversion/utils/extractVariables';
|
|
5
5
|
import { parseNumber } from '../conversion/utils/parseNumber';
|
|
@@ -8,32 +8,30 @@ import { titleToName } from '../conversion/utils/titleToName';
|
|
|
8
8
|
import { forEachAsync } from '../execution/utils/forEachAsync';
|
|
9
9
|
import { replaceParameters } from '../execution/utils/replaceParameters';
|
|
10
10
|
import { isValidJsonString } from '../formats/json/utils/isValidJsonString';
|
|
11
|
-
import { CountUtils } from '../utils/expectation-counters/index';
|
|
12
11
|
import { countCharacters } from '../utils/expectation-counters/countCharacters';
|
|
13
12
|
import { countLines } from '../utils/expectation-counters/countLines';
|
|
14
13
|
import { countPages } from '../utils/expectation-counters/countPages';
|
|
15
14
|
import { countParagraphs } from '../utils/expectation-counters/countParagraphs';
|
|
16
|
-
import { countSentences } from '../utils/expectation-counters/countSentences';
|
|
17
|
-
import { splitIntoSentences } from '../utils/expectation-counters/countSentences';
|
|
15
|
+
import { countSentences, splitIntoSentences } from '../utils/expectation-counters/countSentences';
|
|
18
16
|
import { countWords } from '../utils/expectation-counters/countWords';
|
|
17
|
+
import { CountUtils } from '../utils/expectation-counters/index';
|
|
19
18
|
import { extractParameters } from '../utils/extractParameters';
|
|
20
19
|
import { extractAllBlocksFromMarkdown } from '../utils/markdown/extractAllBlocksFromMarkdown';
|
|
21
20
|
import { extractAllListItemsFromMarkdown } from '../utils/markdown/extractAllListItemsFromMarkdown';
|
|
22
21
|
import { extractOneBlockFromMarkdown } from '../utils/markdown/extractOneBlockFromMarkdown';
|
|
23
22
|
import { removeContentComments } from '../utils/markdown/removeContentComments';
|
|
24
23
|
import { removeMarkdownFormatting } from '../utils/markdown/removeMarkdownFormatting';
|
|
24
|
+
import { DIACRITIC_VARIANTS_LETTERS } from '../utils/normalization/DIACRITIC_VARIANTS_LETTERS';
|
|
25
|
+
import type { IKeywords, string_keyword } from '../utils/normalization/IKeywords';
|
|
25
26
|
import { capitalize } from '../utils/normalization/capitalize';
|
|
26
27
|
import { decapitalize } from '../utils/normalization/decapitalize';
|
|
27
|
-
import { DIACRITIC_VARIANTS_LETTERS } from '../utils/normalization/DIACRITIC_VARIANTS_LETTERS';
|
|
28
|
-
import type { IKeywords } from '../utils/normalization/IKeywords';
|
|
29
|
-
import type { string_keyword } from '../utils/normalization/IKeywords';
|
|
30
28
|
import { isValidKeyword } from '../utils/normalization/isValidKeyword';
|
|
31
29
|
import { nameToUriPart } from '../utils/normalization/nameToUriPart';
|
|
32
30
|
import { nameToUriParts } from '../utils/normalization/nameToUriParts';
|
|
33
31
|
import { normalizeToKebabCase } from '../utils/normalization/normalize-to-kebab-case';
|
|
34
|
-
import { normalizeTo_camelCase } from '../utils/normalization/normalizeTo_camelCase';
|
|
35
32
|
import { normalizeTo_PascalCase } from '../utils/normalization/normalizeTo_PascalCase';
|
|
36
33
|
import { normalizeTo_SCREAMING_CASE } from '../utils/normalization/normalizeTo_SCREAMING_CASE';
|
|
34
|
+
import { normalizeTo_camelCase } from '../utils/normalization/normalizeTo_camelCase';
|
|
37
35
|
import { normalizeTo_snake_case } from '../utils/normalization/normalizeTo_snake_case';
|
|
38
36
|
import { normalizeWhitespaces } from '../utils/normalization/normalizeWhitespaces';
|
|
39
37
|
import { parseKeywords } from '../utils/normalization/parseKeywords';
|
|
@@ -50,12 +48,12 @@ import { trimCodeBlock } from '../utils/trimCodeBlock';
|
|
|
50
48
|
import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
|
|
51
49
|
import { unwrapResult } from '../utils/unwrapResult';
|
|
52
50
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
53
|
-
export {
|
|
51
|
+
export { PROMPTBOOK_VERSION, forEachAsync };
|
|
54
52
|
export { extractAllBlocksFromMarkdown, // <- [🌻]
|
|
55
53
|
extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
|
|
56
54
|
extractOneBlockFromMarkdown, extractParameters, extractVariables, isValidJsonString, parseNumber, // <- [🌻]
|
|
57
55
|
removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, spaceTrim, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
|
|
58
|
-
export { countCharacters, countLines, countPages, countParagraphs, countSentences,
|
|
56
|
+
export { CountUtils, countCharacters, countLines, countPages, countParagraphs, countSentences, countWords };
|
|
59
57
|
export { splitIntoSentences };
|
|
60
58
|
export declare const normalizeTo: {
|
|
61
59
|
camelCase: typeof normalizeTo_camelCase;
|
|
@@ -64,7 +62,7 @@ export declare const normalizeTo: {
|
|
|
64
62
|
snake_case: typeof normalizeTo_snake_case;
|
|
65
63
|
'kebab-case': typeof normalizeToKebabCase;
|
|
66
64
|
};
|
|
67
|
-
export {
|
|
65
|
+
export { DIACRITIC_VARIANTS_LETTERS, IKeywords, capitalize, decapitalize, isValidKeyword, nameToUriPart, nameToUriParts, normalizeToKebabCase, normalizeTo_PascalCase, normalizeTo_SCREAMING_CASE, normalizeTo_camelCase, normalizeTo_snake_case, normalizeWhitespaces, parseKeywords, parseKeywordsFromString, removeDiacritics, searchKeywords, string_keyword, titleToName, };
|
|
68
66
|
export { extractParametersFromPromptTemplate, renameParameter, renderPromptbookMermaid };
|
|
69
67
|
export { difference, intersection, union };
|
|
70
68
|
/**
|
|
@@ -7,6 +7,6 @@ export declare const LOOP_LIMIT = 1000;
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const CHARACTER_LOOP_LIMIT = 100000;
|
|
9
9
|
/**
|
|
10
|
-
* The name of the builded promptbook library made by CLI `promptbook make` and for lookup in `
|
|
10
|
+
* The name of the builded promptbook library made by CLI `promptbook make` and for lookup in `createCollectionFromDirectory`
|
|
11
11
|
*/
|
|
12
12
|
export declare const PROMPTBOOK_MAKED_BASE_FILENAME = "index";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PipelineString } from '../types/PipelineString';
|
|
3
|
+
/**
|
|
4
|
+
* Converts promptbook in JSON format to string format
|
|
5
|
+
*
|
|
6
|
+
* @param pipelineJson Promptbook in JSON format (.ptbk.json)
|
|
7
|
+
* @returns Promptbook in string format (.ptbk.md)
|
|
8
|
+
*/
|
|
9
|
+
export declare function pipelineJsonToString(pipelineJson: PipelineJson): PipelineString;
|
|
10
|
+
/**
|
|
11
|
+
* TODO: Escape all
|
|
12
|
+
*/
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
|
|
2
|
+
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
3
|
+
import type { PipelineString } from '../types/PipelineString';
|
|
4
|
+
/**
|
|
5
|
+
* Options for pipelineStringToJson
|
|
6
|
+
*/
|
|
7
|
+
type PipelineStringToJsonOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Tools for processing required for knowledge processing *(not for actual execution)*
|
|
10
|
+
*/
|
|
11
|
+
llmTools?: LlmExecutionTools;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Compile promptbook from string (markdown) format to JSON format
|
|
15
|
+
*
|
|
16
|
+
* Note: There are two similar functions:
|
|
17
|
+
* - `pipelineStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
|
|
18
|
+
* - `pipelineStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
19
|
+
*
|
|
20
|
+
* @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
|
|
21
|
+
* @param options - Options and tools for the compilation
|
|
22
|
+
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
|
|
23
|
+
* @throws {SyntaxError} if the promptbook string is not valid
|
|
24
|
+
*
|
|
25
|
+
* Note: This function does not validate logic of the pipeline only the syntax
|
|
26
|
+
* Note: This function acts as compilation process
|
|
27
|
+
*/
|
|
28
|
+
export declare function pipelineStringToJson(pipelineString: PipelineString, options?: PipelineStringToJsonOptions): Promise<PipelineJson>;
|
|
29
|
+
export {};
|
|
30
|
+
/**
|
|
31
|
+
* TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
32
|
+
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PipelineString } from '../types/PipelineString';
|
|
3
|
+
/**
|
|
4
|
+
* Compile promptbook from string (markdown) format to JSON format synchronously
|
|
5
|
+
*
|
|
6
|
+
* Note: There are two similar functions:
|
|
7
|
+
* - `pipelineStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
|
|
8
|
+
* - `pipelineStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
9
|
+
*
|
|
10
|
+
* @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
|
|
11
|
+
* @param options - Options and tools for the compilation
|
|
12
|
+
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
|
|
13
|
+
* @throws {SyntaxError} if the promptbook string is not valid
|
|
14
|
+
*
|
|
15
|
+
* Note: This function does not validate logic of the pipeline only the syntax
|
|
16
|
+
* Note: This function acts as compilation process
|
|
17
|
+
*/
|
|
18
|
+
export declare function pipelineStringToJsonSync(pipelineString: PipelineString): PipelineJson;
|
|
19
|
+
/**
|
|
20
|
+
* TODO: Report here line/column of error
|
|
21
|
+
* TODO: Use spaceTrim more effectively
|
|
22
|
+
* TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
|
|
23
|
+
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PipelineString } from '../../types/PipelineString';
|
|
2
2
|
import type { PrettifyOptions } from './PrettifyOptions';
|
|
3
3
|
/**
|
|
4
4
|
* Prettyfies Promptbook string and adds Mermaid graph
|
|
5
5
|
*/
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function prettifyPipelineString(pipelineString: PipelineString, options: PrettifyOptions): Promise<PipelineString>;
|
|
7
7
|
/**
|
|
8
8
|
* TODO: Maybe use some Mermaid library instead of string templating
|
|
9
9
|
* TODO: [🕌] When more than 2 functionalities, split into separate functions
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PromptTemplateJson } from '../../types/
|
|
1
|
+
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PromptTemplateJson } from '../../types/PipelineJson/PromptTemplateJson';
|
|
3
3
|
import type { string_href } from '../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
5
|
* Addtional options for rendering Mermaid graph
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
7
|
+
export type renderPipelineMermaidOptions = {
|
|
8
8
|
/**
|
|
9
9
|
* Callback for creating from prompt template graph node
|
|
10
10
|
*/
|
|
@@ -18,7 +18,7 @@ export type renderPromptbookMermaidOptions = {
|
|
|
18
18
|
*
|
|
19
19
|
* Note: The result is not wrapped in a Markdown code block
|
|
20
20
|
*/
|
|
21
|
-
export declare function renderPromptbookMermaid(
|
|
21
|
+
export declare function renderPromptbookMermaid(pipelineJson: PipelineJson, options?: renderPipelineMermaidOptions): string;
|
|
22
22
|
/**
|
|
23
23
|
* TODO: Maybe use some Mermaid library instead of string templating
|
|
24
24
|
* TODO: [🕌] When more than 2 functionalities, split into separate functions
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { PromptTemplateJson } from '../../types/
|
|
1
|
+
import type { PromptTemplateJson } from '../../types/PipelineJson/PromptTemplateJson';
|
|
2
2
|
import type { string_name } from '../../types/typeAliases';
|
|
3
3
|
/**
|
|
4
4
|
* Parses the prompt template and returns the set of all used parameters
|
|
5
5
|
*
|
|
6
6
|
* @param promptTemplate the template with used parameters
|
|
7
7
|
* @returns the set of parameter names
|
|
8
|
-
* @throws {
|
|
8
|
+
* @throws {SyntaxError} if the script is invalid
|
|
9
9
|
*/
|
|
10
10
|
export declare function extractParametersFromPromptTemplate(promptTemplate: Pick<PromptTemplateJson, 'title' | 'description' | 'executionType' | 'content'>): Set<string_name>;
|
|
11
11
|
/**
|
|
@@ -5,7 +5,7 @@ import type { string_javascript_name } from '../../types/typeAliases';
|
|
|
5
5
|
*
|
|
6
6
|
* @param script from which to extract the variables
|
|
7
7
|
* @returns the list of variable names
|
|
8
|
-
* @throws {
|
|
8
|
+
* @throws {SyntaxError} if the script is invalid
|
|
9
9
|
*/
|
|
10
10
|
export declare function extractVariables(script: string_javascript): Set<string_javascript_name>;
|
|
11
11
|
/**
|
|
@@ -4,8 +4,8 @@ import type { string_markdown_text } from '../../types/typeAliases';
|
|
|
4
4
|
* Parses one line of ul/ol to command
|
|
5
5
|
*
|
|
6
6
|
* @returns parsed command object
|
|
7
|
-
* @throws {
|
|
7
|
+
* @throws {SyntaxError} if the command is invalid
|
|
8
8
|
*
|
|
9
|
-
* @private within the
|
|
9
|
+
* @private within the pipelineStringToJson
|
|
10
10
|
*/
|
|
11
11
|
export declare function parseCommand(listItem: string_markdown_text): Command;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
2
2
|
import type { string_name } from '../../types/typeAliases';
|
|
3
3
|
type RenameParameterOptions = {
|
|
4
4
|
/**
|
|
5
5
|
* Promptbook to search and replace for parameters
|
|
6
6
|
* This promptbook is returned as copy with replaced parameters
|
|
7
7
|
*/
|
|
8
|
-
promptbook:
|
|
8
|
+
promptbook: PipelineJson;
|
|
9
9
|
/**
|
|
10
10
|
* Original parameter name that should be replaced
|
|
11
11
|
*/
|
|
@@ -19,7 +19,7 @@ type RenameParameterOptions = {
|
|
|
19
19
|
* Function renameParameter will find all usable parameters for given prompt template
|
|
20
20
|
* In other words, it will find all parameters that are not used in the prompt template itseld and all its dependencies
|
|
21
21
|
*
|
|
22
|
-
* @throws {
|
|
22
|
+
* @throws {PipelineLogicError} If the new parameter name is already used in the promptbook
|
|
23
23
|
*/
|
|
24
|
-
export declare function renameParameter(options: RenameParameterOptions):
|
|
24
|
+
export declare function renameParameter(options: RenameParameterOptions): PipelineJson;
|
|
25
25
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PipelineString } from '../../types/PipelineString';
|
|
3
|
+
/**
|
|
4
|
+
* Import the text file
|
|
5
|
+
*
|
|
6
|
+
* Note: Using here custom import to work in jest tests
|
|
7
|
+
* Note: Using sync version is 💩 in the production code, but it's ok here in tests
|
|
8
|
+
*
|
|
9
|
+
* @param path - The path to the file relative to samples/templates directory
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
export declare function importPipeline(path: `${string}.ptbk.md`): PipelineString;
|
|
13
|
+
export declare function importPipeline(path: `${string}.ptbk.json`): PipelineJson;
|