@promptbook/markdown-utils 0.81.0-9 → 0.82.0-0
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 +25 -4
- package/esm/index.es.js +143 -61
- package/esm/index.es.js.map +1 -1
- package/esm/typings/books/index.d.ts +38 -0
- package/esm/typings/src/_packages/core.index.d.ts +12 -4
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +2 -2
- package/esm/typings/src/_packages/node.index.d.ts +0 -2
- package/esm/typings/src/_packages/remote-client.index.d.ts +7 -3
- package/esm/typings/src/_packages/remote-server.index.d.ts +2 -2
- package/esm/typings/src/_packages/templates.index.d.ts +2 -2
- package/esm/typings/src/_packages/types.index.d.ts +32 -30
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/_packages/wizzard.index.d.ts +44 -0
- package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/run.d.ts +2 -2
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +11 -0
- package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
- package/esm/typings/src/commands/index.d.ts +1 -1
- package/esm/typings/src/config.d.ts +3 -3
- package/esm/typings/src/conversion/compilePipeline.d.ts +1 -4
- package/esm/typings/src/conversion/compilePipelineOnRemoteServer.d.ts +18 -0
- package/esm/typings/src/conversion/{precompilePipeline.d.ts → parsePipeline.d.ts} +3 -3
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +3 -3
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +7 -7
- package/esm/typings/src/errors/utils/getErrorReportUrl.d.ts +1 -1
- package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +9 -4
- package/esm/typings/src/formfactors/image-generator/ImageGeneratorFormfactorDefinition.d.ts +24 -0
- package/esm/typings/src/formfactors/index.d.ts +31 -9
- package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +1 -1
- package/esm/typings/src/high-level-abstractions/index.d.ts +3 -3
- package/esm/typings/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +3 -0
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/register/{$provideLlmToolsForCli.d.ts → $provideLlmToolsForWizzardOrCli.d.ts} +2 -2
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
- 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 +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +2 -2
- package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +2 -2
- package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +1 -0
- package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +2 -0
- package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +1 -0
- package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +1 -0
- package/esm/typings/src/llm-providers/google/register-configuration.d.ts +1 -0
- package/esm/typings/src/llm-providers/google/register-constructor.d.ts +1 -0
- package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -0
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/vercel/playground/playground.d.ts +1 -1
- package/esm/typings/src/other/templates/getBookTemplates.d.ts +22 -0
- package/esm/typings/src/personas/preparePersona.d.ts +4 -4
- package/esm/typings/src/pipeline/PipelineString.d.ts +0 -3
- package/esm/typings/src/pipeline/book-notation.d.ts +14 -0
- package/esm/typings/src/pipeline/isValidPipelineString.d.ts +13 -0
- package/esm/typings/src/pipeline/isValidPipelineString.test.d.ts +4 -0
- package/esm/typings/src/pipeline/validatePipelineString.d.ts +14 -0
- package/esm/typings/src/prepare/isPipelinePrepared.d.ts +3 -1
- package/esm/typings/src/prepare/preparePipeline.d.ts +4 -2
- package/esm/typings/src/prepare/preparePipelineOnRemoteServer.d.ts +14 -0
- package/esm/typings/src/prepare/prepareTasks.d.ts +1 -1
- package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_Error.d.ts +1 -1
- package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_ListModels_Request.d.ts +4 -4
- package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_ListModels_Response.d.ts +1 -1
- package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_Prompt_Progress.d.ts +1 -1
- package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_Prompt_Request.d.ts +5 -5
- package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/PromptbookServer_Prompt_Response.d.ts +1 -1
- package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/RemoteLlmExecutionToolsOptions.d.ts +7 -7
- package/esm/typings/src/{llm-providers/remote → remote-server}/interfaces/RemoteServerOptions.d.ts +10 -10
- package/esm/typings/src/scrapers/_common/Converter.d.ts +1 -0
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +3 -0
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +2 -0
- package/esm/typings/src/scrapers/_common/utils/scraperFetch.d.ts +3 -0
- package/esm/typings/src/scrapers/document/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -0
- package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -0
- package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -0
- package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +1 -0
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +2 -1
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -1
- package/esm/typings/src/scrapers/website/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -0
- package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +2 -1
- package/esm/typings/src/types/typeAliases.d.ts +8 -2
- package/esm/typings/src/utils/markdown/flattenMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/markdown/{removeContentComments.d.ts → removeMarkdownComments.d.ts} +2 -2
- package/esm/typings/src/utils/organization/$sideEffect.d.ts +9 -0
- package/esm/typings/src/utils/serialization/checkSerializableAsJson.d.ts +1 -1
- package/esm/typings/src/utils/serialization/isSerializableAsJson.d.ts +2 -2
- package/esm/typings/src/utils/validators/filePath/isRootPath.d.ts +12 -0
- package/esm/typings/src/utils/validators/filePath/isRootPath.test.d.ts +4 -0
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +3 -0
- package/esm/typings/src/wizzard/$getCompiledBook.d.ts +16 -0
- package/esm/typings/src/wizzard/wizzard.d.ts +51 -7
- package/package.json +1 -1
- package/umd/index.umd.js +143 -61
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/other/templates/getBookTemplate.d.ts +0 -21
- package/esm/typings/src/scripting/javascript/utils/unknownToString.d.ts +0 -8
- /package/esm/typings/src/conversion/{precompilePipeline.test.d.ts → parsePipeline.test.d.ts} +0 -0
- /package/esm/typings/src/{llm-providers/remote → remote-server}/startRemoteServer.d.ts +0 -0
- /package/esm/typings/src/utils/markdown/{removeContentComments.test.d.ts → removeMarkdownComments.test.d.ts} +0 -0
|
@@ -89,5 +89,43 @@ declare const _default: ({
|
|
|
89
89
|
content: string;
|
|
90
90
|
}[];
|
|
91
91
|
sourceFile: string;
|
|
92
|
+
} | {
|
|
93
|
+
title: string;
|
|
94
|
+
pipelineUrl: string;
|
|
95
|
+
formfactorName: string;
|
|
96
|
+
parameters: {
|
|
97
|
+
name: string;
|
|
98
|
+
description: string;
|
|
99
|
+
isInput: boolean;
|
|
100
|
+
isOutput: boolean;
|
|
101
|
+
}[];
|
|
102
|
+
tasks: {
|
|
103
|
+
taskType: string;
|
|
104
|
+
name: string;
|
|
105
|
+
title: string;
|
|
106
|
+
content: string;
|
|
107
|
+
resultingParameterName: string;
|
|
108
|
+
expectations: {
|
|
109
|
+
words: {
|
|
110
|
+
min: number;
|
|
111
|
+
max: number;
|
|
112
|
+
};
|
|
113
|
+
lines: {
|
|
114
|
+
min: number;
|
|
115
|
+
max: number;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
dependentParameterNames: string[];
|
|
119
|
+
}[];
|
|
120
|
+
personas: never[];
|
|
121
|
+
preparations: never[];
|
|
122
|
+
knowledgeSources: never[];
|
|
123
|
+
knowledgePieces: never[];
|
|
124
|
+
sources: {
|
|
125
|
+
type: string;
|
|
126
|
+
path: null;
|
|
127
|
+
content: string;
|
|
128
|
+
}[];
|
|
129
|
+
sourceFile: string;
|
|
92
130
|
})[];
|
|
93
131
|
export default _default;
|
|
@@ -10,7 +10,7 @@ import { ADMIN_GITHUB_NAME } from '../config';
|
|
|
10
10
|
import { CLAIM } from '../config';
|
|
11
11
|
import { LOGO_LIGHT_SRC } from '../config';
|
|
12
12
|
import { LOGO_DARK_SRC } from '../config';
|
|
13
|
-
import {
|
|
13
|
+
import { DEFAULT_BOOK_TITLE } from '../config';
|
|
14
14
|
import { MAX_FILENAME_LENGTH } from '../config';
|
|
15
15
|
import { DEFAULT_INTERMEDIATE_FILES_STRATEGY } from '../config';
|
|
16
16
|
import { DEFAULT_MAX_PARALLEL_COUNT } from '../config';
|
|
@@ -31,8 +31,8 @@ import { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME } from '../config';
|
|
|
31
31
|
import { ORDER_OF_PIPELINE_JSON } from '../constants';
|
|
32
32
|
import { RESERVED_PARAMETER_NAMES } from '../constants';
|
|
33
33
|
import { compilePipeline } from '../conversion/compilePipeline';
|
|
34
|
+
import { parsePipeline } from '../conversion/parsePipeline';
|
|
34
35
|
import { pipelineJsonToString } from '../conversion/pipelineJsonToString';
|
|
35
|
-
import { precompilePipeline } from '../conversion/precompilePipeline';
|
|
36
36
|
import { prettifyPipelineString } from '../conversion/prettify/prettifyPipelineString';
|
|
37
37
|
import { extractParameterNamesFromTask } from '../conversion/utils/extractParameterNamesFromTask';
|
|
38
38
|
import { validatePipeline } from '../conversion/validation/validatePipeline';
|
|
@@ -74,6 +74,7 @@ import { BoilerplateFormfactorDefinition } from '../formfactors/_boilerplate/Boi
|
|
|
74
74
|
import { ChatbotFormfactorDefinition } from '../formfactors/chatbot/ChatbotFormfactorDefinition';
|
|
75
75
|
import { GeneratorFormfactorDefinition } from '../formfactors/generator/GeneratorFormfactorDefinition';
|
|
76
76
|
import { GenericFormfactorDefinition } from '../formfactors/generic/GenericFormfactorDefinition';
|
|
77
|
+
import { ImageGeneratorFormfactorDefinition } from '../formfactors/image-generator/ImageGeneratorFormfactorDefinition';
|
|
77
78
|
import { FORMFACTOR_DEFINITIONS } from '../formfactors/index';
|
|
78
79
|
import { MatcherFormfactorDefinition } from '../formfactors/matcher/MatcherFormfactorDefinition';
|
|
79
80
|
import { SheetsFormfactorDefinition } from '../formfactors/sheets/SheetsFormfactorDefinition';
|
|
@@ -92,11 +93,14 @@ import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlm
|
|
|
92
93
|
import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
93
94
|
import { _OpenAiAssistantMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
94
95
|
import { preparePersona } from '../personas/preparePersona';
|
|
96
|
+
import { book } from '../pipeline/book-notation';
|
|
97
|
+
import { isValidPipelineString } from '../pipeline/isValidPipelineString';
|
|
95
98
|
import { GENERIC_PIPELINE_INTERFACE } from '../pipeline/PipelineInterface/constants';
|
|
96
99
|
import { getPipelineInterface } from '../pipeline/PipelineInterface/getPipelineInterface';
|
|
97
100
|
import { isPipelineImplementingInterface } from '../pipeline/PipelineInterface/isPipelineImplementingInterface';
|
|
98
101
|
import { isPipelineInterfacesEqual } from '../pipeline/PipelineInterface/isPipelineInterfacesEqual';
|
|
99
102
|
import { EXPECTATION_UNITS } from '../pipeline/PipelineJson/Expectations';
|
|
103
|
+
import { validatePipelineString } from '../pipeline/validatePipelineString';
|
|
100
104
|
import { isPipelinePrepared } from '../prepare/isPipelinePrepared';
|
|
101
105
|
import { preparePipeline } from '../prepare/preparePipeline';
|
|
102
106
|
import { prepareTasks } from '../prepare/prepareTasks';
|
|
@@ -129,7 +133,7 @@ export { ADMIN_GITHUB_NAME };
|
|
|
129
133
|
export { CLAIM };
|
|
130
134
|
export { LOGO_LIGHT_SRC };
|
|
131
135
|
export { LOGO_DARK_SRC };
|
|
132
|
-
export {
|
|
136
|
+
export { DEFAULT_BOOK_TITLE };
|
|
133
137
|
export { MAX_FILENAME_LENGTH };
|
|
134
138
|
export { DEFAULT_INTERMEDIATE_FILES_STRATEGY };
|
|
135
139
|
export { DEFAULT_MAX_PARALLEL_COUNT };
|
|
@@ -150,8 +154,8 @@ export { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME };
|
|
|
150
154
|
export { ORDER_OF_PIPELINE_JSON };
|
|
151
155
|
export { RESERVED_PARAMETER_NAMES };
|
|
152
156
|
export { compilePipeline };
|
|
157
|
+
export { parsePipeline };
|
|
153
158
|
export { pipelineJsonToString };
|
|
154
|
-
export { precompilePipeline };
|
|
155
159
|
export { prettifyPipelineString };
|
|
156
160
|
export { extractParameterNamesFromTask };
|
|
157
161
|
export { validatePipeline };
|
|
@@ -193,6 +197,7 @@ export { BoilerplateFormfactorDefinition };
|
|
|
193
197
|
export { ChatbotFormfactorDefinition };
|
|
194
198
|
export { GeneratorFormfactorDefinition };
|
|
195
199
|
export { GenericFormfactorDefinition };
|
|
200
|
+
export { ImageGeneratorFormfactorDefinition };
|
|
196
201
|
export { FORMFACTOR_DEFINITIONS };
|
|
197
202
|
export { MatcherFormfactorDefinition };
|
|
198
203
|
export { SheetsFormfactorDefinition };
|
|
@@ -211,11 +216,14 @@ export { MultipleLlmExecutionTools };
|
|
|
211
216
|
export { _OpenAiMetadataRegistration };
|
|
212
217
|
export { _OpenAiAssistantMetadataRegistration };
|
|
213
218
|
export { preparePersona };
|
|
219
|
+
export { book };
|
|
220
|
+
export { isValidPipelineString };
|
|
214
221
|
export { GENERIC_PIPELINE_INTERFACE };
|
|
215
222
|
export { getPipelineInterface };
|
|
216
223
|
export { isPipelineImplementingInterface };
|
|
217
224
|
export { isPipelineInterfacesEqual };
|
|
218
225
|
export { EXPECTATION_UNITS };
|
|
226
|
+
export { validatePipelineString };
|
|
219
227
|
export { isPipelinePrepared };
|
|
220
228
|
export { preparePipeline };
|
|
221
229
|
export { prepareTasks };
|
|
@@ -19,7 +19,7 @@ import { extractOneBlockFromMarkdown } from '../utils/markdown/extractOneBlockFr
|
|
|
19
19
|
import { flattenMarkdown } from '../utils/markdown/flattenMarkdown';
|
|
20
20
|
import type { MarkdownSection } from '../utils/markdown/parseMarkdownSection';
|
|
21
21
|
import { parseMarkdownSection } from '../utils/markdown/parseMarkdownSection';
|
|
22
|
-
import {
|
|
22
|
+
import { removeMarkdownComments } from '../utils/markdown/removeMarkdownComments';
|
|
23
23
|
import { removeMarkdownFormatting } from '../utils/markdown/removeMarkdownFormatting';
|
|
24
24
|
import { splitMarkdownIntoSections } from '../utils/markdown/splitMarkdownIntoSections';
|
|
25
25
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
@@ -43,6 +43,6 @@ export { extractOneBlockFromMarkdown };
|
|
|
43
43
|
export { flattenMarkdown };
|
|
44
44
|
export type { MarkdownSection };
|
|
45
45
|
export { parseMarkdownSection };
|
|
46
|
-
export {
|
|
46
|
+
export { removeMarkdownComments };
|
|
47
47
|
export { removeMarkdownFormatting };
|
|
48
48
|
export { splitMarkdownIntoSections };
|
|
@@ -9,7 +9,6 @@ import { $provideScrapersForNode } from '../scrapers/_common/register/$provideSc
|
|
|
9
9
|
import { FileCacheStorage } from '../storage/file-cache-storage/FileCacheStorage';
|
|
10
10
|
import { $execCommand } from '../utils/execCommand/$execCommand';
|
|
11
11
|
import { $execCommands } from '../utils/execCommand/$execCommands';
|
|
12
|
-
import { wizzard } from '../wizzard/wizzard';
|
|
13
12
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
14
13
|
export { createCollectionFromDirectory };
|
|
15
14
|
export { $provideExecutablesForNode };
|
|
@@ -21,4 +20,3 @@ export { $provideScrapersForNode };
|
|
|
21
20
|
export { FileCacheStorage };
|
|
22
21
|
export { $execCommand };
|
|
23
22
|
export { $execCommands };
|
|
24
|
-
export { wizzard };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
-
import
|
|
3
|
-
import type { RemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
|
|
2
|
+
import { compilePipelineOnRemoteServer } from '../conversion/compilePipelineOnRemoteServer';
|
|
4
3
|
import { RemoteLlmExecutionTools } from '../llm-providers/remote/RemoteLlmExecutionTools';
|
|
4
|
+
import { preparePipelineOnRemoteServer } from '../prepare/preparePipelineOnRemoteServer';
|
|
5
|
+
import type { RemoteLlmExecutionToolsOptions } from '../remote-server/interfaces/RemoteLlmExecutionToolsOptions';
|
|
6
|
+
import type { RemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions';
|
|
5
7
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
8
|
+
export { compilePipelineOnRemoteServer };
|
|
9
|
+
export { RemoteLlmExecutionTools };
|
|
10
|
+
export { preparePipelineOnRemoteServer };
|
|
6
11
|
export type { RemoteLlmExecutionToolsOptions };
|
|
7
12
|
export type { RemoteServerOptions };
|
|
8
|
-
export { RemoteLlmExecutionTools };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
-
import type { RemoteServerOptions } from '../
|
|
3
|
-
import { startRemoteServer } from '../
|
|
2
|
+
import type { RemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions';
|
|
3
|
+
import { startRemoteServer } from '../remote-server/startRemoteServer';
|
|
4
4
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
5
5
|
export type { RemoteServerOptions };
|
|
6
6
|
export { startRemoteServer };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
-
import {
|
|
2
|
+
import { getBookTemplates } from '../other/templates/getBookTemplates';
|
|
3
3
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
4
|
-
export {
|
|
4
|
+
export { getBookTemplates };
|
|
@@ -60,21 +60,6 @@ import type { AzureOpenAiExecutionToolsOptions } from '../llm-providers/azure-op
|
|
|
60
60
|
import type { GoogleExecutionToolsOptions } from '../llm-providers/google/GoogleExecutionToolsOptions';
|
|
61
61
|
import type { OpenAiAssistantExecutionToolsOptions } from '../llm-providers/openai/OpenAiAssistantExecutionToolsOptions';
|
|
62
62
|
import type { OpenAiExecutionToolsOptions } from '../llm-providers/openai/OpenAiExecutionToolsOptions';
|
|
63
|
-
import type { PromptbookServer_Error } from '../llm-providers/remote/interfaces/PromptbookServer_Error';
|
|
64
|
-
import type { PromptbookServer_ListModels_Request } from '../llm-providers/remote/interfaces/PromptbookServer_ListModels_Request';
|
|
65
|
-
import type { PromptbookServer_ListModels_CollectionRequest } from '../llm-providers/remote/interfaces/PromptbookServer_ListModels_Request';
|
|
66
|
-
import type { PromptbookServer_ListModels_AnonymousRequest } from '../llm-providers/remote/interfaces/PromptbookServer_ListModels_Request';
|
|
67
|
-
import type { PromptbookServer_ListModels_Response } from '../llm-providers/remote/interfaces/PromptbookServer_ListModels_Response';
|
|
68
|
-
import type { PromptbookServer_Prompt_Progress } from '../llm-providers/remote/interfaces/PromptbookServer_Prompt_Progress';
|
|
69
|
-
import type { PromptbookServer_Prompt_Request } from '../llm-providers/remote/interfaces/PromptbookServer_Prompt_Request';
|
|
70
|
-
import type { PromptbookServer_Prompt_CollectionRequest } from '../llm-providers/remote/interfaces/PromptbookServer_Prompt_Request';
|
|
71
|
-
import type { PromptbookServer_Prompt_AnonymousRequest } from '../llm-providers/remote/interfaces/PromptbookServer_Prompt_Request';
|
|
72
|
-
import type { PromptbookServer_Prompt_Response } from '../llm-providers/remote/interfaces/PromptbookServer_Prompt_Response';
|
|
73
|
-
import type { RemoteLlmExecutionToolsOptions } from '../llm-providers/remote/interfaces/RemoteLlmExecutionToolsOptions';
|
|
74
|
-
import type { RemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
|
|
75
|
-
import type { AnonymousRemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
|
|
76
|
-
import type { CollectionRemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
|
|
77
|
-
import type { CollectionRemoteServerClientOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
|
|
78
63
|
import type { VercelExecutionToolsOptions } from '../llm-providers/vercel/VercelExecutionToolsOptions';
|
|
79
64
|
import type { VercelProvider } from '../llm-providers/vercel/VercelProvider';
|
|
80
65
|
import type { IsPipelineImplementingInterfaceOptions } from '../pipeline/PipelineInterface/isPipelineImplementingInterface';
|
|
@@ -102,6 +87,21 @@ import type { SimpleTaskJson } from '../pipeline/PipelineJson/SimpleTaskJson';
|
|
|
102
87
|
import type { TaskJson } from '../pipeline/PipelineJson/TaskJson';
|
|
103
88
|
import type { PipelineString } from '../pipeline/PipelineString';
|
|
104
89
|
import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions';
|
|
90
|
+
import type { PromptbookServer_Error } from '../remote-server/interfaces/PromptbookServer_Error';
|
|
91
|
+
import type { PromptbookServer_ListModels_Request } from '../remote-server/interfaces/PromptbookServer_ListModels_Request';
|
|
92
|
+
import type { PromptbookServer_ListModels_CollectionRequest } from '../remote-server/interfaces/PromptbookServer_ListModels_Request';
|
|
93
|
+
import type { PromptbookServer_ListModels_AnonymousRequest } from '../remote-server/interfaces/PromptbookServer_ListModels_Request';
|
|
94
|
+
import type { PromptbookServer_ListModels_Response } from '../remote-server/interfaces/PromptbookServer_ListModels_Response';
|
|
95
|
+
import type { PromptbookServer_Prompt_Progress } from '../remote-server/interfaces/PromptbookServer_Prompt_Progress';
|
|
96
|
+
import type { PromptbookServer_Prompt_Request } from '../remote-server/interfaces/PromptbookServer_Prompt_Request';
|
|
97
|
+
import type { PromptbookServer_Prompt_CollectionRequest } from '../remote-server/interfaces/PromptbookServer_Prompt_Request';
|
|
98
|
+
import type { PromptbookServer_Prompt_AnonymousRequest } from '../remote-server/interfaces/PromptbookServer_Prompt_Request';
|
|
99
|
+
import type { PromptbookServer_Prompt_Response } from '../remote-server/interfaces/PromptbookServer_Prompt_Response';
|
|
100
|
+
import type { RemoteLlmExecutionToolsOptions } from '../remote-server/interfaces/RemoteLlmExecutionToolsOptions';
|
|
101
|
+
import type { RemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions';
|
|
102
|
+
import type { AnonymousRemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions';
|
|
103
|
+
import type { ApplicationRemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions';
|
|
104
|
+
import type { ApplicationRemoteServerClientOptions } from '../remote-server/interfaces/RemoteServerOptions';
|
|
105
105
|
import type { Converter } from '../scrapers/_common/Converter';
|
|
106
106
|
import type { ScraperAndConverterMetadata } from '../scrapers/_common/register/ScraperAndConverterMetadata';
|
|
107
107
|
import type { ScraperConstructor } from '../scrapers/_common/register/ScraperConstructor';
|
|
@@ -172,6 +172,7 @@ import type { string_css_value } from '../types/typeAliases';
|
|
|
172
172
|
import type { string_css_selector } from '../types/typeAliases';
|
|
173
173
|
import type { string_url } from '../types/typeAliases';
|
|
174
174
|
import type { string_base_url } from '../types/typeAliases';
|
|
175
|
+
import type { string_pipeline_root_url } from '../types/typeAliases';
|
|
175
176
|
import type { string_pipeline_url } from '../types/typeAliases';
|
|
176
177
|
import type { string_pipeline_url_with_task_hash } from '../types/typeAliases';
|
|
177
178
|
import type { string_data_url } from '../types/typeAliases';
|
|
@@ -325,21 +326,6 @@ export type { AzureOpenAiExecutionToolsOptions };
|
|
|
325
326
|
export type { GoogleExecutionToolsOptions };
|
|
326
327
|
export type { OpenAiAssistantExecutionToolsOptions };
|
|
327
328
|
export type { OpenAiExecutionToolsOptions };
|
|
328
|
-
export type { PromptbookServer_Error };
|
|
329
|
-
export type { PromptbookServer_ListModels_Request };
|
|
330
|
-
export type { PromptbookServer_ListModels_CollectionRequest };
|
|
331
|
-
export type { PromptbookServer_ListModels_AnonymousRequest };
|
|
332
|
-
export type { PromptbookServer_ListModels_Response };
|
|
333
|
-
export type { PromptbookServer_Prompt_Progress };
|
|
334
|
-
export type { PromptbookServer_Prompt_Request };
|
|
335
|
-
export type { PromptbookServer_Prompt_CollectionRequest };
|
|
336
|
-
export type { PromptbookServer_Prompt_AnonymousRequest };
|
|
337
|
-
export type { PromptbookServer_Prompt_Response };
|
|
338
|
-
export type { RemoteLlmExecutionToolsOptions };
|
|
339
|
-
export type { RemoteServerOptions };
|
|
340
|
-
export type { AnonymousRemoteServerOptions };
|
|
341
|
-
export type { CollectionRemoteServerOptions };
|
|
342
|
-
export type { CollectionRemoteServerClientOptions };
|
|
343
329
|
export type { VercelExecutionToolsOptions };
|
|
344
330
|
export type { VercelProvider };
|
|
345
331
|
export type { IsPipelineImplementingInterfaceOptions };
|
|
@@ -367,6 +353,21 @@ export type { SimpleTaskJson };
|
|
|
367
353
|
export type { TaskJson };
|
|
368
354
|
export type { PipelineString };
|
|
369
355
|
export type { PrepareAndScrapeOptions };
|
|
356
|
+
export type { PromptbookServer_Error };
|
|
357
|
+
export type { PromptbookServer_ListModels_Request };
|
|
358
|
+
export type { PromptbookServer_ListModels_CollectionRequest };
|
|
359
|
+
export type { PromptbookServer_ListModels_AnonymousRequest };
|
|
360
|
+
export type { PromptbookServer_ListModels_Response };
|
|
361
|
+
export type { PromptbookServer_Prompt_Progress };
|
|
362
|
+
export type { PromptbookServer_Prompt_Request };
|
|
363
|
+
export type { PromptbookServer_Prompt_CollectionRequest };
|
|
364
|
+
export type { PromptbookServer_Prompt_AnonymousRequest };
|
|
365
|
+
export type { PromptbookServer_Prompt_Response };
|
|
366
|
+
export type { RemoteLlmExecutionToolsOptions };
|
|
367
|
+
export type { RemoteServerOptions };
|
|
368
|
+
export type { AnonymousRemoteServerOptions };
|
|
369
|
+
export type { ApplicationRemoteServerOptions };
|
|
370
|
+
export type { ApplicationRemoteServerClientOptions };
|
|
370
371
|
export type { Converter };
|
|
371
372
|
export type { ScraperAndConverterMetadata };
|
|
372
373
|
export type { ScraperConstructor };
|
|
@@ -437,6 +438,7 @@ export type { string_css_value };
|
|
|
437
438
|
export type { string_css_selector };
|
|
438
439
|
export type { string_url };
|
|
439
440
|
export type { string_base_url };
|
|
441
|
+
export type { string_pipeline_root_url };
|
|
440
442
|
export type { string_pipeline_url };
|
|
441
443
|
export type { string_pipeline_url_with_task_hash };
|
|
442
444
|
export type { string_data_url };
|
|
@@ -68,6 +68,7 @@ import { trimCodeBlock } from '../utils/trimCodeBlock';
|
|
|
68
68
|
import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
|
|
69
69
|
import { unwrapResult } from '../utils/unwrapResult';
|
|
70
70
|
import { isValidEmail } from '../utils/validators/email/isValidEmail';
|
|
71
|
+
import { isRootPath } from '../utils/validators/filePath/isRootPath';
|
|
71
72
|
import { isValidFilePath } from '../utils/validators/filePath/isValidFilePath';
|
|
72
73
|
import { isValidJavascriptName } from '../utils/validators/javascriptName/isValidJavascriptName';
|
|
73
74
|
import { isValidPromptbookVersion } from '../utils/validators/semanticVersion/isValidPromptbookVersion';
|
|
@@ -147,6 +148,7 @@ export { trimCodeBlock };
|
|
|
147
148
|
export { trimEndOfCodeBlock };
|
|
148
149
|
export { unwrapResult };
|
|
149
150
|
export { isValidEmail };
|
|
151
|
+
export { isRootPath };
|
|
150
152
|
export { isValidFilePath };
|
|
151
153
|
export { isValidJavascriptName };
|
|
152
154
|
export { isValidPromptbookVersion };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
+
import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
|
|
3
|
+
import { _AnthropicClaudeRegistration } from '../llm-providers/anthropic-claude/register-constructor';
|
|
4
|
+
import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
|
|
5
|
+
import { _AzureOpenAiRegistration } from '../llm-providers/azure-openai/register-constructor';
|
|
6
|
+
import { _GoogleMetadataRegistration } from '../llm-providers/google/register-configuration';
|
|
7
|
+
import { _GoogleRegistration } from '../llm-providers/google/register-constructor';
|
|
8
|
+
import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
9
|
+
import { _OpenAiAssistantMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
10
|
+
import { _OpenAiRegistration } from '../llm-providers/openai/register-constructor';
|
|
11
|
+
import { _OpenAiAssistantRegistration } from '../llm-providers/openai/register-constructor';
|
|
12
|
+
import { _LegacyDocumentScraperRegistration } from '../scrapers/document-legacy/register-constructor';
|
|
13
|
+
import { _LegacyDocumentScraperMetadataRegistration } from '../scrapers/document-legacy/register-metadata';
|
|
14
|
+
import { _DocumentScraperRegistration } from '../scrapers/document/register-constructor';
|
|
15
|
+
import { _DocumentScraperMetadataRegistration } from '../scrapers/document/register-metadata';
|
|
16
|
+
import { _MarkdownScraperRegistration } from '../scrapers/markdown/register-constructor';
|
|
17
|
+
import { _MarkdownScraperMetadataRegistration } from '../scrapers/markdown/register-metadata';
|
|
18
|
+
import { _PdfScraperRegistration } from '../scrapers/pdf/register-constructor';
|
|
19
|
+
import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
|
|
20
|
+
import { _WebsiteScraperRegistration } from '../scrapers/website/register-constructor';
|
|
21
|
+
import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
|
|
22
|
+
import { wizzard } from '../wizzard/wizzard';
|
|
23
|
+
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
24
|
+
export { _AnthropicClaudeMetadataRegistration };
|
|
25
|
+
export { _AnthropicClaudeRegistration };
|
|
26
|
+
export { _AzureOpenAiMetadataRegistration };
|
|
27
|
+
export { _AzureOpenAiRegistration };
|
|
28
|
+
export { _GoogleMetadataRegistration };
|
|
29
|
+
export { _GoogleRegistration };
|
|
30
|
+
export { _OpenAiMetadataRegistration };
|
|
31
|
+
export { _OpenAiAssistantMetadataRegistration };
|
|
32
|
+
export { _OpenAiRegistration };
|
|
33
|
+
export { _OpenAiAssistantRegistration };
|
|
34
|
+
export { _LegacyDocumentScraperRegistration };
|
|
35
|
+
export { _LegacyDocumentScraperMetadataRegistration };
|
|
36
|
+
export { _DocumentScraperRegistration };
|
|
37
|
+
export { _DocumentScraperMetadataRegistration };
|
|
38
|
+
export { _MarkdownScraperRegistration };
|
|
39
|
+
export { _MarkdownScraperMetadataRegistration };
|
|
40
|
+
export { _PdfScraperRegistration };
|
|
41
|
+
export { _PdfScraperMetadataRegistration };
|
|
42
|
+
export { _WebsiteScraperRegistration };
|
|
43
|
+
export { _WebsiteScraperMetadataRegistration };
|
|
44
|
+
export { wizzard };
|
|
@@ -6,7 +6,7 @@ import type { Command as Program } from 'commander';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function initializeMakeCommand(program: Program): void;
|
|
8
8
|
/**
|
|
9
|
-
* TODO: [🥃][main]
|
|
9
|
+
* TODO: [🥃][main] !!3 Allow `ptbk make` without configuring any llm tools
|
|
10
10
|
* TODO: [0] DRY Javascript and typescript - Maybe make ONLY typescript and for javascript just remove types
|
|
11
11
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12
12
|
* Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
|
|
@@ -6,9 +6,9 @@ import type { Command as Program } from 'commander';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function initializeRunCommand(program: Program): void;
|
|
8
8
|
/**
|
|
9
|
-
* TODO:
|
|
9
|
+
* TODO: !!5 Catch and wrap all errors from CLI
|
|
10
10
|
* TODO: [🧠] Pass `maxExecutionAttempts`, `csvSettings`
|
|
11
|
-
* TODO: [🥃][main]
|
|
11
|
+
* TODO: [🥃][main] !!3 Allow `ptbk run` without configuring any llm tools
|
|
12
12
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13
13
|
* Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
|
|
14
14
|
* TODO: [🖇] What about symlinks? Maybe flag --follow-symlinks
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
2
2
|
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
|
|
3
3
|
import type { string_dirname } from '../../types/typeAliases';
|
|
4
|
+
import type { string_pipeline_root_url } from '../../types/typeAliases';
|
|
4
5
|
import type { PipelineCollection } from '../PipelineCollection';
|
|
5
6
|
/**
|
|
6
7
|
* Options for `createCollectionFromDirectory` function
|
|
@@ -21,6 +22,16 @@ type CreatePipelineCollectionFromDirectoryOptions = Omit<PrepareAndScrapeOptions
|
|
|
21
22
|
* @default false
|
|
22
23
|
*/
|
|
23
24
|
isVerbose?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* This will be used as a root URL for all pipelines in the collection
|
|
27
|
+
*
|
|
28
|
+
* It has 2 purposes:
|
|
29
|
+
* 1) Every pipeline in the collection is checked if it is a child of `rootUrl`
|
|
30
|
+
* 2) If the pipeline does not have a URL, it is created from the `rootUrl` and path to the pipeline
|
|
31
|
+
*
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
rootUrl?: string_pipeline_root_url;
|
|
24
35
|
/**
|
|
25
36
|
* If true, directory will be scanned only when needed not during the construction
|
|
26
37
|
*
|
|
@@ -25,5 +25,5 @@ type CreatePipelineCollectionFromUrlyOptions = {
|
|
|
25
25
|
export declare function createCollectionFromUrl(url: string_url | URL, options: CreatePipelineCollectionFromUrlyOptions): Promise<PipelineCollection>;
|
|
26
26
|
export {};
|
|
27
27
|
/**
|
|
28
|
-
* TODO: [main]
|
|
28
|
+
* TODO: [main] !!4 [🧠] Library precompilation and do not mix markdown and json promptbooks
|
|
29
29
|
*/
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
export declare const COMMANDS: readonly [import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./SECTION/SectionCommand").SectionCommand>, import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./EXPECT/ExpectCommand").ExpectCommand>, import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./FORMAT/FormatCommand").FormatCommand>, import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./JOKER/JokerCommand").JokerCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./MODEL/ModelCommand").ModelCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PARAMETER/ParameterCommand").ParameterCommand>, import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./POSTPROCESS/PostprocessCommand").PostprocessCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./BOOK_VERSION/BookVersionCommand").BookVersionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./FORMFACTOR/FormfactorCommand").FormfactorCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./URL/UrlCommand").UrlCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./KNOWLEDGE/KnowledgeCommand").KnowledgeCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_ACTION/ActionCommand").ActionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_INSTRUMENT/InstrumentCommand").InstrumentCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PERSONA/PersonaCommand").PersonaCommand>, import("./_common/types/CommandParser").PipelineTaskCommandParser<import("./FOREACH/ForeachCommand").ForeachCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./_BOILERPLATE/BoilerplateCommand").BoilerplateCommand>];
|
|
7
7
|
/**
|
|
8
8
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9
|
-
*/
|
|
9
|
+
*/
|
|
@@ -58,7 +58,7 @@ export declare const LOGO_DARK_SRC: string_url_image;
|
|
|
58
58
|
*
|
|
59
59
|
* @public exported from `@promptbook/core`
|
|
60
60
|
*/
|
|
61
|
-
export declare const
|
|
61
|
+
export declare const DEFAULT_BOOK_TITLE = "\u2728 Untitled Book";
|
|
62
62
|
/**
|
|
63
63
|
* Warning message for the generated sections and files files
|
|
64
64
|
*
|
|
@@ -141,14 +141,14 @@ export declare const DEFAULT_MAX_PARALLEL_COUNT = 5;
|
|
|
141
141
|
export declare const DEFAULT_MAX_EXECUTION_ATTEMPTS = 3;
|
|
142
142
|
/**
|
|
143
143
|
* @@@
|
|
144
|
-
* TODO: [🐝][main]
|
|
144
|
+
* TODO: [🐝][main] !!3 Use
|
|
145
145
|
*
|
|
146
146
|
* @public exported from `@promptbook/core`
|
|
147
147
|
*/
|
|
148
148
|
export declare const DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH = 3;
|
|
149
149
|
/**
|
|
150
150
|
* @@@
|
|
151
|
-
* TODO: [🐝][main]
|
|
151
|
+
* TODO: [🐝][main] !!3 Use
|
|
152
152
|
*
|
|
153
153
|
* @public exported from `@promptbook/core`
|
|
154
154
|
*/
|
|
@@ -5,10 +5,7 @@ import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions
|
|
|
5
5
|
/**
|
|
6
6
|
* Compile pipeline from string (markdown) format to JSON format
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* - `compilePipeline` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
|
|
10
|
-
* - `precompilePipeline` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
11
|
-
* - `preparePipeline` - just one step in the compilation process
|
|
8
|
+
* @see https://github.com/webgptorg/promptbook/discussions/196
|
|
12
9
|
*
|
|
13
10
|
* Note: This function does not validate logic of the pipeline only the parsing
|
|
14
11
|
* Note: This function acts as compilation process
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RemoteServerOptions } from '../remote-server/interfaces/RemoteServerOptions';
|
|
2
|
+
import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
|
|
3
|
+
import type { PipelineString } from '../pipeline/PipelineString';
|
|
4
|
+
/**
|
|
5
|
+
* Compile pipeline from string (markdown) format to JSON format
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/webgptorg/promptbook/discussions/196
|
|
8
|
+
*
|
|
9
|
+
* Note: This function does not validate logic of the pipeline only the parsing
|
|
10
|
+
* Note: This function acts as compilation process
|
|
11
|
+
*
|
|
12
|
+
* @param pipelineString {Promptbook} in string markdown format (.book.md)
|
|
13
|
+
* @param options - Options for remote server compilation
|
|
14
|
+
* @returns {Promptbook} compiled in JSON format (.book.json)
|
|
15
|
+
* @throws {ParseError} if the promptbook string is not valid
|
|
16
|
+
* @public exported from `@promptbook/remote-client`
|
|
17
|
+
*/
|
|
18
|
+
export declare function compilePipelineOnRemoteServer<TCustomOptions = undefined>(pipelineString: PipelineString, options: RemoteServerOptions<TCustomOptions>): Promise<PipelineJson>;
|
|
@@ -5,7 +5,7 @@ import type { PipelineString } from '../pipeline/PipelineString';
|
|
|
5
5
|
*
|
|
6
6
|
* Note: There are 3 similar functions:
|
|
7
7
|
* - `compilePipeline` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
|
|
8
|
-
* - `
|
|
8
|
+
* - `parsePipeline` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
9
9
|
* - `preparePipeline` - just one step in the compilation process
|
|
10
10
|
*
|
|
11
11
|
* Note: This function does not validate logic of the pipeline only the parsing
|
|
@@ -16,10 +16,10 @@ import type { PipelineString } from '../pipeline/PipelineString';
|
|
|
16
16
|
* @throws {ParseError} if the promptbook string is not valid
|
|
17
17
|
* @public exported from `@promptbook/core`
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function parsePipeline(pipelineString: PipelineString): PipelineJson;
|
|
20
20
|
/**
|
|
21
21
|
* TODO: [🧠] Maybe more things here can be refactored as high-level abstractions
|
|
22
|
-
* TODO: [main]
|
|
22
|
+
* TODO: [main] !!4 Warn if used only sync version
|
|
23
23
|
* TODO: [🚞] Report here line/column of error
|
|
24
24
|
* TODO: Use spaceTrim more effectively
|
|
25
25
|
* TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
|
|
@@ -22,9 +22,9 @@ export type renderPipelineMermaidOptions = {
|
|
|
22
22
|
*/
|
|
23
23
|
export declare function renderPromptbookMermaid(pipelineJson: PipelineJson, options?: renderPipelineMermaidOptions): string;
|
|
24
24
|
/**
|
|
25
|
-
* TODO: [🧠]
|
|
26
|
-
* TODO: [🧠]
|
|
27
|
-
* TODO: [🧠]
|
|
25
|
+
* TODO: [🧠] FOREACH in mermaid graph
|
|
26
|
+
* TODO: [🧠] Knowledge in mermaid graph
|
|
27
|
+
* TODO: [🧠] Personas in mermaid graph
|
|
28
28
|
* TODO: Maybe use some Mermaid package instead of string templating
|
|
29
29
|
* TODO: [🕌] When more than 2 functionalities, split into separate functions
|
|
30
30
|
*/
|
|
@@ -18,9 +18,9 @@ export declare function validatePipeline(pipeline: PipelineJson): PipelineJson;
|
|
|
18
18
|
/**
|
|
19
19
|
* @private internal function for `validatePipeline`
|
|
20
20
|
*/
|
|
21
|
-
export declare function
|
|
21
|
+
export declare function validatePipeline_InnerFunction(pipeline: PipelineJson): void;
|
|
22
22
|
/**
|
|
23
|
-
* TODO:
|
|
23
|
+
* TODO: [🧞♀️] Do not allow joker + foreach
|
|
24
24
|
* TODO: [🧠] Work with promptbookVersion
|
|
25
25
|
* TODO: Use here some json-schema, Zod or something similar and change it to:
|
|
26
26
|
* > /**
|
|
@@ -32,11 +32,11 @@ export declare function validatePipelineCore(pipeline: PipelineJson): void;
|
|
|
32
32
|
* > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
|
|
33
33
|
*/
|
|
34
34
|
/**
|
|
35
|
-
* TODO: [🧳][main]
|
|
36
|
-
* TODO: [🧳][🐝][main]
|
|
37
|
-
* TODO: [🧳][main]
|
|
38
|
-
* TODO: [🧳][main]
|
|
39
|
-
* TODO: [🧳][main]
|
|
35
|
+
* TODO: [🧳][main] !!4 Validate that all examples match expectations
|
|
36
|
+
* TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
|
|
37
|
+
* TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
|
|
38
|
+
* TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
|
|
39
|
+
* TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
|
|
40
40
|
* TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
|
|
41
41
|
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
42
42
|
*/
|
|
@@ -5,15 +5,20 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const GeneratorFormfactorDefinition: {
|
|
7
7
|
readonly name: "GENERATOR";
|
|
8
|
-
readonly description: "
|
|
8
|
+
readonly description: "Generates any kind (in HTML with possible scripts and css format) of content from input message";
|
|
9
9
|
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/184";
|
|
10
10
|
readonly pipelineInterface: {
|
|
11
11
|
readonly inputParameters: readonly [{
|
|
12
|
-
readonly name: "
|
|
13
|
-
readonly description: "
|
|
12
|
+
readonly name: "inputMessage";
|
|
13
|
+
readonly description: "Input message to be image made from";
|
|
14
14
|
readonly isInput: true;
|
|
15
15
|
readonly isOutput: false;
|
|
16
16
|
}];
|
|
17
|
-
readonly outputParameters: readonly [
|
|
17
|
+
readonly outputParameters: readonly [{
|
|
18
|
+
readonly name: "result";
|
|
19
|
+
readonly description: "Result in HTML to be shown to user";
|
|
20
|
+
readonly isInput: false;
|
|
21
|
+
readonly isOutput: true;
|
|
22
|
+
}];
|
|
18
23
|
};
|
|
19
24
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Image generator is form of app that generates image from input message
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/core`
|
|
5
|
+
*/
|
|
6
|
+
export declare const ImageGeneratorFormfactorDefinition: {
|
|
7
|
+
readonly name: "IMAGE_GENERATOR";
|
|
8
|
+
readonly description: "Generates prompt for image generation from input message";
|
|
9
|
+
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/184";
|
|
10
|
+
readonly pipelineInterface: {
|
|
11
|
+
readonly inputParameters: readonly [{
|
|
12
|
+
readonly name: "inputMessage";
|
|
13
|
+
readonly description: "Input message to be image made from";
|
|
14
|
+
readonly isInput: true;
|
|
15
|
+
readonly isOutput: false;
|
|
16
|
+
}];
|
|
17
|
+
readonly outputParameters: readonly [{
|
|
18
|
+
readonly name: "prompt";
|
|
19
|
+
readonly description: "Prompt to be used for image generation";
|
|
20
|
+
readonly isInput: false;
|
|
21
|
+
readonly isOutput: true;
|
|
22
|
+
}];
|
|
23
|
+
};
|
|
24
|
+
};
|