@promptbook/remote-client 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 +2 -2
- package/esm/index.es.js +8 -8
- 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 +8 -8
- 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,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error indicates errors during the execution of the promptbook
|
|
3
3
|
*/
|
|
4
|
-
export declare class
|
|
5
|
-
readonly name = "
|
|
4
|
+
export declare class ExecutionError extends Error {
|
|
5
|
+
readonly name = "ExecutionError";
|
|
6
6
|
constructor(message: string);
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error indicates that promptbook not found in the library
|
|
3
3
|
*/
|
|
4
|
-
export declare class
|
|
5
|
-
readonly name = "
|
|
4
|
+
export declare class NotFoundError extends Error {
|
|
5
|
+
readonly name = "NotFoundError";
|
|
6
6
|
constructor(message: string);
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error indicates that the promptbook object has valid syntax but contains logical errors (like circular dependencies)
|
|
3
3
|
*/
|
|
4
|
-
export declare class
|
|
5
|
-
readonly name = "
|
|
4
|
+
export declare class PipelineLogicError extends Error {
|
|
5
|
+
readonly name = "PipelineLogicError";
|
|
6
6
|
constructor(message: string);
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error indicates errors in referencing promptbooks between each other
|
|
3
3
|
*/
|
|
4
|
-
export declare class
|
|
5
|
-
readonly name = "
|
|
4
|
+
export declare class ReferenceError extends Error {
|
|
5
|
+
readonly name = "ReferenceError";
|
|
6
6
|
constructor(message: string);
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
|
|
3
3
|
*/
|
|
4
|
-
export declare class
|
|
5
|
-
readonly name = "
|
|
4
|
+
export declare class SyntaxError extends Error {
|
|
5
|
+
readonly name = "SyntaxError";
|
|
6
6
|
constructor(message: string);
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error occurs during the parameter replacement in the template
|
|
3
3
|
*
|
|
4
|
-
* Note: This is a kindof subtype of
|
|
4
|
+
* Note: This is a kindof subtype of ExecutionError because it occurs during the execution of the pipeline
|
|
5
5
|
*/
|
|
6
6
|
export declare class TemplateError extends Error {
|
|
7
7
|
readonly name = "TemplateError";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
3
3
|
*
|
|
4
|
-
* @private Always catched and rethrown as `
|
|
5
|
-
* Note: This is a kindof subtype of
|
|
4
|
+
* @private Always catched and rethrown as `ExecutionError`
|
|
5
|
+
* Note: This is a kindof subtype of ExecutionError
|
|
6
6
|
*/
|
|
7
7
|
export declare class ExpectError extends Error {
|
|
8
8
|
readonly name = "ExpectError";
|
|
@@ -2,7 +2,7 @@ import type { LlmExecutionTools } from './LlmExecutionTools';
|
|
|
2
2
|
import type { ScriptExecutionTools } from './ScriptExecutionTools';
|
|
3
3
|
import type { UserInterfaceTools } from './UserInterfaceTools';
|
|
4
4
|
/**
|
|
5
|
-
* All the tools needed to execute
|
|
5
|
+
* All the tools needed to execute pipelines.
|
|
6
6
|
*
|
|
7
7
|
* @see https://github.com/webgptorg/promptbook#execution-tools
|
|
8
8
|
*/
|
|
@@ -16,11 +16,11 @@ export type LlmExecutionTools = {
|
|
|
16
16
|
/**
|
|
17
17
|
* Use a chat model
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
callChatModel(prompt: Prompt): Promise<PromptChatResult>;
|
|
20
20
|
/**
|
|
21
21
|
* Use a completion model
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
callCompletionModel(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
24
24
|
/**
|
|
25
25
|
* List all available models that can be used
|
|
26
26
|
*/
|
|
@@ -46,6 +46,6 @@ export type AvailableModel = {
|
|
|
46
46
|
/**
|
|
47
47
|
* TODO: [🧠] Emulation of one type of model with another one - emuate chat with completion; emulate translation with chat
|
|
48
48
|
* TODO: [🍓][♐] Some heuristic to pick the best model in listed models
|
|
49
|
-
* TODO: [🏳]
|
|
50
|
-
* TODO: [🧠] Should or should not there be a word "GPT" in both
|
|
49
|
+
* TODO: [🏳] callChatModel -> chat, callCompletionModel -> complete, translate
|
|
50
|
+
* TODO: [🧠] Should or should not there be a word "GPT" in both callCompletionModel and callChatModel
|
|
51
51
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { KebabCase } from 'type-fest';
|
|
2
|
-
import type { ExpectationUnit } from '../types/
|
|
2
|
+
import type { ExpectationUnit } from '../types/PipelineJson/PromptTemplateJson';
|
|
3
3
|
import type { number_positive } from '../types/typeAliases';
|
|
4
4
|
import type { number_usd } from '../types/typeAliases';
|
|
5
5
|
import type { string_date_iso8601 } from '../types/typeAliases';
|
|
@@ -3,7 +3,7 @@ import type { PromptbookExecutor } from './PromptbookExecutor';
|
|
|
3
3
|
* Asserts that the execution of a promptnook is successful
|
|
4
4
|
*
|
|
5
5
|
* @param executionResult - The partial result of the promptnook execution
|
|
6
|
-
* @throws {
|
|
6
|
+
* @throws {ExecutionError} If the execution is not successful or if multiple errors occurred
|
|
7
7
|
*/
|
|
8
8
|
export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PromptbookExecutor>>, 'isSuccessful' | 'errors'>): void;
|
|
9
9
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
2
2
|
import type { ExecutionTools } from './ExecutionTools';
|
|
3
3
|
import type { PromptbookExecutor } from './PromptbookExecutor';
|
|
4
4
|
type CreatePromptbookExecutorSettings = {
|
|
@@ -16,7 +16,7 @@ interface CreatePromptbookExecutorOptions {
|
|
|
16
16
|
/**
|
|
17
17
|
* The promptbook to be executed
|
|
18
18
|
*/
|
|
19
|
-
readonly promptbook:
|
|
19
|
+
readonly promptbook: PipelineJson;
|
|
20
20
|
/**
|
|
21
21
|
* The execution tools to be used during the execution of the PROMPTBOOK
|
|
22
22
|
*/
|
|
@@ -30,7 +30,7 @@ interface CreatePromptbookExecutorOptions {
|
|
|
30
30
|
* Creates executor function from promptbook and execution tools.
|
|
31
31
|
*
|
|
32
32
|
* @returns The executor function
|
|
33
|
-
* @throws {
|
|
33
|
+
* @throws {PipelineLogicError} on logical error in the promptbook
|
|
34
34
|
*/
|
|
35
35
|
export declare function createPromptbookExecutor(options: CreatePromptbookExecutorOptions): PromptbookExecutor;
|
|
36
36
|
export {};
|
package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
|
|
2
|
-
import type { KnowledgeJson } from '../../../types/
|
|
2
|
+
import type { KnowledgeJson } from '../../../types/PipelineJson/KnowledgeJson';
|
|
3
3
|
import type { string_markdown } from '../../../types/typeAliases';
|
|
4
4
|
type PrepareKnowledgeFromMarkdownOptions = {
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
|
|
2
|
-
import type { KnowledgeJson } from '../../../types/
|
|
2
|
+
import type { KnowledgeJson } from '../../../types/PipelineJson/KnowledgeJson';
|
|
3
3
|
import type { string_base64 } from '../../../types/typeAliases';
|
|
4
4
|
type PrepareKnowledgeFromPdfOptions = {
|
|
5
5
|
/**
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
3
|
+
import type { Prompt } from '../types/Prompt';
|
|
4
|
+
import type { string_pipeline_url } from '../types/typeAliases';
|
|
5
|
+
/**
|
|
6
|
+
* Collection that groups together pipelines, knowledge, personas, tools and actions
|
|
7
|
+
*
|
|
8
|
+
* @see !!! https://github.com/webgptorg/pipeline#pipeline-library
|
|
9
|
+
*/
|
|
10
|
+
export type PipelineCollection = {
|
|
11
|
+
/**
|
|
12
|
+
* Gets all pipelines in the library
|
|
13
|
+
*/
|
|
14
|
+
listPipelines(): Promisable<Array<string_pipeline_url>>;
|
|
15
|
+
/**
|
|
16
|
+
* Gets pipeline by its URL
|
|
17
|
+
*
|
|
18
|
+
* Note: This is not a direct fetching from the URL, but a lookup in the library
|
|
19
|
+
*/
|
|
20
|
+
getPipelineByUrl(url: string_pipeline_url): Promisable<PipelineJson>;
|
|
21
|
+
/**
|
|
22
|
+
* Checks whether given prompt was defined in any pipeline in the library
|
|
23
|
+
*/
|
|
24
|
+
isResponsibleForPrompt(prompt: Prompt): Promisable<boolean>;
|
|
25
|
+
};
|
package/esm/typings/src/library/{SimplePromptbookLibrary.d.ts → SimplePipelineCollection.d.ts}
RENAMED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
+
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
1
2
|
import type { Prompt } from '../types/Prompt';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { PromptbookLibrary } from './PromptbookLibrary';
|
|
3
|
+
import type { string_pipeline_url } from '../types/typeAliases';
|
|
4
|
+
import type { PipelineCollection } from './PipelineCollection';
|
|
5
5
|
/**
|
|
6
6
|
* Library of promptbooks that groups together promptbooks for an application.
|
|
7
7
|
* This implementation is a very thin wrapper around the Array / Map of promptbooks.
|
|
8
8
|
*
|
|
9
|
-
* @private use `
|
|
10
|
-
* @see https://github.com/webgptorg/promptbook#promptbook-
|
|
9
|
+
* @private use `createCollectionFromJson` instead
|
|
10
|
+
* @see https://github.com/webgptorg/promptbook#promptbook-collection
|
|
11
11
|
*/
|
|
12
|
-
export declare class
|
|
12
|
+
export declare class SimplePipelineCollection implements PipelineCollection {
|
|
13
13
|
private library;
|
|
14
14
|
/**
|
|
15
15
|
* Constructs a promptbook library from promptbooks
|
|
16
16
|
*
|
|
17
17
|
* @param promptbooks !!!
|
|
18
18
|
*
|
|
19
|
-
* @private Use instead `
|
|
19
|
+
* @private Use instead `createCollectionFromJson`
|
|
20
20
|
* Note: During the construction logic of all promptbooks are validated
|
|
21
|
-
* Note: It is not recommended to use this constructor directly, use `
|
|
21
|
+
* Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
|
|
22
22
|
*/
|
|
23
|
-
constructor(...promptbooks: Array<
|
|
23
|
+
constructor(...promptbooks: Array<PipelineJson>);
|
|
24
24
|
/**
|
|
25
25
|
* Gets all promptbooks in the library
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
listPipelines(): Array<string_pipeline_url>;
|
|
28
28
|
/**
|
|
29
29
|
* Gets promptbook by its URL
|
|
30
30
|
*
|
|
31
31
|
* Note: This is not a direct fetching from the URL, but a lookup in the library
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
getPipelineByUrl(url: string_pipeline_url): PipelineJson;
|
|
34
34
|
/**
|
|
35
35
|
* Checks whether given prompt was defined in any promptbook in the library
|
|
36
36
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { string_folder_path } from '../../types/typeAliases';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PipelineCollection } from '../PipelineCollection';
|
|
3
3
|
/**
|
|
4
|
-
* Options for `
|
|
4
|
+
* Options for `createCollectionFromDirectory` function
|
|
5
5
|
*/
|
|
6
|
-
type
|
|
6
|
+
type CreatePipelineCollectionFromDirectoryOptions = {
|
|
7
7
|
/**
|
|
8
8
|
* If true, the directory is searched recursively for promptbooks
|
|
9
9
|
*
|
|
@@ -37,9 +37,9 @@ type CreatePromptbookLibraryFromDirectoryOptions = {
|
|
|
37
37
|
*
|
|
38
38
|
* @param path - path to the directory with promptbooks
|
|
39
39
|
* @param options - Misc options for the library
|
|
40
|
-
* @returns
|
|
40
|
+
* @returns PipelineCollection
|
|
41
41
|
*/
|
|
42
|
-
export declare function
|
|
42
|
+
export declare function createCollectionFromDirectory(path: string_folder_path, options?: CreatePipelineCollectionFromDirectoryOptions): Promise<PipelineCollection>;
|
|
43
43
|
export {};
|
|
44
44
|
/**
|
|
45
45
|
* TODO: !!!! [🧠] Library precompilation and do not mix markdown and json promptbooks
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PipelineCollection } from '../PipelineCollection';
|
|
3
|
+
/**
|
|
4
|
+
* Creates PipelineCollection from array of PipelineJson or PipelineString
|
|
5
|
+
*
|
|
6
|
+
* Note: Functions `libraryToJson` and `createCollectionFromJson` are complementary
|
|
7
|
+
* Note: During the construction syntax and logic of all sources are validated
|
|
8
|
+
*
|
|
9
|
+
* @param promptbookSources
|
|
10
|
+
* @returns PipelineCollection
|
|
11
|
+
*/
|
|
12
|
+
export declare function createCollectionFromJson(...promptbooks: Array<PipelineJson>): PipelineCollection;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PipelineCollection } from '../PipelineCollection';
|
|
3
|
+
/**
|
|
4
|
+
* Constructs Promptbook from async sources
|
|
5
|
+
* It can be one of the following:
|
|
6
|
+
* - Promise of array of PipelineJson or PipelineString
|
|
7
|
+
* - Factory function that returns Promise of array of PipelineJson or PipelineString
|
|
8
|
+
*
|
|
9
|
+
* Note: This is useful as internal tool for other constructor functions like
|
|
10
|
+
* `createCollectionFromUrl` or `createCollectionFromDirectory`
|
|
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 `listPipelines` or `getPipelineByUrl` call
|
|
15
|
+
*
|
|
16
|
+
* Note: Consider using `createCollectionFromDirectory` or `createCollectionFromUrl`
|
|
17
|
+
*
|
|
18
|
+
* @param promptbookSourcesPromiseOrFactory
|
|
19
|
+
* @returns PipelineCollection
|
|
20
|
+
* @deprecated Do not use, it will became internal tool for other constructor functions
|
|
21
|
+
*/
|
|
22
|
+
export declare function createCollectionFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PipelineJson>> | (() => Promise<Array<PipelineJson>>)): PipelineCollection;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { string_url } from '../../types/typeAliases';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PipelineCollection } from '../PipelineCollection';
|
|
3
3
|
/**
|
|
4
|
-
* Options for `
|
|
4
|
+
* Options for `createCollectionFromDirectory` function
|
|
5
5
|
*/
|
|
6
|
-
type
|
|
6
|
+
type CreatePipelineCollectionFromUrlyOptions = {
|
|
7
7
|
/**
|
|
8
8
|
* If true, the library creation outputs information about each file it reads
|
|
9
9
|
*
|
|
@@ -20,9 +20,9 @@ type CreatePromptbookLibraryFromUrlyOptions = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Constructs Promptbook from remote Promptbase URL
|
|
22
22
|
|
|
23
|
-
* @returns
|
|
23
|
+
* @returns PipelineCollection
|
|
24
24
|
*/
|
|
25
|
-
export declare function
|
|
25
|
+
export declare function createCollectionFromUrl(url: string_url | URL, options: CreatePipelineCollectionFromUrlyOptions): Promise<PipelineCollection>;
|
|
26
26
|
export {};
|
|
27
27
|
/**
|
|
28
28
|
* TODO: !!!! [🧠] Library precompilation and do not mix markdown and json promptbooks
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { string_pipeline_url } from '../../types/typeAliases';
|
|
2
|
+
import type { PipelineCollection } from '../PipelineCollection';
|
|
3
|
+
/**
|
|
4
|
+
* Creates PipelineCollection as a subset of another PipelineCollection
|
|
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 PipelineCollection
|
|
11
|
+
*/
|
|
12
|
+
export declare function createSubcollection(library: PipelineCollection, predicate: (url: string_pipeline_url) => boolean): PipelineCollection;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PipelineCollection } from './PipelineCollection';
|
|
3
3
|
/**
|
|
4
|
-
* Converts
|
|
4
|
+
* Converts PipelineCollection to serialized JSON
|
|
5
5
|
*
|
|
6
|
-
* Note: Functions `libraryToJson` and `
|
|
6
|
+
* Note: Functions `libraryToJson` and `createCollectionFromJson` are complementary
|
|
7
7
|
*/
|
|
8
|
-
export declare function libraryToJson(library:
|
|
8
|
+
export declare function libraryToJson(library: PipelineCollection): Promise<Array<PipelineJson>>;
|
|
@@ -22,11 +22,11 @@ export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools
|
|
|
22
22
|
/**
|
|
23
23
|
* Calls Anthropic Claude API to use a chat model.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
callChatModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptChatResult>;
|
|
26
26
|
/**
|
|
27
27
|
* Calls Anthropic Claude API to use a complete model.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
|
|
30
30
|
/**
|
|
31
31
|
* Get the model that should be used as default
|
|
32
32
|
*/
|
|
@@ -43,6 +43,6 @@ export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools
|
|
|
43
43
|
/**
|
|
44
44
|
* TODO: !!!! [🍆] JSON mode
|
|
45
45
|
* TODO: [🧠] Maybe handle errors via transformAnthropicError (like transformAzureError)
|
|
46
|
-
* TODO: Maybe Create some common util for
|
|
46
|
+
* TODO: Maybe Create some common util for callChatModel and callCompletionModel
|
|
47
47
|
* TODO: Maybe make custom OpenaiError
|
|
48
48
|
*/
|
|
@@ -22,11 +22,11 @@ export declare class AzureOpenAiExecutionTools implements LlmExecutionTools {
|
|
|
22
22
|
/**
|
|
23
23
|
* Calls OpenAI API to use a chat model.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
callChatModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptChatResult>;
|
|
26
26
|
/**
|
|
27
27
|
* Calls Azure OpenAI API to use a complete model.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
|
|
30
30
|
/**
|
|
31
31
|
* Changes Azure error (which is not propper Error but object) to propper Error
|
|
32
32
|
*/
|
|
@@ -37,6 +37,6 @@ export declare class AzureOpenAiExecutionTools implements LlmExecutionTools {
|
|
|
37
37
|
listModels(): Promise<Array<AvailableModel>>;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* TODO: Maybe Create some common util for
|
|
40
|
+
* TODO: Maybe Create some common util for callChatModel and callCompletionModel
|
|
41
41
|
* TODO: Maybe make custom AzureOpenaiError
|
|
42
42
|
*/
|
|
@@ -13,11 +13,11 @@ export declare class MockedEchoLlmExecutionTools implements LlmExecutionTools {
|
|
|
13
13
|
/**
|
|
14
14
|
* Mocks chat model
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
callChatModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptChatResult>;
|
|
17
17
|
/**
|
|
18
18
|
* Mocks completion model
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
|
|
21
21
|
/**
|
|
22
22
|
* List all available mocked-models that can be used
|
|
23
23
|
*/
|
|
@@ -13,11 +13,11 @@ export declare class MockedFackedLlmExecutionTools implements LlmExecutionTools
|
|
|
13
13
|
/**
|
|
14
14
|
* Fakes chat model
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
callChatModel(prompt: Pick<Prompt, 'content' | 'modelRequirements' | 'expectations' | 'postprocessing'>): Promise<PromptChatResult & PromptCompletionResult>;
|
|
17
17
|
/**
|
|
18
18
|
* Fakes completion model
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements' | 'expectations' | 'postprocessing'>): Promise<PromptCompletionResult>;
|
|
21
21
|
/**
|
|
22
22
|
* List all available fake-models that can be used
|
|
23
23
|
*/
|
|
@@ -25,4 +25,4 @@ export declare class MockedFackedLlmExecutionTools implements LlmExecutionTools
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* TODO: [🕵️♀️] Maybe just remove
|
|
28
|
-
*/
|
|
28
|
+
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PostprocessingFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
2
|
-
import type { Expectations } from '../../types/
|
|
2
|
+
import type { Expectations } from '../../types/PipelineJson/PromptTemplateJson';
|
|
3
3
|
/**
|
|
4
4
|
* Gets the expectations and creates a fake text that meets the expectations
|
|
5
5
|
*
|
|
@@ -20,15 +20,15 @@ export declare class MultipleLlmExecutionTools implements LlmExecutionTools {
|
|
|
20
20
|
/**
|
|
21
21
|
* Calls the best available chat model
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
callChatModel(prompt: Prompt): Promise<PromptChatResult>;
|
|
24
24
|
/**
|
|
25
25
|
* Calls the best available completion model
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
callCompletionModel(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
28
28
|
/**
|
|
29
29
|
* Calls the best available model
|
|
30
30
|
*/
|
|
31
|
-
private
|
|
31
|
+
private callModelCommon;
|
|
32
32
|
/**
|
|
33
33
|
* List all available models that can be used
|
|
34
34
|
* This liost is a combination of all available models from all execution tools
|
|
@@ -23,11 +23,11 @@ export declare class OpenAiExecutionTools implements LlmExecutionTools {
|
|
|
23
23
|
/**
|
|
24
24
|
* Calls OpenAI API to use a chat model.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
callChatModel(prompt: Pick<Prompt, 'content' | 'modelRequirements' | 'expectFormat'>): Promise<PromptChatResult>;
|
|
27
27
|
/**
|
|
28
28
|
* Calls OpenAI API to use a complete model.
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
|
|
31
31
|
/**
|
|
32
32
|
* Calls OpenAI API to use a embedding model
|
|
33
33
|
*/
|
|
@@ -55,6 +55,6 @@ export declare class OpenAiExecutionTools implements LlmExecutionTools {
|
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* TODO: [🧠][🧙♂️] Maybe there can be some wizzard for thoose who want to use just OpenAI
|
|
58
|
-
* TODO: Maybe Create some common util for
|
|
58
|
+
* TODO: Maybe Create some common util for callChatModel and callCompletionModel
|
|
59
59
|
* TODO: Maybe make custom OpenaiError
|
|
60
60
|
*/
|
|
@@ -7,7 +7,7 @@ import type { Prompt } from '../../types/Prompt';
|
|
|
7
7
|
* @param promptContent The content of the prompt
|
|
8
8
|
* @param resultContent The content of the result (for embedding prompts or failed prompts pass empty string)
|
|
9
9
|
* @param rawResponse The raw response from OpenAI API
|
|
10
|
-
* @throws {
|
|
10
|
+
* @throws {ExecutionError} If the usage is not defined in the response from OpenAI
|
|
11
11
|
* @private internal util of `OpenAiExecutionTools`
|
|
12
12
|
*/
|
|
13
13
|
export declare function computeOpenaiUsage(promptContent: Prompt['content'], // <- Note: Intentionally using [] to access type properties to bring jsdoc from Prompt/PromptResult to consumer
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* @see https://openai.com/api/pricing/
|
|
5
5
|
* @see https://docs.anthropic.com/en/docs/models-overview
|
|
6
6
|
*
|
|
7
|
-
* @private within the
|
|
7
|
+
* @private within the package, used only as internal helper for `OPENAI_MODELS` and `computeUsage`
|
|
8
8
|
*/
|
|
9
9
|
type string_model_price = `$${number}.${number} / ${number}M tokens`;
|
|
10
10
|
/**
|
|
11
11
|
* Function computeUsage will create price per one token based on the string value found on openai page
|
|
12
12
|
*
|
|
13
|
-
* @private within the
|
|
13
|
+
* @private within the package, used only as internal helper for `OPENAI_MODELS`
|
|
14
14
|
*/
|
|
15
15
|
export declare function computeUsage(value: string_model_price): number;
|
|
16
16
|
export {};
|
|
@@ -22,15 +22,15 @@ export declare class RemoteLlmExecutionTools implements LlmExecutionTools {
|
|
|
22
22
|
/**
|
|
23
23
|
* Calls remote proxy server to use a chat model.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
callChatModel(prompt: Prompt): Promise<PromptChatResult>;
|
|
26
26
|
/**
|
|
27
27
|
* Calls remote proxy server to use a completion model.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
callCompletionModel(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
30
30
|
/**
|
|
31
31
|
* Calls remote proxy server to use both completion or chat model.
|
|
32
32
|
*/
|
|
33
|
-
private
|
|
33
|
+
private callModelCommon;
|
|
34
34
|
/**
|
|
35
35
|
* List all available models that can be used
|
|
36
36
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecutionToolsOptions';
|
|
2
2
|
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PipelineCollection } from '../../../library/PipelineCollection';
|
|
4
4
|
import type { client_id } from '../../../types/typeAliases';
|
|
5
5
|
import type { string_uri } from '../../../types/typeAliases';
|
|
6
6
|
export type RemoteServerOptions = CommonExecutionToolsOptions & {
|
|
@@ -20,7 +20,7 @@ export type RemoteServerOptions = CommonExecutionToolsOptions & {
|
|
|
20
20
|
*
|
|
21
21
|
* This is used to checkl validity of the prompt to prevent DDoS
|
|
22
22
|
*/
|
|
23
|
-
readonly library:
|
|
23
|
+
readonly library: PipelineCollection;
|
|
24
24
|
/**
|
|
25
25
|
* Creates llm execution tools for each client
|
|
26
26
|
*/
|
|
@@ -10,7 +10,7 @@ import type { RemoteServerOptions } from './interfaces/RemoteServerOptions';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function startRemoteServer(options: RemoteServerOptions): IDestroyable;
|
|
12
12
|
/**
|
|
13
|
-
* TODO: [⚖] Expose the library to be able to connect to same library via
|
|
13
|
+
* TODO: [⚖] Expose the library to be able to connect to same library via createCollectionFromUrl
|
|
14
14
|
* TODO: Handle progress - support streaming
|
|
15
15
|
* TODO: [🤹♂️] Do not hang up immediately but wait until client closes OR timeout
|
|
16
16
|
* TODO: [🤹♂️] Timeout on chat to free up resources
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { ExecutionType } from './ExecutionTypes';
|
|
2
|
+
import type { ModelRequirements } from './ModelRequirements';
|
|
3
|
+
import type { ExpectationAmount } from './PipelineJson/PromptTemplateJson';
|
|
4
|
+
import type { ExpectationUnit } from './PipelineJson/PromptTemplateJson';
|
|
1
5
|
import type { string_markdown_text } from './typeAliases';
|
|
2
6
|
import type { string_name } from './typeAliases';
|
|
3
7
|
import type { string_version } from './typeAliases';
|
|
4
|
-
import type { ExecutionType } from './ExecutionTypes';
|
|
5
|
-
import type { ModelRequirements } from './ModelRequirements';
|
|
6
|
-
import type { ExpectationAmount } from './PromptbookJson/PromptTemplateJson';
|
|
7
|
-
import type { ExpectationUnit } from './PromptbookJson/PromptTemplateJson';
|
|
8
8
|
/**
|
|
9
9
|
* Command is one piece of the prompt template which adds some logic to the prompt template or the whole pipeline.
|
|
10
10
|
* It is parsed from the markdown from ul/ol items - one command per one item.
|