@promptbook/openai 0.61.0-1 โ 0.61.0-11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.es.js +4 -1
- package/esm/index.es.js.map +1 -1
- package/esm/typings/promptbook-collection/index.d.ts +196 -23
- package/esm/typings/src/_packages/core.index.d.ts +5 -1
- package/esm/typings/src/_packages/types.index.d.ts +6 -4
- package/esm/typings/src/_packages/utils.index.d.ts +4 -3
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +2 -2
- package/esm/typings/src/commands/MODEL/ModelCommand.d.ts +1 -1
- package/esm/typings/src/commands/PERSONA/PersonaCommand.d.ts +4 -2
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +15 -12
- package/esm/typings/src/config.d.ts +8 -0
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +9 -5
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +5 -3
- package/esm/typings/src/conversion/prettify/PrettifyOptions.d.ts +2 -2
- package/esm/typings/src/conversion/utils/renameParameter.d.ts +3 -3
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +2 -2
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +4 -0
- package/esm/typings/src/errors/EnvironmentMismatchError.d.ts +7 -0
- package/esm/typings/src/errors/VersionMismatchError.d.ts +8 -0
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +3 -1
- package/esm/typings/src/execution/PipelineExecutor.d.ts +8 -7
- package/esm/typings/src/execution/PromptResult.d.ts +17 -5
- package/esm/typings/src/execution/ScriptExecutionTools.d.ts +6 -4
- package/esm/typings/src/execution/UserInterfaceTools.d.ts +5 -5
- package/esm/typings/src/execution/createPipelineExecutor.d.ts +4 -1
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +2 -2
- package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -1
- package/esm/typings/src/formats/csv/ListFormatDefinition.d.ts +1 -1
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +1 -1
- package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +1 -1
- package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +1 -1
- package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
- package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -0
- package/esm/typings/src/knowledge/prepare-knowledge/_common/utils/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +10 -0
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +8 -23
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +3 -0
- package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +7 -14
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +2 -2
- package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -0
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +5 -5
- package/esm/typings/src/llm-providers/azure-openai/playground/playground.d.ts +3 -0
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +3 -1
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +3 -2
- package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +3 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/llm-providers/utils/cache/CacheItem.d.ts +29 -0
- package/esm/typings/src/llm-providers/utils/cache/CacheLlmToolsOptions.d.ts +10 -0
- package/esm/typings/src/llm-providers/utils/cache/cacheLlmTools.d.ts +17 -0
- package/esm/typings/src/llm-providers/utils/count-total-cost/LlmExecutionToolsWithTotalCost.d.ts +11 -0
- package/esm/typings/src/llm-providers/utils/count-total-cost/countTotalCost.d.ts +14 -0
- package/esm/typings/src/llm-providers/utils/createLlmToolsFromEnv.d.ts +21 -0
- package/esm/typings/src/personas/preparePersona.d.ts +10 -0
- package/esm/typings/src/personas/preparePersona.test.d.ts +1 -0
- package/esm/typings/src/prepare/PrepareOptions.d.ts +22 -0
- package/esm/typings/src/prepare/preparePipeline.d.ts +16 -0
- package/esm/typings/src/prepare/unpreparePipeline.d.ts +8 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +24 -0
- package/esm/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
- package/esm/typings/src/storage/files-storage/FilesStorage.d.ts +28 -0
- package/esm/typings/src/storage/files-storage/FilesStorageOptions.d.ts +10 -0
- package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
- package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
- package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +8 -0
- package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +8 -0
- package/esm/typings/src/storage/memory/MemoryStorage.d.ts +31 -0
- package/esm/typings/src/storage/utils/PrefixStorage.d.ts +23 -0
- package/esm/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +12 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +22 -1
- package/esm/typings/src/types/PipelineJson/Expectations.d.ts +6 -2
- package/esm/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +67 -0
- package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +24 -0
- package/esm/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +8 -1
- package/esm/typings/src/types/PipelineJson/PersonaJson.d.ts +40 -0
- package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +27 -3
- package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +21 -0
- package/esm/typings/src/types/PipelineJson/PromptDialogJson.d.ts +2 -0
- package/esm/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +1 -1
- package/esm/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +8 -1
- package/esm/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +11 -2
- package/esm/typings/src/types/PipelineJson/ScriptJson.d.ts +2 -0
- package/esm/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +2 -0
- package/esm/typings/src/types/Prompt.d.ts +5 -2
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +4 -4
- package/esm/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +3 -3
- package/esm/typings/src/types/typeAliases.d.ts +62 -14
- package/esm/typings/src/utils/FromtoItems.d.ts +3 -3
- package/esm/typings/src/utils/currentDate.d.ts +7 -0
- package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +2 -2
- package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +6 -9
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +9 -2
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +3 -3
- package/esm/typings/src/utils/organization/TODO.d.ts +4 -0
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +11 -0
- package/esm/typings/src/utils/organization/___.d.ts +4 -0
- package/esm/typings/src/utils/organization/notUsing.d.ts +11 -0
- package/esm/typings/src/utils/organization/really_any.d.ts +4 -0
- package/esm/typings/src/utils/random/randomSeed.d.ts +7 -0
- package/package.json +2 -2
- package/umd/index.umd.js +4 -1
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/promptbook-collection/index.d.ts +196 -23
- package/umd/typings/src/_packages/core.index.d.ts +5 -1
- package/umd/typings/src/_packages/types.index.d.ts +6 -4
- package/umd/typings/src/_packages/utils.index.d.ts +4 -3
- package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
- package/umd/typings/src/collection/constructors/createCollectionFromUrl.d.ts +2 -2
- package/umd/typings/src/commands/MODEL/ModelCommand.d.ts +1 -1
- package/umd/typings/src/commands/PERSONA/PersonaCommand.d.ts +4 -2
- package/umd/typings/src/commands/_common/types/CommandParser.d.ts +15 -12
- package/umd/typings/src/config.d.ts +8 -0
- package/umd/typings/src/conversion/pipelineStringToJson.d.ts +9 -5
- package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +5 -3
- package/umd/typings/src/conversion/prettify/PrettifyOptions.d.ts +2 -2
- package/umd/typings/src/conversion/utils/renameParameter.d.ts +3 -3
- package/umd/typings/src/conversion/validation/_importPipeline.d.ts +2 -2
- package/umd/typings/src/conversion/validation/validatePipeline.d.ts +4 -0
- package/umd/typings/src/errors/EnvironmentMismatchError.d.ts +7 -0
- package/umd/typings/src/errors/VersionMismatchError.d.ts +8 -0
- package/umd/typings/src/execution/LlmExecutionTools.d.ts +3 -1
- package/umd/typings/src/execution/PipelineExecutor.d.ts +8 -7
- package/umd/typings/src/execution/PromptResult.d.ts +17 -5
- package/umd/typings/src/execution/ScriptExecutionTools.d.ts +6 -4
- package/umd/typings/src/execution/UserInterfaceTools.d.ts +5 -5
- package/umd/typings/src/execution/createPipelineExecutor.d.ts +4 -1
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +2 -2
- package/umd/typings/src/execution/utils/forEachAsync.d.ts +1 -1
- package/umd/typings/src/formats/csv/ListFormatDefinition.d.ts +1 -1
- package/umd/typings/src/formats/json/JsonFormatDefinition.d.ts +1 -1
- package/umd/typings/src/formats/list/ListFormatDefinition.d.ts +1 -1
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +1 -1
- package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
- package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -0
- package/umd/typings/src/knowledge/prepare-knowledge/_common/utils/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +10 -0
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +8 -23
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +3 -0
- package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +7 -14
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
- package/umd/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +2 -2
- package/umd/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -0
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +5 -5
- package/umd/typings/src/llm-providers/azure-openai/playground/playground.d.ts +3 -0
- package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +1 -1
- package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +1 -1
- package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +3 -1
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +1 -1
- package/umd/typings/src/llm-providers/openai/openai-models.d.ts +3 -2
- package/umd/typings/src/llm-providers/openai/playground/playground.d.ts +3 -0
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +1 -1
- package/umd/typings/src/llm-providers/utils/cache/CacheItem.d.ts +29 -0
- package/umd/typings/src/llm-providers/utils/cache/CacheLlmToolsOptions.d.ts +10 -0
- package/umd/typings/src/llm-providers/utils/cache/cacheLlmTools.d.ts +17 -0
- package/umd/typings/src/llm-providers/utils/count-total-cost/LlmExecutionToolsWithTotalCost.d.ts +11 -0
- package/umd/typings/src/llm-providers/utils/count-total-cost/countTotalCost.d.ts +14 -0
- package/umd/typings/src/llm-providers/utils/createLlmToolsFromEnv.d.ts +21 -0
- package/umd/typings/src/personas/preparePersona.d.ts +10 -0
- package/umd/typings/src/personas/preparePersona.test.d.ts +1 -0
- package/umd/typings/src/prepare/PrepareOptions.d.ts +22 -0
- package/umd/typings/src/prepare/preparePipeline.d.ts +16 -0
- package/umd/typings/src/prepare/unpreparePipeline.d.ts +8 -0
- package/umd/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +1 -1
- package/umd/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
- package/umd/typings/src/storage/_common/PromptbookStorage.d.ts +24 -0
- package/umd/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
- package/umd/typings/src/storage/files-storage/FilesStorage.d.ts +28 -0
- package/umd/typings/src/storage/files-storage/FilesStorageOptions.d.ts +10 -0
- package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
- package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
- package/umd/typings/src/storage/local-storage/getLocalStorage.d.ts +8 -0
- package/umd/typings/src/storage/local-storage/getSessionStorage.d.ts +8 -0
- package/umd/typings/src/storage/memory/MemoryStorage.d.ts +31 -0
- package/umd/typings/src/storage/utils/PrefixStorage.d.ts +23 -0
- package/umd/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +12 -0
- package/umd/typings/src/types/ModelRequirements.d.ts +22 -1
- package/umd/typings/src/types/PipelineJson/Expectations.d.ts +6 -2
- package/umd/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +67 -0
- package/umd/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +24 -0
- package/umd/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +8 -1
- package/umd/typings/src/types/PipelineJson/PersonaJson.d.ts +40 -0
- package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +27 -3
- package/umd/typings/src/types/PipelineJson/PreparationJson.d.ts +21 -0
- package/umd/typings/src/types/PipelineJson/PromptDialogJson.d.ts +2 -0
- package/umd/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +1 -1
- package/umd/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +8 -1
- package/umd/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +11 -2
- package/umd/typings/src/types/PipelineJson/ScriptJson.d.ts +2 -0
- package/umd/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +2 -0
- package/umd/typings/src/types/Prompt.d.ts +5 -2
- package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +4 -4
- package/umd/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +3 -3
- package/umd/typings/src/types/typeAliases.d.ts +62 -14
- package/umd/typings/src/utils/FromtoItems.d.ts +3 -3
- package/umd/typings/src/utils/currentDate.d.ts +7 -0
- package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +2 -2
- package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +6 -9
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +9 -2
- package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
- package/umd/typings/src/utils/markdown/parseMarkdownSection.d.ts +3 -3
- package/umd/typings/src/utils/organization/TODO.d.ts +4 -0
- package/umd/typings/src/utils/organization/TODO_USE.d.ts +11 -0
- package/umd/typings/src/utils/organization/___.d.ts +4 -0
- package/umd/typings/src/utils/organization/notUsing.d.ts +11 -0
- package/umd/typings/src/utils/organization/really_any.d.ts +4 -0
- package/umd/typings/src/utils/random/randomSeed.d.ts +7 -0
- package/esm/typings/src/collection/constructors/justTestFsImport.d.ts +0 -7
- package/esm/typings/src/personas/personaToModelRequirements.d.ts +0 -6
- package/esm/typings/src/types/PipelineJson/KnowledgeJson.d.ts +0 -6
- package/esm/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +0 -28
- package/umd/typings/src/collection/constructors/justTestFsImport.d.ts +0 -7
- package/umd/typings/src/personas/personaToModelRequirements.d.ts +0 -6
- package/umd/typings/src/types/PipelineJson/KnowledgeJson.d.ts +0 -6
- package/umd/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +0 -28
- /package/esm/typings/src/_packages/{markdown-utils.d.ts โ markdown-utils.index.d.ts} +0 -0
- /package/esm/typings/src/utils/{just.d.ts โ organization/just.d.ts} +0 -0
- /package/umd/typings/src/_packages/{markdown-utils.d.ts โ markdown-utils.index.d.ts} +0 -0
- /package/umd/typings/src/utils/{just.d.ts โ organization/just.d.ts} +0 -0
|
@@ -6,6 +6,14 @@ export declare const LOOP_LIMIT = 1000;
|
|
|
6
6
|
* The maximum number of iterations for a loops which adds characters one by one
|
|
7
7
|
*/
|
|
8
8
|
export declare const CHARACTER_LOOP_LIMIT = 100000;
|
|
9
|
+
/**
|
|
10
|
+
* The maximum number of (LLM) tasks running in parallel
|
|
11
|
+
*/
|
|
12
|
+
export declare const MAX_PARALLEL_COUNT = 5;
|
|
13
|
+
/**
|
|
14
|
+
* The maximum length of the (generated) filename
|
|
15
|
+
*/
|
|
16
|
+
export declare const MAX_FILENAME_LENGTH = 30;
|
|
9
17
|
/**
|
|
10
18
|
* The name of the builded pipeline collection made by CLI `ptbk make` and for lookup in `createCollectionFromDirectory`
|
|
11
19
|
*/
|
|
@@ -2,20 +2,23 @@ import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
|
|
|
2
2
|
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
3
3
|
import type { PipelineString } from '../types/PipelineString';
|
|
4
4
|
/**
|
|
5
|
-
* Options for pipelineStringToJson
|
|
5
|
+
* Options for `pipelineStringToJson`
|
|
6
6
|
*/
|
|
7
7
|
export type PipelineStringToJsonOptions = {
|
|
8
8
|
/**
|
|
9
|
-
* Tools for processing required for knowledge
|
|
9
|
+
* Tools for processing required for preparation of knowledge *(not for actual execution)*
|
|
10
|
+
*
|
|
11
|
+
* Note: If you provide `null`, the knowledge will not be prepared
|
|
10
12
|
*/
|
|
11
|
-
llmTools
|
|
13
|
+
readonly llmTools: LlmExecutionTools | null;
|
|
12
14
|
};
|
|
13
15
|
/**
|
|
14
|
-
* Compile
|
|
16
|
+
* Compile pipeline from string (markdown) format to JSON format
|
|
15
17
|
*
|
|
16
|
-
* Note: There are
|
|
18
|
+
* Note: There are 3 similar functions:
|
|
17
19
|
* - `pipelineStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
|
|
18
20
|
* - `pipelineStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
21
|
+
* - `preparePipeline` - just one step in the compilation process
|
|
19
22
|
*
|
|
20
23
|
* @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
|
|
21
24
|
* @param options - Options and tools for the compilation
|
|
@@ -28,4 +31,5 @@ export type PipelineStringToJsonOptions = {
|
|
|
28
31
|
export declare function pipelineStringToJson(pipelineString: PipelineString, options?: PipelineStringToJsonOptions): Promise<PipelineJson>;
|
|
29
32
|
/**
|
|
30
33
|
* TODO: [๐] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
34
|
+
* TODO: [๐ ] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
31
35
|
*/
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
2
2
|
import type { PipelineString } from '../types/PipelineString';
|
|
3
3
|
/**
|
|
4
|
-
* Compile
|
|
4
|
+
* Compile pipeline from string (markdown) format to JSON format synchronously
|
|
5
5
|
*
|
|
6
|
-
* Note: There are
|
|
6
|
+
* Note: There are 3 similar functions:
|
|
7
7
|
* - `pipelineStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
|
|
8
8
|
* - `pipelineStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
9
|
+
* - `preparePipeline` - just one step in the compilation process
|
|
9
10
|
*
|
|
10
11
|
* @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
|
|
11
|
-
* @param options - Options and tools for the compilation
|
|
12
12
|
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
|
|
13
13
|
* @throws {ParsingError} if the promptbook string is not valid
|
|
14
14
|
*
|
|
@@ -22,4 +22,6 @@ export declare function pipelineStringToJsonSync(pipelineString: PipelineString)
|
|
|
22
22
|
* TODO: Use spaceTrim more effectively
|
|
23
23
|
* TODO: [๐ง ] Parameter flags - isInput, isOutput, isInternal
|
|
24
24
|
* TODO: [๐ฅ] Not optimal parsing because `splitMarkdownIntoSections` is executed twice with same string, once through `flattenMarkdown` and second directly here
|
|
25
|
+
* TODO: [โ] Probbably move expectations from templates to parameters
|
|
26
|
+
* TODO: [๐ ] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
25
27
|
*/
|
|
@@ -5,9 +5,9 @@ export type PrettifyOptions = {
|
|
|
5
5
|
/***
|
|
6
6
|
* If true, adds Mermaid graph to the Promptbook string
|
|
7
7
|
*/
|
|
8
|
-
isGraphAdded?: boolean;
|
|
8
|
+
readonly isGraphAdded?: boolean;
|
|
9
9
|
/**
|
|
10
10
|
* If true, the string is prettifyed as markdown
|
|
11
11
|
*/
|
|
12
|
-
isPrettifyed?: boolean;
|
|
12
|
+
readonly isPrettifyed?: boolean;
|
|
13
13
|
};
|
|
@@ -5,15 +5,15 @@ type RenameParameterOptions = {
|
|
|
5
5
|
* Pipeline to search and replace for parameters
|
|
6
6
|
* This pipeline is returned as copy with replaced parameters
|
|
7
7
|
*/
|
|
8
|
-
pipeline: PipelineJson;
|
|
8
|
+
readonly pipeline: PipelineJson;
|
|
9
9
|
/**
|
|
10
10
|
* Original parameter name that should be replaced
|
|
11
11
|
*/
|
|
12
|
-
oldParameterName: string_name;
|
|
12
|
+
readonly oldParameterName: string_name;
|
|
13
13
|
/**
|
|
14
14
|
* New parameter name that should replace the original parameter name
|
|
15
15
|
*/
|
|
16
|
-
newParameterName: string_name;
|
|
16
|
+
readonly newParameterName: string_name;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* Function renameParameter will find all usable parameters for given prompt template
|
|
@@ -9,5 +9,5 @@ import type { PipelineString } from '../../types/PipelineString';
|
|
|
9
9
|
* @param path - The path to the file relative to samples/templates directory
|
|
10
10
|
* @private
|
|
11
11
|
*/
|
|
12
|
-
export declare function
|
|
13
|
-
export declare function
|
|
12
|
+
export declare function importPipelineWithoutPreparation(path: `${string}.ptbk.md`): PipelineString;
|
|
13
|
+
export declare function importPipelineWithoutPreparation(path: `${string}.ptbk.json`): PipelineJson;
|
|
@@ -25,3 +25,7 @@ export declare function validatePipeline(pipeline: PipelineJson): PipelineJson;
|
|
|
25
25
|
* > * - ...
|
|
26
26
|
* > ex port function validatePipeline(promptbook: unknown): asserts promptbook is PipelineJson {
|
|
27
27
|
*/
|
|
28
|
+
/**
|
|
29
|
+
* TODO: [๐ง ] !!!!! Validate new things
|
|
30
|
+
* TODO: [๐ ] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
31
|
+
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { string_semantic_version } from '../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* This error type indicates that the version of the pipeline is not matching the expected version
|
|
4
|
+
*/
|
|
5
|
+
export declare class VersionMismatchError extends Error {
|
|
6
|
+
readonly name = "UnexpectedError";
|
|
7
|
+
constructor(message: string, expectedVersion: string_semantic_version);
|
|
8
|
+
}
|
|
@@ -63,8 +63,10 @@ export type AvailableModel = {
|
|
|
63
63
|
readonly modelVariant: ModelVariant;
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
|
-
* TODO:
|
|
66
|
+
* TODO: [๐ณ] Add `callTranslationModel`
|
|
67
|
+
* TODO: Maybe reorder `listModels` and put it befor `callChatModel`, `callCompletionModel`, `callEmbeddingModel`
|
|
67
68
|
* TODO: [๐ง ] Emulation of one type of model with another one - emuate chat with completion; emulate translation with chat
|
|
68
69
|
* TODO: [๐][โ] Some heuristic to pick the best model in listed models
|
|
69
70
|
* TODO: [๐ง ] Should or should not there be a word "GPT" in both callCompletionModel and callChatModel
|
|
71
|
+
* TODO: [๐ง ][๐ช] Should be common things like types, utils in folder containing A,B,C,.. or else outside this listing folder?
|
|
70
72
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Promisable } from 'type-fest';
|
|
2
2
|
import type { TaskProgress } from '../types/TaskProgress';
|
|
3
3
|
import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
|
|
4
|
-
import type {
|
|
4
|
+
import type { string_parameter_name } from '../types/typeAliases';
|
|
5
|
+
import type { string_parameter_value } from '../types/typeAliases';
|
|
5
6
|
import type { PromptResultUsage } from './PromptResult';
|
|
6
7
|
/**
|
|
7
8
|
* Executor is a simple async function that takes INPUT PARAMETERs and returns result parameters _(along with all intermediate parameters and INPUT PARAMETERs = it extends input object)_.
|
|
@@ -12,29 +13,29 @@ import type { PromptResultUsage } from './PromptResult';
|
|
|
12
13
|
* @see https://github.com/webgptorg/promptbook#executor
|
|
13
14
|
*/
|
|
14
15
|
export type PipelineExecutor = {
|
|
15
|
-
(inputParameters: Record<
|
|
16
|
+
(inputParameters: Record<string_parameter_name, string_parameter_value>, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<{
|
|
16
17
|
/**
|
|
17
18
|
* Whether the execution was successful, details are aviable in `executionReport`
|
|
18
19
|
*/
|
|
19
|
-
isSuccessful: boolean;
|
|
20
|
+
readonly isSuccessful: boolean;
|
|
20
21
|
/**
|
|
21
22
|
* Added usage of whole execution, detailed usage is aviable in `executionReport`
|
|
22
23
|
*/
|
|
23
|
-
usage: PromptResultUsage;
|
|
24
|
+
readonly usage: PromptResultUsage;
|
|
24
25
|
/**
|
|
25
26
|
* Errors that occured during the execution, details are aviable in `executionReport`
|
|
26
27
|
*/
|
|
27
|
-
errors: Array<Error>;
|
|
28
|
+
readonly errors: Array<Error>;
|
|
28
29
|
/**
|
|
29
30
|
* The report of the execution with all details
|
|
30
31
|
*/
|
|
31
|
-
executionReport: ExecutionReportJson;
|
|
32
|
+
readonly executionReport: ExecutionReportJson;
|
|
32
33
|
/**
|
|
33
34
|
* Result parameters of the execution
|
|
34
35
|
*
|
|
35
36
|
* Note: If the execution was not successful, there are only some of the result parameters
|
|
36
37
|
*/
|
|
37
|
-
outputParameters: Record<
|
|
38
|
+
readonly outputParameters: Record<string_parameter_name, string_parameter_value>;
|
|
38
39
|
}>;
|
|
39
40
|
};
|
|
40
41
|
/**
|
|
@@ -15,15 +15,21 @@ export type PromptResult = PromptCompletionResult | PromptChatResult | PromptEmb
|
|
|
15
15
|
/**
|
|
16
16
|
* Prompt completion result
|
|
17
17
|
* It contains only the following text NOT the whole completion
|
|
18
|
+
*
|
|
19
|
+
* Note: This is fully serializable as JSON
|
|
18
20
|
*/
|
|
19
21
|
export type PromptCompletionResult = PromptCommonResult;
|
|
20
22
|
/**
|
|
21
23
|
* Prompt chat result
|
|
24
|
+
*
|
|
25
|
+
* Note: This is fully serializable as JSON
|
|
22
26
|
*/
|
|
23
27
|
export type PromptChatResult = PromptCommonResult & {};
|
|
24
28
|
/**
|
|
25
29
|
* Prompt embedding result
|
|
26
30
|
* It contains only the following text NOT the whole completion
|
|
31
|
+
*
|
|
32
|
+
* Note: This is fully serializable as JSON
|
|
27
33
|
*/
|
|
28
34
|
export type PromptEmbeddingResult = Omit<PromptCommonResult, 'content'> & {
|
|
29
35
|
/**
|
|
@@ -31,6 +37,11 @@ export type PromptEmbeddingResult = Omit<PromptCommonResult, 'content'> & {
|
|
|
31
37
|
*/
|
|
32
38
|
content: EmbeddingVector;
|
|
33
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* Common properties for all prompt results
|
|
42
|
+
*
|
|
43
|
+
* Note: This is fully serializable as JSON
|
|
44
|
+
*/
|
|
34
45
|
export type PromptCommonResult = {
|
|
35
46
|
/**
|
|
36
47
|
* Exact text response from the model
|
|
@@ -47,15 +58,15 @@ export type PromptCommonResult = {
|
|
|
47
58
|
/**
|
|
48
59
|
* Start of the execution
|
|
49
60
|
*/
|
|
50
|
-
start: string_date_iso8601;
|
|
61
|
+
readonly start: string_date_iso8601;
|
|
51
62
|
/**
|
|
52
63
|
* First token generated
|
|
53
64
|
*/
|
|
54
|
-
firstToken?: string_date_iso8601;
|
|
65
|
+
readonly firstToken?: string_date_iso8601;
|
|
55
66
|
/**
|
|
56
67
|
* End of the execution
|
|
57
68
|
*/
|
|
58
|
-
complete: string_date_iso8601;
|
|
69
|
+
readonly complete: string_date_iso8601;
|
|
59
70
|
};
|
|
60
71
|
/**
|
|
61
72
|
* Usage of the prompt execution
|
|
@@ -99,11 +110,11 @@ export type UncertainNumber = {
|
|
|
99
110
|
/**
|
|
100
111
|
* The numeric value
|
|
101
112
|
*/
|
|
102
|
-
value: number_usd & (number_positive | 0);
|
|
113
|
+
readonly value: number_usd & (number_positive | 0);
|
|
103
114
|
/**
|
|
104
115
|
* Is the value uncertain
|
|
105
116
|
*/
|
|
106
|
-
isUncertain?: true;
|
|
117
|
+
readonly isUncertain?: true;
|
|
107
118
|
};
|
|
108
119
|
/**
|
|
109
120
|
* TODO: [๐ง ] Maybe timing more accurate then seconds?
|
|
@@ -111,4 +122,5 @@ export type UncertainNumber = {
|
|
|
111
122
|
* TODO: [๐ง ] Maybe type raw properly - not onject but OpenAI.result.whatever
|
|
112
123
|
* TODO: [๐ง ] Maybe remove redundant raw.choices.text
|
|
113
124
|
* TODO: Log raw even if prompt failed - log the raw error
|
|
125
|
+
* TODO: [๐ณ] Add `PromptTranslationResult`
|
|
114
126
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ScriptLanguage } from '../types/ScriptLanguage';
|
|
2
|
-
import type {
|
|
2
|
+
import type { string_parameter_name } from '../types/typeAliases';
|
|
3
|
+
import type { string_parameter_value } from '../types/typeAliases';
|
|
3
4
|
import type { string_script } from '../types/typeAliases';
|
|
4
5
|
/**
|
|
5
6
|
* Represents all the tools needed to EXECUTE SCRIPTs
|
|
@@ -16,13 +17,13 @@ export type ScriptExecutionToolsExecuteOptions = {
|
|
|
16
17
|
/**
|
|
17
18
|
* Language of the script
|
|
18
19
|
*/
|
|
19
|
-
scriptLanguage: ScriptLanguage;
|
|
20
|
+
readonly scriptLanguage: ScriptLanguage;
|
|
20
21
|
/**
|
|
21
22
|
* Parameters for the script
|
|
22
23
|
* Theese parameters are passed to the script as variables
|
|
23
24
|
* For example: { "name": "John" } => const name = "John";
|
|
24
25
|
*/
|
|
25
|
-
parameters: Record<
|
|
26
|
+
readonly parameters: Record<string_parameter_name, string_parameter_value>;
|
|
26
27
|
/**
|
|
27
28
|
* The content of the script to execute
|
|
28
29
|
* - It can be a single statement
|
|
@@ -31,8 +32,9 @@ export type ScriptExecutionToolsExecuteOptions = {
|
|
|
31
32
|
* - It can be IIFE (immediately invoked function expression)
|
|
32
33
|
* - It can use the parameters as variables and functions from global scope
|
|
33
34
|
*/
|
|
34
|
-
script: string_script;
|
|
35
|
+
readonly script: string_script;
|
|
35
36
|
};
|
|
36
37
|
/**
|
|
37
38
|
* TODO: [๐ง ][๐] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
39
|
+
* TODO: [๐ง ][๐ช] Should be common things like types, utils in folder containing A,B,C,.. or else outside this listing folder?
|
|
38
40
|
*/
|
|
@@ -21,26 +21,26 @@ export type UserInterfaceToolsPromptDialogOptions = {
|
|
|
21
21
|
* Note: This is not a prompt to language model but a prompt to the user
|
|
22
22
|
* @example "Your name"
|
|
23
23
|
*/
|
|
24
|
-
promptTitle: string;
|
|
24
|
+
readonly promptTitle: string;
|
|
25
25
|
/**
|
|
26
26
|
* Prompt message
|
|
27
27
|
*
|
|
28
28
|
* Note: This is not a prompt to language model but a prompt to the user
|
|
29
29
|
* @example "Please enter your name, including your last name, title, etc."
|
|
30
30
|
*/
|
|
31
|
-
promptMessage: string;
|
|
31
|
+
readonly promptMessage: string;
|
|
32
32
|
/**
|
|
33
33
|
* Default value for the input/textarea
|
|
34
34
|
*/
|
|
35
|
-
defaultValue: string | null;
|
|
35
|
+
readonly defaultValue: string | null;
|
|
36
36
|
/**
|
|
37
37
|
* Placeholder for the input/textarea
|
|
38
38
|
*/
|
|
39
|
-
placeholder?: string;
|
|
39
|
+
readonly placeholder?: string;
|
|
40
40
|
/**
|
|
41
41
|
* Priority of the prompt
|
|
42
42
|
*
|
|
43
43
|
* Note: This would be reflected for example into the UI z-index of the prompt modal
|
|
44
44
|
*/
|
|
45
|
-
priority: number_integer & number_positive;
|
|
45
|
+
readonly priority: number_integer & number_positive;
|
|
46
46
|
};
|
|
@@ -10,7 +10,7 @@ type CreatePipelineExecutorSettings = {
|
|
|
10
10
|
readonly maxExecutionAttempts: number;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
* Options for
|
|
13
|
+
* Options for `createPipelineExecutor`
|
|
14
14
|
*/
|
|
15
15
|
interface CreatePipelineExecutorOptions {
|
|
16
16
|
/**
|
|
@@ -35,8 +35,11 @@ interface CreatePipelineExecutorOptions {
|
|
|
35
35
|
export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor;
|
|
36
36
|
export {};
|
|
37
37
|
/**
|
|
38
|
+
* TODO: [๐ช] Pass maxParallelCount here
|
|
39
|
+
* TODO: [โ] Probbably move expectations from templates to parameters
|
|
38
40
|
* TODO: [๐ง ] When not meet expectations in PROMPT_DIALOG, make some way to tell the user
|
|
39
41
|
* TODO: [๐ง] Strongly type the executors to avoid need of remove nullables whtn noUncheckedIndexedAccess in tsconfig.json
|
|
40
42
|
* Note: CreatePipelineExecutorOptions are just connected to PipelineExecutor so do not extract to types folder
|
|
41
43
|
* TODO: [๐ง ][3] transparent = (report intermediate parameters) / opaque execution = (report only output parameters) progress reporting mode
|
|
44
|
+
* TODO: [๐ ] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
42
45
|
*/
|
|
@@ -8,4 +8,4 @@ export declare const CsvFormatDefinition: FormatDefinition<string, string, objec
|
|
|
8
8
|
* TODO: [๐] In `CsvFormatDefinition` implement partial `canBeValid`
|
|
9
9
|
* TODO: [๐] In `CsvFormatDefinition` implement `heal
|
|
10
10
|
* TODO: [๐] In `CsvFormatDefinition` implement `extractValues`
|
|
11
|
-
*/
|
|
11
|
+
*/
|
|
@@ -12,4 +12,4 @@ export declare const JsonFormatDefinition: FormatDefinition<string, string, obje
|
|
|
12
12
|
* TODO: [๐] In `JsonFormatDefinition` implement partial `canBeValid`
|
|
13
13
|
* TODO: [๐] In `JsonFormatDefinition` implement `heal
|
|
14
14
|
* TODO: [๐] In `JsonFormatDefinition` implement `extractValues`
|
|
15
|
-
*/
|
|
15
|
+
*/
|
|
@@ -10,4 +10,4 @@ export declare const ListFormatDefinition: FormatDefinition<string, string, obje
|
|
|
10
10
|
* TODO: [๐] In `ListFormatDefinition` implement partial `canBeValid`
|
|
11
11
|
* TODO: [๐] In `ListFormatDefinition` implement `heal
|
|
12
12
|
* TODO: [๐] In `ListFormatDefinition` implement `extractValues`
|
|
13
|
-
*/
|
|
13
|
+
*/
|
|
@@ -2,7 +2,7 @@ import type { Promisable } from 'type-fest';
|
|
|
2
2
|
import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecutionToolsOptions';
|
|
3
3
|
import type { UserInterfaceToolsPromptDialogOptions } from '../../../execution/UserInterfaceTools';
|
|
4
4
|
/**
|
|
5
|
-
* Options for CallbackInterfaceTools
|
|
5
|
+
* Options for `CallbackInterfaceTools`
|
|
6
6
|
*/
|
|
7
7
|
export type CallbackInterfaceToolsOptions = CommonExecutionToolsOptions & {
|
|
8
8
|
/**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PrepareOptions } from '../../../prepare/PrepareOptions';
|
|
2
|
+
import type { KnowledgePiecePreparedJson } from '../../../types/PipelineJson/KnowledgePieceJson';
|
|
3
|
+
import type { KnowledgeSourceJson } from '../../../types/PipelineJson/KnowledgeSourceJson';
|
|
4
|
+
/**
|
|
5
|
+
* Prepares the knowle
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/webgptorg/promptbook/discussions/41
|
|
8
|
+
* @private within the package
|
|
9
|
+
*/
|
|
10
|
+
export declare function prepareKnowledgePieces(knowledgeSources: Array<KnowledgeSourceJson>, options: PrepareOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'preparationIds'>>>;
|
|
11
|
+
/**
|
|
12
|
+
* TODO: [๐ง] In future one preparation can take data from previous preparation and save tokens and time
|
|
13
|
+
* Put `knowledgePieces` into `PrepareKnowledgeOptions`
|
|
14
|
+
* TODO: [๐ช] More than max things can run in parallel by acident [1,[2a,2b,_],[3a,3b,_]]
|
|
15
|
+
* TODO: [๐ง ][โ] Do here propper M:N mapping
|
|
16
|
+
* [x] One source can make multiple pieces
|
|
17
|
+
* [ ] One piece can have multiple sources
|
|
18
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LlmExecutionTools } from '../../../../execution/LlmExecutionTools';
|
|
2
|
+
/**
|
|
3
|
+
* Returns LLM tools for testing purposes
|
|
4
|
+
*
|
|
5
|
+
* @private within the package - JUST FOR TESTS, SCRIPTS AND PLAYGROUND
|
|
6
|
+
*/
|
|
7
|
+
export declare function getLlmToolsForTestingAndScriptsAndPlayground(): LlmExecutionTools;
|
|
8
|
+
/**
|
|
9
|
+
* Note: [โช]
|
|
10
|
+
*/
|
package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { PrepareOptions } from '../../../prepare/PrepareOptions';
|
|
2
|
+
import type { KnowledgePiecePreparedJson } from '../../../types/PipelineJson/KnowledgePieceJson';
|
|
3
3
|
import type { string_markdown } from '../../../types/typeAliases';
|
|
4
|
-
type PrepareKnowledgeFromMarkdownOptions = {
|
|
5
|
-
/**
|
|
6
|
-
* The source of the knowledge in markdown format
|
|
7
|
-
*/
|
|
8
|
-
content: string_markdown;
|
|
9
|
-
/**
|
|
10
|
-
* The LLM tools to use for the conversion and extraction of knowledge
|
|
11
|
-
*
|
|
12
|
-
* Note: If you want to use multiple LLMs, you can use `joinLlmExecutionTools` to join them first
|
|
13
|
-
*/
|
|
14
|
-
llmTools: LlmExecutionTools;
|
|
15
|
-
/**
|
|
16
|
-
* If true, the preaparation of knowledge logs additional information
|
|
17
|
-
*
|
|
18
|
-
* @default false
|
|
19
|
-
*/
|
|
20
|
-
isVerbose?: boolean;
|
|
21
|
-
};
|
|
22
|
-
export declare function prepareKnowledgeFromMarkdown(options: PrepareKnowledgeFromMarkdownOptions): Promise<KnowledgeJson>;
|
|
23
|
-
export {};
|
|
24
4
|
/**
|
|
25
|
-
*
|
|
5
|
+
* @@@
|
|
6
|
+
*/
|
|
7
|
+
export declare function prepareKnowledgeFromMarkdown(content: string_markdown, options: PrepareOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>>>;
|
|
8
|
+
/**
|
|
9
|
+
* TODO: [๐ช] Do it in parallel 11:11
|
|
10
|
+
* Note: No need to aggregate usage here, it is done by intercepting the llmTools
|
|
26
11
|
*/
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { PrepareOptions } from '../../../prepare/PrepareOptions';
|
|
2
|
+
import type { KnowledgePiecePreparedJson } from '../../../types/PipelineJson/KnowledgePieceJson';
|
|
3
3
|
import type { string_base64 } from '../../../types/typeAliases';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
content: string_base64;
|
|
9
|
-
/**
|
|
10
|
-
* The LLM tools to use for the conversion and extraction of knowledge
|
|
11
|
-
*/
|
|
12
|
-
llmTools: LlmExecutionTools;
|
|
13
|
-
};
|
|
14
|
-
export declare function prepareKnowledgeFromPdf(options: PrepareKnowledgeFromPdfOptions): Promise<KnowledgeJson>;
|
|
15
|
-
export {};
|
|
4
|
+
/**
|
|
5
|
+
* @@@
|
|
6
|
+
*/
|
|
7
|
+
export declare function prepareKnowledgeFromPdf(content: string_base64, options: PrepareOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>>>;
|
|
16
8
|
/**
|
|
17
9
|
* TODO: [๐งบ] In future, content can be alse File or Blob BUT for now for wider compatibility its only base64
|
|
18
10
|
* @see https://stackoverflow.com/questions/14653349/node-js-cant-create-blobs
|
|
11
|
+
* TODO: [๐ช] Do it in parallel
|
|
19
12
|
*/
|
package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ClientOptions } from '@anthropic-ai/sdk';
|
|
2
2
|
import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';
|
|
3
3
|
/**
|
|
4
|
-
* Options for AnthropicClaudeExecutionTools
|
|
4
|
+
* Options for `AnthropicClaudeExecutionTools`
|
|
5
5
|
*
|
|
6
6
|
* This extends Anthropic's `ClientOptions` with are directly passed to the Anthropic client.
|
|
7
7
|
*/
|
|
@@ -9,8 +9,8 @@ import type { number_usd } from '../../types/typeAliases';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const ANTHROPIC_CLAUDE_MODELS: Array<AvailableModel & {
|
|
11
11
|
pricing?: {
|
|
12
|
-
prompt: number_usd;
|
|
13
|
-
output: number_usd;
|
|
12
|
+
readonly prompt: number_usd;
|
|
13
|
+
readonly output: number_usd;
|
|
14
14
|
};
|
|
15
15
|
}>;
|
|
16
16
|
/**
|
|
@@ -2,7 +2,7 @@ import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutio
|
|
|
2
2
|
import type { string_name } from '../../types/typeAliases';
|
|
3
3
|
import type { string_token } from '../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
|
-
* Options for AzureOpenAiExecutionTools
|
|
5
|
+
* Options for `AzureOpenAiExecutionTools`
|
|
6
6
|
*
|
|
7
7
|
* @see https://oai.azure.com/portal/
|
|
8
8
|
*/
|
|
@@ -12,7 +12,7 @@ export type AzureOpenAiExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
|
12
12
|
*
|
|
13
13
|
* Note: Typically you have one resource and multiple deployments.
|
|
14
14
|
*/
|
|
15
|
-
resourceName: string_name;
|
|
15
|
+
readonly resourceName: string_name;
|
|
16
16
|
/**
|
|
17
17
|
* The deployment name
|
|
18
18
|
*
|
|
@@ -20,16 +20,16 @@ export type AzureOpenAiExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
|
20
20
|
* Note: This is kind of a modelName in OpenAI terms
|
|
21
21
|
* Note: Typically you have one resource and multiple deployments.
|
|
22
22
|
*/
|
|
23
|
-
deploymentName: string_name;
|
|
23
|
+
readonly deploymentName: string_name;
|
|
24
24
|
/**
|
|
25
25
|
* The API key of the Azure OpenAI resource
|
|
26
26
|
*/
|
|
27
|
-
apiKey: string_token;
|
|
27
|
+
readonly apiKey: string_token;
|
|
28
28
|
/**
|
|
29
29
|
* A unique identifier representing your end-user, which can help Azure OpenAI to monitor
|
|
30
30
|
* and detect abuse.
|
|
31
31
|
*
|
|
32
32
|
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids (document from OpenAI not Azure, but same concept)
|
|
33
33
|
*/
|
|
34
|
-
user?: string_token;
|
|
34
|
+
readonly user?: string_token;
|
|
35
35
|
};
|
|
@@ -29,6 +29,6 @@ export declare class MockedEchoLlmExecutionTools implements LlmExecutionTools {
|
|
|
29
29
|
listModels(): Array<AvailableModel>;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* TODO:
|
|
32
|
+
* TODO: !!! Use here `seed`
|
|
33
33
|
* TODO: Allow in spaceTrim: nesting with > ${block(prompt.request)}, same as replace params
|
|
34
34
|
*/
|
|
@@ -41,10 +41,12 @@ export declare class MultipleLlmExecutionTools implements LlmExecutionTools {
|
|
|
41
41
|
private callModelCommon;
|
|
42
42
|
/**
|
|
43
43
|
* List all available models that can be used
|
|
44
|
-
* This
|
|
44
|
+
* This lists is a combination of all available models from all execution tools
|
|
45
45
|
*/
|
|
46
46
|
listModels(): Promise<Array<AvailableModel>>;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* TODO: [๐ง ][๐] Aggregating multiple models - have result not only from one first aviable model BUT all of them
|
|
50
|
+
* TODO: [๐] If no llmTools have for example not defined `callCompletionModel` this will still return object with defined `callCompletionModel` which just throws `PipelineExecutionError`, make it undefined instead
|
|
51
|
+
* Look how `countTotalUsage` (and `cacheLlmTools`) implements it
|
|
50
52
|
*/
|
|
@@ -2,7 +2,7 @@ import type { ClientOptions } from 'openai';
|
|
|
2
2
|
import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';
|
|
3
3
|
import type { string_token } from '../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
|
-
* Options for OpenAiExecutionTools
|
|
5
|
+
* Options for `OpenAiExecutionTools`
|
|
6
6
|
*
|
|
7
7
|
* This extends OpenAI's `ClientOptions` with are directly passed to the OpenAI client.
|
|
8
8
|
* Rest is used by the `OpenAiExecutionTools`.
|