@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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ModelRequirements } from '../ModelRequirements';
|
|
2
|
+
import type { number_id } from '../typeAliases';
|
|
3
|
+
import type { string_name } from '../typeAliases';
|
|
4
|
+
import type { string_persona_description } from '../typeAliases';
|
|
5
|
+
/**
|
|
6
|
+
* Defines a persona in the pipeline
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/webgptorg/promptbook/discussions/22
|
|
9
|
+
*/
|
|
10
|
+
export type PersonaJson = {
|
|
11
|
+
/**
|
|
12
|
+
* Name of the template
|
|
13
|
+
* - It must be unique across the pipeline
|
|
14
|
+
* - It should start uppercase and can contain letters and numbers
|
|
15
|
+
*/
|
|
16
|
+
readonly name: string_name;
|
|
17
|
+
/**
|
|
18
|
+
* Description of persona
|
|
19
|
+
*/
|
|
20
|
+
readonly description: string_persona_description;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Defines a persona in the pipeline after it has been prepared
|
|
24
|
+
*
|
|
25
|
+
* @see https://github.com/webgptorg/promptbook/discussions/22
|
|
26
|
+
*/
|
|
27
|
+
export type PersonaPreparedJson = PersonaJson & {
|
|
28
|
+
/**
|
|
29
|
+
* Model requirements for the persona
|
|
30
|
+
*
|
|
31
|
+
* Note: The model must be CHAT variant to be usable through persona
|
|
32
|
+
*/
|
|
33
|
+
readonly modelRequirements: ModelRequirements & {
|
|
34
|
+
readonly modelVariant: 'CHAT';
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* List of preparation ids that were used to prepare this persona
|
|
38
|
+
*/
|
|
39
|
+
readonly preparationIds: Array<number_id>;
|
|
40
|
+
};
|
|
@@ -2,7 +2,12 @@ import type { string_file_path } from '../typeAliases';
|
|
|
2
2
|
import type { string_markdown_text } from '../typeAliases';
|
|
3
3
|
import type { string_pipeline_url } from '../typeAliases';
|
|
4
4
|
import type { string_semantic_version } from '../typeAliases';
|
|
5
|
-
import type {
|
|
5
|
+
import type { KnowledgePiecePreparedJson } from './KnowledgePieceJson';
|
|
6
|
+
import type { KnowledgeSourceJson } from './KnowledgeSourceJson';
|
|
7
|
+
import type { KnowledgeSourcePreparedJson } from './KnowledgeSourceJson';
|
|
8
|
+
import type { PersonaJson } from './PersonaJson';
|
|
9
|
+
import type { PersonaPreparedJson } from './PersonaJson';
|
|
10
|
+
import type { PreparationJson } from './PreparationJson';
|
|
6
11
|
import type { PromptTemplateJson } from './PromptTemplateJson';
|
|
7
12
|
import type { PromptTemplateParameterJson } from './PromptTemplateParameterJson';
|
|
8
13
|
/**
|
|
@@ -50,11 +55,30 @@ export type PipelineJson = {
|
|
|
50
55
|
readonly promptTemplates: Array<PromptTemplateJson>;
|
|
51
56
|
/**
|
|
52
57
|
* Set of information that are used as external knowledge in the pipeline
|
|
58
|
+
*
|
|
59
|
+
* @see https://github.com/webgptorg/promptbook/discussions/41
|
|
60
|
+
*/
|
|
61
|
+
readonly knowledgeSources: Array<KnowledgeSourceJson | KnowledgeSourcePreparedJson>;
|
|
62
|
+
/**
|
|
63
|
+
* Set of information that are used as external knowledge in the pipeline
|
|
64
|
+
*
|
|
65
|
+
* @see https://github.com/webgptorg/promptbook/discussions/41
|
|
66
|
+
*/
|
|
67
|
+
readonly knowledgePieces: Array<KnowledgePiecePreparedJson>;
|
|
68
|
+
/**
|
|
69
|
+
* List of prepared virtual personas that are used in the pipeline
|
|
70
|
+
*
|
|
71
|
+
* @see https://github.com/webgptorg/promptbook/discussions/22
|
|
72
|
+
*/
|
|
73
|
+
readonly personas: Array<PersonaJson | PersonaPreparedJson>;
|
|
74
|
+
/**
|
|
75
|
+
* List of prepared virtual personas that are used in the pipeline
|
|
76
|
+
*
|
|
77
|
+
* @see https://github.com/webgptorg/promptbook/discussions/78
|
|
53
78
|
*/
|
|
54
|
-
readonly
|
|
79
|
+
readonly preparations: Array<PreparationJson>;
|
|
55
80
|
};
|
|
56
81
|
/**
|
|
57
|
-
* TODO: !!!!! Implement new commands
|
|
58
82
|
* Note: There was a proposal for multiple types of promptbook objects 78816ff33e2705ee1a187aa2eb8affd976d4ea1a
|
|
59
83
|
* But then immediately reverted back to the single type
|
|
60
84
|
* With knowledge as part of the promptbook and collection just as a collection of promptbooks
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PromptResultUsage } from '../../execution/PromptResult';
|
|
2
|
+
import type { string_promptbook_version } from '../../version';
|
|
3
|
+
import type { number_id } from '../typeAliases';
|
|
4
|
+
export type PreparationJson = {
|
|
5
|
+
/**
|
|
6
|
+
* Incremental ID of the preparation
|
|
7
|
+
*/
|
|
8
|
+
readonly id: number_id;
|
|
9
|
+
/**
|
|
10
|
+
* Version of the promptbook used for the preparation
|
|
11
|
+
*/
|
|
12
|
+
readonly promptbookVersion: string_promptbook_version;
|
|
13
|
+
/**
|
|
14
|
+
* Usage of the prompt execution
|
|
15
|
+
*/
|
|
16
|
+
readonly modelUsage: PromptResultUsage;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* TODO: Maybe put here used `modelName`
|
|
20
|
+
* TODO: [🍥] When using `date` it changes all samples .ptbk.json files each time so until some more elegant solution omit the time from prepared pipeline
|
|
21
|
+
*/
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PromptTemplateJsonCommon } from './PromptTemplateJsonCommon';
|
|
2
2
|
/**
|
|
3
3
|
* Template for prompt to user
|
|
4
|
+
*
|
|
5
|
+
* @see https://github.com/webgptorg/promptbook/discussions/76
|
|
4
6
|
*/
|
|
5
7
|
export interface PromptDialogJson extends PromptTemplateJsonCommon {
|
|
6
8
|
readonly blockType: 'PROMPT_DIALOG';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ___ } from '
|
|
1
|
+
import type { ___ } from '../../utils/organization/___';
|
|
2
2
|
import type { LlmTemplateJson } from './LlmTemplateJson';
|
|
3
3
|
import type { PromptDialogJson } from './PromptDialogJson';
|
|
4
4
|
import type { ScriptJson } from './ScriptJson';
|
|
@@ -15,7 +15,7 @@ export interface PromptTemplateJsonCommon {
|
|
|
15
15
|
/**
|
|
16
16
|
* Name of the template
|
|
17
17
|
* - It must be unique across the pipeline
|
|
18
|
-
* - It should start uppercase and contain letters and numbers
|
|
18
|
+
* - It should start uppercase and can contain letters and numbers
|
|
19
19
|
* - The pipelineUrl together with hash and name are used to identify the prompt template in the pipeline
|
|
20
20
|
*/
|
|
21
21
|
readonly name: string_name;
|
|
@@ -37,6 +37,8 @@ export interface PromptTemplateJsonCommon {
|
|
|
37
37
|
readonly dependentParameterNames: Array<string_name>;
|
|
38
38
|
/**
|
|
39
39
|
* If theese parameters meet the expectations requirements, they are used instead of executing this prompt template
|
|
40
|
+
*
|
|
41
|
+
* @see https://github.com/webgptorg/promptbook/discussions/66
|
|
40
42
|
*/
|
|
41
43
|
readonly jokers?: Array<string>;
|
|
42
44
|
/**
|
|
@@ -50,6 +52,8 @@ export interface PromptTemplateJsonCommon {
|
|
|
50
52
|
readonly content: (string_prompt | string_javascript | string_markdown) & string_template;
|
|
51
53
|
/**
|
|
52
54
|
* List of postprocessing steps that are executed after the prompt template
|
|
55
|
+
*
|
|
56
|
+
* @see https://github.com/webgptorg/promptbook/discussions/31
|
|
53
57
|
*/
|
|
54
58
|
readonly postprocessing?: Array<string_javascript_name>;
|
|
55
59
|
/**
|
|
@@ -58,12 +62,14 @@ export interface PromptTemplateJsonCommon {
|
|
|
58
62
|
* For example 5 words, 3 sentences, 2 paragraphs, ...
|
|
59
63
|
*
|
|
60
64
|
* Note: Expectations are performed after all postprocessing steps
|
|
65
|
+
* @see https://github.com/webgptorg/promptbook/discussions/30
|
|
61
66
|
*/
|
|
62
67
|
readonly expectations?: Expectations;
|
|
63
68
|
/**
|
|
64
69
|
* Expect this format of the answer
|
|
65
70
|
*
|
|
66
71
|
* Note: Expectations are performed after all postprocessing steps
|
|
72
|
+
* @see https://github.com/webgptorg/promptbook/discussions/30
|
|
67
73
|
* @deprecated [💝]
|
|
68
74
|
*/
|
|
69
75
|
readonly expectFormat?: ExpectFormatCommand['format'];
|
|
@@ -74,4 +80,5 @@ export interface PromptTemplateJsonCommon {
|
|
|
74
80
|
}
|
|
75
81
|
/**
|
|
76
82
|
* TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
|
|
83
|
+
* TODO: [♈] Probbably move expectations from templates to parameters
|
|
77
84
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { string_markdown_text } from '../typeAliases';
|
|
2
|
-
import type {
|
|
2
|
+
import type { string_parameter_name } from '../typeAliases';
|
|
3
|
+
import type { string_parameter_value } from '../typeAliases';
|
|
3
4
|
/**
|
|
4
5
|
* Describes one parameter of the promptbook
|
|
5
6
|
*/
|
|
@@ -9,7 +10,7 @@ export type PromptTemplateParameterJson = {
|
|
|
9
10
|
* - It must be unique across the pipeline
|
|
10
11
|
* - It should start lowercase and contain letters and numbers
|
|
11
12
|
*/
|
|
12
|
-
readonly name:
|
|
13
|
+
readonly name: string_parameter_name;
|
|
13
14
|
/**
|
|
14
15
|
* The parameter is input of the pipeline
|
|
15
16
|
*/
|
|
@@ -23,4 +24,12 @@ export type PromptTemplateParameterJson = {
|
|
|
23
24
|
* - It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
24
25
|
*/
|
|
25
26
|
readonly description?: string_markdown_text;
|
|
27
|
+
/**
|
|
28
|
+
* Sample values of the parameter
|
|
29
|
+
* Note: This values won't be actually used as some default values, but they are just for better understanding of the parameter
|
|
30
|
+
*/
|
|
31
|
+
readonly sampleValues?: Array<string_parameter_value>;
|
|
26
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* TODO: [♈] Probbably move expectations from templates to parameters
|
|
35
|
+
*/
|
|
@@ -2,6 +2,8 @@ import type { ScriptLanguage } from '../ScriptLanguage';
|
|
|
2
2
|
import type { PromptTemplateJsonCommon } from './PromptTemplateJsonCommon';
|
|
3
3
|
/**
|
|
4
4
|
* Template for script execution
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/webgptorg/promptbook/discussions/77
|
|
5
7
|
*/
|
|
6
8
|
export interface ScriptJson extends PromptTemplateJsonCommon {
|
|
7
9
|
readonly blockType: 'SCRIPT';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PromptTemplateJsonCommon } from './PromptTemplateJsonCommon';
|
|
2
2
|
/**
|
|
3
3
|
* Template for simple concatenation of strings
|
|
4
|
+
*
|
|
5
|
+
* @see https://github.com/webgptorg/promptbook/discussions/17
|
|
4
6
|
*/
|
|
5
7
|
export interface SimpleTemplateJson extends PromptTemplateJsonCommon {
|
|
6
8
|
readonly blockType: 'SIMPLE_TEMPLATE';
|
|
@@ -2,13 +2,15 @@ import type { ExpectFormatCommand } from '../commands/EXPECT/ExpectFormatCommand
|
|
|
2
2
|
import type { PostprocessingFunction } from '../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
3
3
|
import type { ModelRequirements } from './ModelRequirements';
|
|
4
4
|
import type { Expectations } from './PipelineJson/Expectations';
|
|
5
|
-
import type {
|
|
5
|
+
import type { string_parameter_name } from './typeAliases';
|
|
6
|
+
import type { string_parameter_value } from './typeAliases';
|
|
6
7
|
import type { string_pipeline_url_with_hashtemplate } from './typeAliases';
|
|
7
8
|
import type { string_prompt } from './typeAliases';
|
|
8
9
|
import type { string_title } from './typeAliases';
|
|
9
10
|
/**
|
|
10
11
|
* Prompt in a text along with model requirements, but without any execution or templating logic.
|
|
11
12
|
*
|
|
13
|
+
* Note: [🛫] This is NOT fully serializable as JSON, it contains functions which are not serializable
|
|
12
14
|
* @see https://github.com/webgptorg/promptbook#prompt
|
|
13
15
|
*/
|
|
14
16
|
export type Prompt = {
|
|
@@ -58,8 +60,9 @@ export type Prompt = {
|
|
|
58
60
|
*
|
|
59
61
|
* Note: This is redundant (same information is in pipelineUrl+content) but useful for logging and debugging
|
|
60
62
|
*/
|
|
61
|
-
readonly parameters: Record<
|
|
63
|
+
readonly parameters: Record<string_parameter_name, string_parameter_value>;
|
|
62
64
|
};
|
|
63
65
|
/**
|
|
64
66
|
* TODO: [✔] Check ModelRequirements in runtime
|
|
67
|
+
* TODO: [🏳] Add options for translation - maybe create `TranslationPrompt`
|
|
65
68
|
*/
|
|
@@ -41,18 +41,18 @@ export type ExecutionReportJson = {
|
|
|
41
41
|
/**
|
|
42
42
|
* The prompt wich was executed
|
|
43
43
|
*/
|
|
44
|
-
prompt: Omit<Prompt, 'pipelineUrl' | 'parameters'>;
|
|
44
|
+
readonly prompt: Omit<Prompt, 'pipelineUrl' | 'parameters'>;
|
|
45
45
|
/**
|
|
46
46
|
* Result of the prompt execution (if not failed during LLM execution)
|
|
47
47
|
*/
|
|
48
|
-
result?: PromptResult;
|
|
48
|
+
readonly result?: PromptResult;
|
|
49
49
|
/**
|
|
50
50
|
* The error which occured during LLM execution or during postprocessing or expectation checking
|
|
51
51
|
*
|
|
52
52
|
* Note: It makes sense to have both error and result defined, for example when the result not pass expectations
|
|
53
53
|
*/
|
|
54
|
-
error?: {
|
|
55
|
-
message: string;
|
|
54
|
+
readonly error?: {
|
|
55
|
+
readonly message: string;
|
|
56
56
|
};
|
|
57
57
|
}>;
|
|
58
58
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { number_percent } from '../typeAliases';
|
|
2
2
|
/**
|
|
3
|
-
* Options for
|
|
3
|
+
* Options for `executionReportJsonToString`
|
|
4
4
|
*/
|
|
5
5
|
export type ExecutionReportStringOptions = {
|
|
6
6
|
/**
|
|
7
7
|
* The tax rate to be applied, expressed as a percentage from 0 to 1 (=100%) or even more
|
|
8
8
|
*/
|
|
9
|
-
taxRate: number_percent;
|
|
9
|
+
readonly taxRate: number_percent;
|
|
10
10
|
/**
|
|
11
11
|
* The width of the charts in the report
|
|
12
12
|
*/
|
|
13
|
-
chartsWidth: number;
|
|
13
|
+
readonly chartsWidth: number;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Default options for generating an execution report string
|
|
@@ -32,6 +32,12 @@ export type string_text_prompt = string_prompt;
|
|
|
32
32
|
* For example `"How many hats does the cat wear?"`
|
|
33
33
|
*/
|
|
34
34
|
export type string_chat_prompt = string_text_prompt;
|
|
35
|
+
/**
|
|
36
|
+
* Semantic helper
|
|
37
|
+
*
|
|
38
|
+
* For example `"You are an AI assistant. You are here to help me with my work."`
|
|
39
|
+
*/
|
|
40
|
+
export type string_system_message = string_text_prompt;
|
|
35
41
|
/**
|
|
36
42
|
* Semantic helper
|
|
37
43
|
*
|
|
@@ -73,6 +79,20 @@ export type string_char = string;
|
|
|
73
79
|
* For example `"ainautes"`
|
|
74
80
|
*/
|
|
75
81
|
export type string_name = string;
|
|
82
|
+
/**
|
|
83
|
+
* Semantic helper
|
|
84
|
+
* Unique identifier of anything
|
|
85
|
+
*
|
|
86
|
+
* For example `"eventName"`
|
|
87
|
+
*/
|
|
88
|
+
export type string_parameter_name = string;
|
|
89
|
+
/**
|
|
90
|
+
* Semantic helper
|
|
91
|
+
* Unique identifier of anything
|
|
92
|
+
*
|
|
93
|
+
* For example `"DevConf 2024"`
|
|
94
|
+
*/
|
|
95
|
+
export type string_parameter_value = string;
|
|
76
96
|
/**
|
|
77
97
|
* Semantic helper
|
|
78
98
|
* Title of anything
|
|
@@ -80,6 +100,23 @@ export type string_name = string;
|
|
|
80
100
|
* For example `"Ai*nautes"`
|
|
81
101
|
*/
|
|
82
102
|
export type string_title = string;
|
|
103
|
+
/**
|
|
104
|
+
* Description of persona
|
|
105
|
+
*
|
|
106
|
+
* For example `"Skilled copywriter"`
|
|
107
|
+
*/
|
|
108
|
+
export type string_persona_description = string;
|
|
109
|
+
/**
|
|
110
|
+
* Source of one knowledge
|
|
111
|
+
*
|
|
112
|
+
* It can be a link, a relative path to file or direct text
|
|
113
|
+
*
|
|
114
|
+
* For example `"https://pavolhejny.com/"`
|
|
115
|
+
* For example `"./pavol-hejny-cv.pdf"`
|
|
116
|
+
* For example `"Pavol Hejný has web https://pavolhejny.com/"`
|
|
117
|
+
* For example `"Pavol Hejný is web developer and creator of Promptbook and Collboard"`
|
|
118
|
+
*/
|
|
119
|
+
export type string_knowledge_source = string_url | string_file_path | string;
|
|
83
120
|
/**
|
|
84
121
|
* Semantic helper
|
|
85
122
|
*
|
|
@@ -428,6 +465,14 @@ export type string_date_iso8601 = `${number}-${number}-${number}${string}${numbe
|
|
|
428
465
|
* Semantic helper for US Dollars
|
|
429
466
|
*/
|
|
430
467
|
export type number_usd = number;
|
|
468
|
+
/**
|
|
469
|
+
* Semantic helper for incremental IDs
|
|
470
|
+
*/
|
|
471
|
+
export type number_id = number_integer & (number_positive | 0);
|
|
472
|
+
/**
|
|
473
|
+
* Semantic helper for number of rows and columns
|
|
474
|
+
*/
|
|
475
|
+
export type number_linecol_number = number_integer & number_positive;
|
|
431
476
|
/**
|
|
432
477
|
* Semantic helper for number of tokens
|
|
433
478
|
*/
|
|
@@ -437,9 +482,22 @@ export type number_negative = number;
|
|
|
437
482
|
export type number_integer = number;
|
|
438
483
|
/**
|
|
439
484
|
* Semantic helper;
|
|
440
|
-
* Percentage from 0 to 1 (100%)
|
|
485
|
+
* Percentage from 0 to 1 (100%) (and bellow and above)
|
|
441
486
|
*/
|
|
442
487
|
export type number_percent = number;
|
|
488
|
+
/**
|
|
489
|
+
* Semantic helper;
|
|
490
|
+
* Model temperature
|
|
491
|
+
*/
|
|
492
|
+
export type number_model_temperature = number_percent;
|
|
493
|
+
/**
|
|
494
|
+
* Semantic helper;
|
|
495
|
+
* Seed for random generator
|
|
496
|
+
*
|
|
497
|
+
* Percentage from 0 to 1 (100%)
|
|
498
|
+
* TODO: Is seed (in OpenAI) number from 0 to 1?
|
|
499
|
+
*/
|
|
500
|
+
export type number_seed = number_percent;
|
|
443
501
|
/**
|
|
444
502
|
* Likeness of the wallpaper
|
|
445
503
|
*
|
|
@@ -462,19 +520,9 @@ export type number_kilobytes = number_positive;
|
|
|
462
520
|
export type number_megabytes = number_positive;
|
|
463
521
|
export type number_gigabytes = number_positive;
|
|
464
522
|
export type number_terabytes = number_positive;
|
|
465
|
-
|
|
466
|
-
*
|
|
467
|
-
*/
|
|
468
|
-
export type ___ = never;
|
|
469
|
-
/**
|
|
470
|
-
* Organizational helper to better mark the place where the type is missing
|
|
471
|
-
*/
|
|
472
|
-
export type TODO = any;
|
|
473
|
-
/**
|
|
474
|
-
* Organizational helper to mark a place where to really use any
|
|
475
|
-
*/
|
|
476
|
-
export type really_any = any;
|
|
477
|
-
/**
|
|
523
|
+
/**.
|
|
524
|
+
* TODO: !!! Change "For example" to @example
|
|
478
525
|
* TODO: !! Cleanup
|
|
479
526
|
* TODO: !! Change to branded types
|
|
527
|
+
* TODO: [📂] Export all this file through `@promptbook/types`
|
|
480
528
|
*/
|
|
@@ -5,15 +5,15 @@ export type FromtoItems = Array<{
|
|
|
5
5
|
/**
|
|
6
6
|
* The title of the item
|
|
7
7
|
*/
|
|
8
|
-
title: string;
|
|
8
|
+
readonly title: string;
|
|
9
9
|
/**
|
|
10
10
|
* The start of the item
|
|
11
11
|
*
|
|
12
12
|
* This can mean anything, like seconds, milliseconds, dollars, etc.
|
|
13
13
|
*/
|
|
14
|
-
from: number;
|
|
14
|
+
readonly from: number;
|
|
15
15
|
/**
|
|
16
16
|
* The end of the item
|
|
17
17
|
*/
|
|
18
|
-
to: number;
|
|
18
|
+
readonly to: number;
|
|
19
19
|
}>;
|
|
@@ -6,6 +6,6 @@ import type { string_name } from '../../types/typeAliases';
|
|
|
6
6
|
* @private within the package
|
|
7
7
|
*/
|
|
8
8
|
export declare function addAutoGeneratedSection(content: string_markdown, options: {
|
|
9
|
-
sectionName: string_name;
|
|
10
|
-
sectionContent: string_markdown;
|
|
9
|
+
readonly sectionName: string_name;
|
|
10
|
+
readonly sectionContent: string_markdown;
|
|
11
11
|
}): string_markdown;
|
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
import type { string_markdown } from '../../types/typeAliases';
|
|
2
2
|
import type { FromtoItems } from '../FromtoItems';
|
|
3
3
|
/**
|
|
4
|
-
* Options for
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Options for creating a markdown chart.
|
|
4
|
+
* Options for `CreateMarkdownChartOptions`
|
|
8
5
|
*/
|
|
9
6
|
type CreateMarkdownChartOptions = {
|
|
10
7
|
/**
|
|
11
8
|
* The header for the first column - the name of the item
|
|
12
9
|
*/
|
|
13
|
-
nameHeader: string;
|
|
10
|
+
readonly nameHeader: string;
|
|
14
11
|
/**
|
|
15
12
|
* The header for the second column - the value of the item
|
|
16
13
|
*/
|
|
17
|
-
valueHeader: string;
|
|
14
|
+
readonly valueHeader: string;
|
|
18
15
|
/**
|
|
19
16
|
* The items to be charted
|
|
20
17
|
*/
|
|
21
|
-
items: FromtoItems;
|
|
18
|
+
readonly items: FromtoItems;
|
|
22
19
|
/**
|
|
23
20
|
* The width of the chart in squares
|
|
24
21
|
*/
|
|
25
|
-
width: number;
|
|
22
|
+
readonly width: number;
|
|
26
23
|
/**
|
|
27
24
|
* The name of the unit shown in the chart
|
|
28
25
|
*/
|
|
29
|
-
unitName: string;
|
|
26
|
+
readonly unitName: string;
|
|
30
27
|
};
|
|
31
28
|
/**
|
|
32
29
|
* Function createMarkdownChart will draw a chart in markdown from ⬛+🟦 tiles
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,14 +3,18 @@ import type { string_markdown } from '../../types/typeAliases';
|
|
|
3
3
|
* Single code block inside markdown.
|
|
4
4
|
*/
|
|
5
5
|
export type CodeBlock = {
|
|
6
|
+
/**
|
|
7
|
+
* Which notation was used to open the code block
|
|
8
|
+
*/
|
|
9
|
+
readonly blockNotation: '```' | '>';
|
|
6
10
|
/**
|
|
7
11
|
* Language of the code block OR null if the language is not specified in opening ```
|
|
8
12
|
*/
|
|
9
|
-
language: string | null;
|
|
13
|
+
readonly language: string | null;
|
|
10
14
|
/**
|
|
11
15
|
* Content of the code block (unescaped)
|
|
12
16
|
*/
|
|
13
|
-
content: string;
|
|
17
|
+
readonly content: string;
|
|
14
18
|
};
|
|
15
19
|
/**
|
|
16
20
|
* Extracts all code blocks from markdown.
|
|
@@ -25,3 +29,6 @@ export type CodeBlock = {
|
|
|
25
29
|
*
|
|
26
30
|
*/
|
|
27
31
|
export declare function extractAllBlocksFromMarkdown(markdown: string_markdown): Array<CodeBlock>;
|
|
32
|
+
/**
|
|
33
|
+
* TODO: Maybe name for `blockNotation` instead of '```' and '>'
|
|
34
|
+
*/
|
|
@@ -15,5 +15,5 @@ import type { CodeBlock } from './extractAllBlocksFromMarkdown';
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function extractOneBlockFromMarkdown(markdown: string_markdown): CodeBlock;
|
|
17
17
|
/***
|
|
18
|
-
* TODO: [🍓][🌻]
|
|
18
|
+
* TODO: [🍓][🌻] Decide of this is internal util, external util OR validator/postprocessor
|
|
19
19
|
*/
|
|
@@ -8,15 +8,15 @@ export type MarkdownSection = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Title of the section
|
|
10
10
|
*/
|
|
11
|
-
title: string_markdown_text;
|
|
11
|
+
readonly title: string_markdown_text;
|
|
12
12
|
/**
|
|
13
13
|
* Level of the section like h1, h2, h3, h4, h5, h6
|
|
14
14
|
*/
|
|
15
|
-
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
15
|
+
readonly level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
16
16
|
/**
|
|
17
17
|
* Content of the section with markdown formatting, blocks, lists, etc.
|
|
18
18
|
*/
|
|
19
|
-
content: string_markdown_section_content;
|
|
19
|
+
readonly content: string_markdown_section_content;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Parses markdown section to title its level and content
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { really_any } from './really_any';
|
|
2
|
+
/**
|
|
3
|
+
* Just marks a place of place where should be something implemented
|
|
4
|
+
* No side effects.
|
|
5
|
+
*
|
|
6
|
+
* Note: It can be usefull suppressing eslint errors of unused variables
|
|
7
|
+
*
|
|
8
|
+
* @param value any values
|
|
9
|
+
* @returns void
|
|
10
|
+
*/
|
|
11
|
+
export declare function TODO_USE(...value: Array<really_any>): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { really_any } from './really_any';
|
|
2
|
+
/**
|
|
3
|
+
* Just says that the variable is not used
|
|
4
|
+
* No side effects.
|
|
5
|
+
*
|
|
6
|
+
* Note: It can be usefull suppressing eslint errors of unused variables in the tests
|
|
7
|
+
*
|
|
8
|
+
* @param value any values
|
|
9
|
+
* @returns void
|
|
10
|
+
*/
|
|
11
|
+
export declare function notUsing(...value: Array<really_any>): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/openai",
|
|
3
|
-
"version": "0.61.0-
|
|
3
|
+
"version": "0.61.0-11",
|
|
4
4
|
"description": "Supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
],
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@promptbook/core": "0.61.0-
|
|
52
|
+
"@promptbook/core": "0.61.0-11"
|
|
53
53
|
},
|
|
54
54
|
"main": "./umd/index.umd.js",
|
|
55
55
|
"module": "./esm/index.es.js",
|
package/umd/index.umd.js
CHANGED
|
@@ -464,6 +464,7 @@
|
|
|
464
464
|
* @see /other/playground/playground.ts
|
|
465
465
|
* TODO: [🍓] Make better
|
|
466
466
|
* TODO: Change model titles to human eg: "gpt-4-turbo-2024-04-09" -> "GPT-4 Turbo (2024-04-09)"
|
|
467
|
+
* TODO: [🚸] Not all models are compatible with JSON mode, add this information here and use it
|
|
467
468
|
*/
|
|
468
469
|
|
|
469
470
|
/**
|
|
@@ -939,6 +940,7 @@
|
|
|
939
940
|
model: model,
|
|
940
941
|
max_tokens: modelRequirements.maxTokens,
|
|
941
942
|
// <- TODO: Make some global max cap for maxTokens
|
|
943
|
+
// <- TODO: !!!!! Use here `systemMessage`, `temperature` and `seed`
|
|
942
944
|
};
|
|
943
945
|
if (expectFormat === 'JSON') {
|
|
944
946
|
modelSettings.response_format = {
|
|
@@ -1012,6 +1014,7 @@
|
|
|
1012
1014
|
model: model,
|
|
1013
1015
|
max_tokens: modelRequirements.maxTokens || 2000, // <- Note: 2000 is for lagacy reasons
|
|
1014
1016
|
// <- TODO: Make some global max cap for maxTokens
|
|
1017
|
+
// <- TODO: !!!!! Use here `systemMessage`, `temperature` and `seed`
|
|
1015
1018
|
};
|
|
1016
1019
|
rawRequest = __assign(__assign({}, modelSettings), { prompt: content, user: this.options.user });
|
|
1017
1020
|
start = getCurrentIsoDate();
|
|
@@ -1167,7 +1170,7 @@
|
|
|
1167
1170
|
/**
|
|
1168
1171
|
* The version of the Promptbook library
|
|
1169
1172
|
*/
|
|
1170
|
-
var PROMPTBOOK_VERSION = '0.61.0-
|
|
1173
|
+
var PROMPTBOOK_VERSION = '0.61.0-10';
|
|
1171
1174
|
// TODO: !!!! List here all the versions and annotate + put into script
|
|
1172
1175
|
|
|
1173
1176
|
exports.OPENAI_MODELS = OPENAI_MODELS;
|