@promptbook/openai 0.60.0-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 +8 -8
- package/esm/index.es.js +25 -25
- 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 +25 -25
- 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
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
-
import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
3
|
-
/**
|
|
4
|
-
* Creates PromptbookLibrary from array of PromptbookJson or PromptbookString
|
|
5
|
-
*
|
|
6
|
-
* Note: Functions `libraryToJson` and `createLibraryFromJson` are complementary
|
|
7
|
-
* Note: During the construction syntax and logic of all sources are validated
|
|
8
|
-
*
|
|
9
|
-
* @param promptbookSources
|
|
10
|
-
* @returns PromptbookLibrary
|
|
11
|
-
*/
|
|
12
|
-
export declare function createLibraryFromJson(...promptbooks: Array<PromptbookJson>): PromptbookLibrary;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
-
import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
3
|
-
/**
|
|
4
|
-
* Constructs Promptbook from async sources
|
|
5
|
-
* It can be one of the following:
|
|
6
|
-
* - Promise of array of PromptbookJson or PromptbookString
|
|
7
|
-
* - Factory function that returns Promise of array of PromptbookJson or PromptbookString
|
|
8
|
-
*
|
|
9
|
-
* Note: This is useful as internal tool for other constructor functions like
|
|
10
|
-
* `createLibraryFromUrl` or `createLibraryFromDirectory`
|
|
11
|
-
* Consider using those functions instead of this one
|
|
12
|
-
*
|
|
13
|
-
* Note: The function does NOT return promise it returns the library directly which waits for the sources to be resolved
|
|
14
|
-
* when error occurs in given promise or factory function, it is thrown during `listPromptbooks` or `getPromptbookByUrl` call
|
|
15
|
-
*
|
|
16
|
-
* Note: Consider using `createLibraryFromDirectory` or `createLibraryFromUrl`
|
|
17
|
-
*
|
|
18
|
-
* @param promptbookSourcesPromiseOrFactory
|
|
19
|
-
* @returns PromptbookLibrary
|
|
20
|
-
* @deprecated Do not use, it will became internal tool for other constructor functions
|
|
21
|
-
*/
|
|
22
|
-
export declare function createLibraryFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PromptbookJson>> | (() => Promise<Array<PromptbookJson>>)): PromptbookLibrary;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { string_promptbook_url } from '../../types/typeAliases';
|
|
2
|
-
import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
3
|
-
/**
|
|
4
|
-
* Creates PromptbookLibrary as a subset of another PromptbookLibrary
|
|
5
|
-
*
|
|
6
|
-
* Note: You can use any type of library as a parent library - local, remote, etc.
|
|
7
|
-
* Note: This is just a thin wrapper / proxy around the parent library
|
|
8
|
-
*
|
|
9
|
-
* @param promptbookSources
|
|
10
|
-
* @returns PromptbookLibrary
|
|
11
|
-
*/
|
|
12
|
-
export declare function createSublibrary(library: PromptbookLibrary, predicate: (url: string_promptbook_url) => boolean): PromptbookLibrary;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
|
|
2
|
-
import type { PromptbookString } from '../types/PromptbookString';
|
|
3
|
-
/**
|
|
4
|
-
* Converts promptbook in JSON format to string format
|
|
5
|
-
*
|
|
6
|
-
* @param promptbookJson Promptbook in JSON format (.ptbk.json)
|
|
7
|
-
* @returns Promptbook in string format (.ptbk.md)
|
|
8
|
-
*/
|
|
9
|
-
export declare function promptbookJsonToString(promptbookJson: PromptbookJson): PromptbookString;
|
|
10
|
-
/**
|
|
11
|
-
* TODO: Escape all
|
|
12
|
-
*/
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
|
|
2
|
-
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
|
|
3
|
-
import type { PromptbookString } from '../types/PromptbookString';
|
|
4
|
-
/**
|
|
5
|
-
* Options for promptbookStringToJson
|
|
6
|
-
*/
|
|
7
|
-
type PromptbookStringToJsonOptions = {
|
|
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
|
-
* - `promptbookStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
|
|
18
|
-
* - `promptbookStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
19
|
-
*
|
|
20
|
-
* @param promptbookString {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 {PromptbookSyntaxError} 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 promptbookStringToJson(promptbookString: PromptbookString, options?: PromptbookStringToJsonOptions): Promise<PromptbookJson>;
|
|
29
|
-
export {};
|
|
30
|
-
/**
|
|
31
|
-
* TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
32
|
-
*/
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
|
|
2
|
-
import type { PromptbookString } from '../types/PromptbookString';
|
|
3
|
-
/**
|
|
4
|
-
* Compile promptbook from string (markdown) format to JSON format synchronously
|
|
5
|
-
*
|
|
6
|
-
* Note: There are two similar functions:
|
|
7
|
-
* - `promptbookStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
|
|
8
|
-
* - `promptbookStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
9
|
-
*
|
|
10
|
-
* @param promptbookString {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 {PromptbookSyntaxError} 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 promptbookStringToJsonSync(promptbookString: PromptbookString): PromptbookJson;
|
|
19
|
-
/**
|
|
20
|
-
* TODO: Report here line/column of error
|
|
21
|
-
* TODO: Use spaceTrim more effectively
|
|
22
|
-
* TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
|
|
23
|
-
*/
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
-
import type { PromptbookString } from '../../types/PromptbookString';
|
|
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 importPromptbook(path: `${string}.ptbk.md`): PromptbookString;
|
|
13
|
-
export declare function importPromptbook(path: `${string}.ptbk.json`): PromptbookJson;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
-
/**
|
|
3
|
-
* Validates PromptbookJson if it is logically valid
|
|
4
|
-
*
|
|
5
|
-
* It checks:
|
|
6
|
-
* - if it has correct parameters dependency
|
|
7
|
-
*
|
|
8
|
-
* It does NOT check:
|
|
9
|
-
* - if it is valid json
|
|
10
|
-
* - if it is meaningful
|
|
11
|
-
*
|
|
12
|
-
* @param promptbook valid or invalid PromptbookJson
|
|
13
|
-
* @returns the same promptbook if it is logically valid
|
|
14
|
-
* @throws {PromptbookLogicError} on logical error in the promptbook
|
|
15
|
-
*/
|
|
16
|
-
export declare function validatePromptbook(promptbook: PromptbookJson): PromptbookJson;
|
|
17
|
-
/**
|
|
18
|
-
* TODO: [🧠] Work with promptbookVersion
|
|
19
|
-
* TODO: Use here some json-schema, Zod or something similar and change it to:
|
|
20
|
-
* > /**
|
|
21
|
-
* > * Validates PromptbookJson if it is logically valid.
|
|
22
|
-
* > *
|
|
23
|
-
* > * It checks:
|
|
24
|
-
* > * - it has a valid structure
|
|
25
|
-
* > * - ...
|
|
26
|
-
* > ex port function validatePromptbook(promptbook: unknown): asserts promptbook is PromptbookJson {
|
|
27
|
-
*/
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Promisable } from 'type-fest';
|
|
2
|
-
import type { Prompt } from '../types/Prompt';
|
|
3
|
-
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
|
|
4
|
-
import type { string_promptbook_url } from '../types/typeAliases';
|
|
5
|
-
/**
|
|
6
|
-
* Library of promptbooks that groups together promptbooks for an application.
|
|
7
|
-
*
|
|
8
|
-
* @see https://github.com/webgptorg/promptbook#promptbook-library
|
|
9
|
-
*/
|
|
10
|
-
export type PromptbookLibrary = {
|
|
11
|
-
/**
|
|
12
|
-
* Gets all promptbooks in the library
|
|
13
|
-
*/
|
|
14
|
-
listPromptbooks(): Promisable<Array<string_promptbook_url>>;
|
|
15
|
-
/**
|
|
16
|
-
* Gets promptbook by its URL
|
|
17
|
-
*
|
|
18
|
-
* Note: This is not a direct fetching from the URL, but a lookup in the library
|
|
19
|
-
*/
|
|
20
|
-
getPromptbookByUrl(url: string_promptbook_url): Promisable<PromptbookJson>;
|
|
21
|
-
/**
|
|
22
|
-
* Checks whether given prompt was defined in any promptbook in the library
|
|
23
|
-
*/
|
|
24
|
-
isResponsibleForPrompt(prompt: Prompt): Promisable<boolean>;
|
|
25
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
-
import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
3
|
-
/**
|
|
4
|
-
* Creates PromptbookLibrary from array of PromptbookJson or PromptbookString
|
|
5
|
-
*
|
|
6
|
-
* Note: Functions `libraryToJson` and `createLibraryFromJson` are complementary
|
|
7
|
-
* Note: During the construction syntax and logic of all sources are validated
|
|
8
|
-
*
|
|
9
|
-
* @param promptbookSources
|
|
10
|
-
* @returns PromptbookLibrary
|
|
11
|
-
*/
|
|
12
|
-
export declare function createLibraryFromJson(...promptbooks: Array<PromptbookJson>): PromptbookLibrary;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
-
import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
3
|
-
/**
|
|
4
|
-
* Constructs Promptbook from async sources
|
|
5
|
-
* It can be one of the following:
|
|
6
|
-
* - Promise of array of PromptbookJson or PromptbookString
|
|
7
|
-
* - Factory function that returns Promise of array of PromptbookJson or PromptbookString
|
|
8
|
-
*
|
|
9
|
-
* Note: This is useful as internal tool for other constructor functions like
|
|
10
|
-
* `createLibraryFromUrl` or `createLibraryFromDirectory`
|
|
11
|
-
* Consider using those functions instead of this one
|
|
12
|
-
*
|
|
13
|
-
* Note: The function does NOT return promise it returns the library directly which waits for the sources to be resolved
|
|
14
|
-
* when error occurs in given promise or factory function, it is thrown during `listPromptbooks` or `getPromptbookByUrl` call
|
|
15
|
-
*
|
|
16
|
-
* Note: Consider using `createLibraryFromDirectory` or `createLibraryFromUrl`
|
|
17
|
-
*
|
|
18
|
-
* @param promptbookSourcesPromiseOrFactory
|
|
19
|
-
* @returns PromptbookLibrary
|
|
20
|
-
* @deprecated Do not use, it will became internal tool for other constructor functions
|
|
21
|
-
*/
|
|
22
|
-
export declare function createLibraryFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PromptbookJson>> | (() => Promise<Array<PromptbookJson>>)): PromptbookLibrary;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { string_promptbook_url } from '../../types/typeAliases';
|
|
2
|
-
import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
3
|
-
/**
|
|
4
|
-
* Creates PromptbookLibrary as a subset of another PromptbookLibrary
|
|
5
|
-
*
|
|
6
|
-
* Note: You can use any type of library as a parent library - local, remote, etc.
|
|
7
|
-
* Note: This is just a thin wrapper / proxy around the parent library
|
|
8
|
-
*
|
|
9
|
-
* @param promptbookSources
|
|
10
|
-
* @returns PromptbookLibrary
|
|
11
|
-
*/
|
|
12
|
-
export declare function createSublibrary(library: PromptbookLibrary, predicate: (url: string_promptbook_url) => boolean): PromptbookLibrary;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/esm/typings/src/types/{PromptbookJson → PipelineJson}/MaterialKnowledgePieceJson.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/esm/typings/src/types/{PromptbookJson → PipelineJson}/PromptTemplateParameterJson.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/umd/typings/src/types/{PromptbookJson → PipelineJson}/MaterialKnowledgePieceJson.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/umd/typings/src/types/{PromptbookJson → PipelineJson}/PromptTemplateParameterJson.d.ts
RENAMED
|
File without changes
|