@promptbook/openai 0.72.0-7 → 0.72.0-9
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 +72 -64
- package/esm/index.es.js +99 -7
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/browser.index.d.ts +2 -0
- package/esm/typings/src/_packages/cli.index.d.ts +20 -0
- package/esm/typings/src/_packages/core.index.d.ts +20 -16
- package/esm/typings/src/_packages/documents.index.d.ts +8 -0
- package/esm/typings/src/_packages/legacy-documents.index.d.ts +8 -0
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +6 -0
- package/esm/typings/src/_packages/node.index.d.ts +10 -4
- package/esm/typings/src/_packages/pdf.index.d.ts +8 -0
- package/esm/typings/src/_packages/types.index.d.ts +15 -5
- package/esm/typings/src/_packages/website-crawler.index.d.ts +8 -0
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +5 -3
- package/esm/typings/src/config.d.ts +6 -0
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +3 -1
- package/esm/typings/src/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +2 -2
- package/esm/typings/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -3
- package/esm/typings/src/execution/{CommonExecutionToolsOptions.d.ts → CommonToolsOptions.d.ts} +1 -1
- package/esm/typings/src/execution/ExecutionTools.d.ts +26 -6
- package/esm/typings/src/execution/FilesystemTools.d.ts +9 -0
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTemplate.d.ts +1 -6
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -6
- package/esm/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +1 -0
- package/esm/typings/src/execution/utils/$provideExecutionToolsForNode.d.ts +13 -0
- package/esm/typings/src/llm-providers/_common/{$llmToolsMetadataRegister.d.ts → register/$llmToolsMetadataRegister.d.ts} +4 -1
- package/esm/typings/src/llm-providers/_common/{$llmToolsRegister.d.ts → register/$llmToolsRegister.d.ts} +5 -2
- package/esm/typings/src/llm-providers/_common/{createLlmToolsFromConfigurationFromEnv.d.ts → register/$provideLlmToolsConfigurationFromEnv.d.ts} +3 -3
- package/esm/typings/src/llm-providers/_common/{getLlmToolsForCli.d.ts → register/$provideLlmToolsForCli.d.ts} +4 -11
- package/esm/typings/src/llm-providers/_common/{getLlmToolsForTestingAndScriptsAndPlayground.d.ts → register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts} +4 -3
- package/esm/typings/src/llm-providers/_common/{createLlmToolsFromEnv.d.ts → register/$provideLlmToolsFromEnv.d.ts} +6 -5
- package/esm/typings/src/llm-providers/_common/{$registeredLlmToolsMessage.d.ts → register/$registeredLlmToolsMessage.d.ts} +5 -2
- package/esm/typings/src/llm-providers/_common/{LlmToolsConfiguration.d.ts → register/LlmToolsConfiguration.d.ts} +5 -4
- package/esm/typings/src/llm-providers/_common/{LlmToolsMetadata.d.ts → register/LlmToolsMetadata.d.ts} +5 -4
- package/esm/typings/src/llm-providers/_common/{LlmToolsOptions.d.ts → register/LlmToolsOptions.d.ts} +4 -1
- package/esm/typings/src/llm-providers/_common/{createLlmToolsFromConfiguration.d.ts → register/createLlmToolsFromConfiguration.d.ts} +5 -4
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +3 -3
- package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +4 -3
- package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +4 -3
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +2 -2
- package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +4 -3
- package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +4 -3
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +2 -2
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +5 -4
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +5 -4
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Request.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Request.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteLlmExecutionToolsOptions.d.ts +3 -3
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +2 -2
- package/esm/typings/src/personas/preparePersona.d.ts +2 -1
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +8 -7
- package/esm/typings/src/prepare/preparePipeline.d.ts +2 -1
- package/esm/typings/src/prepare/prepareTemplates.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/Converter.d.ts +4 -10
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +4 -9
- package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +11 -0
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +12 -0
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +15 -0
- package/esm/typings/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +12 -0
- package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +13 -0
- package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +13 -0
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +41 -0
- package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +12 -0
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +1 -0
- package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +2 -1
- package/esm/typings/src/scrapers/document/{documentScraper.d.ts → DocumentScraper.d.ts} +18 -12
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/document/register-constructor.d.ts +13 -0
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +24 -0
- package/esm/typings/src/scrapers/document-legacy/{legacyDocumentScraper.d.ts → LegacyDocumentScraper.d.ts} +18 -12
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +13 -0
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +24 -0
- package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +29 -0
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +13 -0
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +24 -0
- package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +40 -0
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +13 -0
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +24 -0
- package/esm/typings/src/scrapers/website/{websiteScraper.d.ts → WebsiteScraper.d.ts} +18 -14
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/website/register-constructor.d.ts +13 -0
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +24 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +2 -2
- package/esm/typings/src/scripting/python/PythonExecutionTools.d.ts +3 -3
- package/esm/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +3 -3
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +5 -3
- package/esm/typings/src/storage/{utils → memory/utils}/PrefixStorage.d.ts +1 -1
- package/esm/typings/src/storage/{utils → memory/utils}/makePromptbookStorageFromWebStorage.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +7 -0
- package/esm/typings/src/utils/$Register.d.ts +19 -6
- package/esm/typings/src/utils/execCommand/$execCommand.d.ts +1 -1
- package/esm/typings/src/utils/execCommand/$execCommands.d.ts +1 -1
- package/esm/typings/src/utils/files/isDirectoryExisting.d.ts +14 -0
- package/esm/typings/src/utils/files/isFileExisting.d.ts +13 -0
- package/esm/typings/src/utils/files/{$listAllFiles.d.ts → listAllFiles.d.ts} +3 -4
- package/package.json +2 -2
- package/umd/index.umd.js +99 -7
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/scrapers/index.d.ts +0 -7
- package/esm/typings/src/scrapers/markdown/markdownScraper.d.ts +0 -29
- package/esm/typings/src/scrapers/pdf/pdfScraper.d.ts +0 -35
- package/esm/typings/src/utils/files/$isDirectoryExisting.d.ts +0 -15
- package/esm/typings/src/utils/files/$isFileExisting.d.ts +0 -14
- /package/esm/typings/src/scrapers/document/{documentScraper.test.d.ts → DocumentScraper.test.d.ts} +0 -0
- /package/esm/typings/src/scrapers/document-legacy/{legacyDocumentScraper.test.d.ts → LegacyDocumentScraper.test.d.ts} +0 -0
- /package/esm/typings/src/scrapers/markdown/{markdownScraper.test.d.ts → MarkdownScraper.test.d.ts} +0 -0
- /package/esm/typings/src/scrapers/website/{websiteScraper.test.d.ts → WebsiteScraper.test.d.ts} +0 -0
- /package/esm/typings/src/utils/files/{$isDirectoryExisting.test.d.ts → isDirectoryExisting.test.d.ts} +0 -0
- /package/esm/typings/src/utils/files/{$isFileExisting.test.d.ts → isFileExisting.test.d.ts} +0 -0
- /package/esm/typings/src/utils/files/{$listAllFiles.test.d.ts → listAllFiles.test.d.ts} +0 -0
|
@@ -8,6 +8,16 @@ import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-co
|
|
|
8
8
|
import { _OpenAiAssistantMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
9
9
|
import { _OpenAiRegistration } from '../llm-providers/openai/register-constructor';
|
|
10
10
|
import { _OpenAiAssistantRegistration } from '../llm-providers/openai/register-constructor';
|
|
11
|
+
import { _LegacyDocumentScraperRegistration } from '../scrapers/document-legacy/register-constructor';
|
|
12
|
+
import { _LegacyDocumentScraperMetadataRegistration } from '../scrapers/document-legacy/register-metadata';
|
|
13
|
+
import { _DocumentScraperRegistration } from '../scrapers/document/register-constructor';
|
|
14
|
+
import { _DocumentScraperMetadataRegistration } from '../scrapers/document/register-metadata';
|
|
15
|
+
import { _MarkdownScraperRegistration } from '../scrapers/markdown/register-constructor';
|
|
16
|
+
import { _MarkdownScraperMetadataRegistration } from '../scrapers/markdown/register-metadata';
|
|
17
|
+
import { _PdfScraperRegistration } from '../scrapers/pdf/register-constructor';
|
|
18
|
+
import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
|
|
19
|
+
import { _WebsiteScraperRegistration } from '../scrapers/website/register-constructor';
|
|
20
|
+
import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
|
|
11
21
|
export { PROMPTBOOK_VERSION };
|
|
12
22
|
export { _CLI };
|
|
13
23
|
export { _AnthropicClaudeMetadataRegistration };
|
|
@@ -18,3 +28,13 @@ export { _OpenAiMetadataRegistration };
|
|
|
18
28
|
export { _OpenAiAssistantMetadataRegistration };
|
|
19
29
|
export { _OpenAiRegistration };
|
|
20
30
|
export { _OpenAiAssistantRegistration };
|
|
31
|
+
export { _LegacyDocumentScraperRegistration };
|
|
32
|
+
export { _LegacyDocumentScraperMetadataRegistration };
|
|
33
|
+
export { _DocumentScraperRegistration };
|
|
34
|
+
export { _DocumentScraperMetadataRegistration };
|
|
35
|
+
export { _MarkdownScraperRegistration };
|
|
36
|
+
export { _MarkdownScraperMetadataRegistration };
|
|
37
|
+
export { _PdfScraperRegistration };
|
|
38
|
+
export { _PdfScraperMetadataRegistration };
|
|
39
|
+
export { _WebsiteScraperRegistration };
|
|
40
|
+
export { _WebsiteScraperMetadataRegistration };
|
|
@@ -20,6 +20,7 @@ import { DEFAULT_REMOTE_URL } from '../config';
|
|
|
20
20
|
import { DEFAULT_REMOTE_URL_PATH } from '../config';
|
|
21
21
|
import { DEFAULT_CSV_SETTINGS } from '../config';
|
|
22
22
|
import { IS_VERBOSE } from '../config';
|
|
23
|
+
import { IS_AUTO_INSTALLED } from '../config';
|
|
23
24
|
import { pipelineJsonToString } from '../conversion/pipelineJsonToString';
|
|
24
25
|
import { pipelineStringToJson } from '../conversion/pipelineStringToJson';
|
|
25
26
|
import { pipelineStringToJsonSync } from '../conversion/pipelineStringToJsonSync';
|
|
@@ -56,9 +57,9 @@ import { CsvFormatDefinition } from '../formats/csv/CsvFormatDefinition';
|
|
|
56
57
|
import { CsvFormatError } from '../formats/csv/CsvFormatError';
|
|
57
58
|
import { MANDATORY_CSV_SETTINGS } from '../formats/csv/CsvSettings';
|
|
58
59
|
import { TextFormatDefinition } from '../formats/text/TextFormatDefinition';
|
|
59
|
-
import { $llmToolsMetadataRegister } from '../llm-providers/_common/$llmToolsMetadataRegister';
|
|
60
|
-
import { $llmToolsRegister } from '../llm-providers/_common/$llmToolsRegister';
|
|
61
|
-
import { createLlmToolsFromConfiguration } from '../llm-providers/_common/createLlmToolsFromConfiguration';
|
|
60
|
+
import { $llmToolsMetadataRegister } from '../llm-providers/_common/register/$llmToolsMetadataRegister';
|
|
61
|
+
import { $llmToolsRegister } from '../llm-providers/_common/register/$llmToolsRegister';
|
|
62
|
+
import { createLlmToolsFromConfiguration } from '../llm-providers/_common/register/createLlmToolsFromConfiguration';
|
|
62
63
|
import { cacheLlmTools } from '../llm-providers/_common/utils/cache/cacheLlmTools';
|
|
63
64
|
import { countTotalUsage } from '../llm-providers/_common/utils/count-total-usage/countTotalUsage';
|
|
64
65
|
import { limitTotalUsage } from '../llm-providers/_common/utils/count-total-usage/limitTotalUsage';
|
|
@@ -73,14 +74,15 @@ import { preparePipeline } from '../prepare/preparePipeline';
|
|
|
73
74
|
import { prepareTemplates } from '../prepare/prepareTemplates';
|
|
74
75
|
import { unpreparePipeline } from '../prepare/unpreparePipeline';
|
|
75
76
|
import { prepareKnowledgePieces } from '../scrapers/_common/prepareKnowledgePieces';
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
77
|
+
import { $scrapersMetadataRegister } from '../scrapers/_common/register/$scrapersMetadataRegister';
|
|
78
|
+
import { $scrapersRegister } from '../scrapers/_common/register/$scrapersRegister';
|
|
79
|
+
import { _LegacyDocumentScraperMetadataRegistration } from '../scrapers/document-legacy/register-metadata';
|
|
80
|
+
import { _DocumentScraperMetadataRegistration } from '../scrapers/document/register-metadata';
|
|
81
|
+
import { _MarkdownScraperMetadataRegistration } from '../scrapers/markdown/register-metadata';
|
|
82
|
+
import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
|
|
83
|
+
import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
|
|
82
84
|
import { MemoryStorage } from '../storage/memory/MemoryStorage';
|
|
83
|
-
import { PrefixStorage } from '../storage/utils/PrefixStorage';
|
|
85
|
+
import { PrefixStorage } from '../storage/memory/utils/PrefixStorage';
|
|
84
86
|
import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
|
|
85
87
|
import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';
|
|
86
88
|
import { ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
@@ -108,6 +110,7 @@ export { DEFAULT_REMOTE_URL };
|
|
|
108
110
|
export { DEFAULT_REMOTE_URL_PATH };
|
|
109
111
|
export { DEFAULT_CSV_SETTINGS };
|
|
110
112
|
export { IS_VERBOSE };
|
|
113
|
+
export { IS_AUTO_INSTALLED };
|
|
111
114
|
export { pipelineJsonToString };
|
|
112
115
|
export { pipelineStringToJson };
|
|
113
116
|
export { pipelineStringToJsonSync };
|
|
@@ -161,12 +164,13 @@ export { preparePipeline };
|
|
|
161
164
|
export { prepareTemplates };
|
|
162
165
|
export { unpreparePipeline };
|
|
163
166
|
export { prepareKnowledgePieces };
|
|
164
|
-
export {
|
|
165
|
-
export {
|
|
166
|
-
export {
|
|
167
|
-
export {
|
|
168
|
-
export {
|
|
169
|
-
export {
|
|
167
|
+
export { $scrapersMetadataRegister };
|
|
168
|
+
export { $scrapersRegister };
|
|
169
|
+
export { _LegacyDocumentScraperMetadataRegistration };
|
|
170
|
+
export { _DocumentScraperMetadataRegistration };
|
|
171
|
+
export { _MarkdownScraperMetadataRegistration };
|
|
172
|
+
export { _PdfScraperMetadataRegistration };
|
|
173
|
+
export { _WebsiteScraperMetadataRegistration };
|
|
170
174
|
export { MemoryStorage };
|
|
171
175
|
export { PrefixStorage };
|
|
172
176
|
export { executionReportJsonToString };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
2
|
+
import { createDocumentScraper } from '../scrapers/document/createDocumentScraper';
|
|
3
|
+
import { DocumentScraper } from '../scrapers/document/DocumentScraper';
|
|
4
|
+
import { _DocumentScraperRegistration } from '../scrapers/document/register-constructor';
|
|
5
|
+
export { PROMPTBOOK_VERSION };
|
|
6
|
+
export { createDocumentScraper };
|
|
7
|
+
export { DocumentScraper };
|
|
8
|
+
export { _DocumentScraperRegistration };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
2
|
+
import { createLegacyDocumentScraper } from '../scrapers/document-legacy/createLegacyDocumentScraper';
|
|
3
|
+
import { LegacyDocumentScraper } from '../scrapers/document-legacy/LegacyDocumentScraper';
|
|
4
|
+
import { _LegacyDocumentScraperRegistration } from '../scrapers/document-legacy/register-constructor';
|
|
5
|
+
export { PROMPTBOOK_VERSION };
|
|
6
|
+
export { createLegacyDocumentScraper };
|
|
7
|
+
export { LegacyDocumentScraper };
|
|
8
|
+
export { _LegacyDocumentScraperRegistration };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
2
2
|
import { extractBlock } from '../postprocessing/utils/extractBlock';
|
|
3
3
|
import { extractJsonBlock } from '../postprocessing/utils/extractJsonBlock';
|
|
4
|
+
import { createMarkdownScraper } from '../scrapers/markdown/createMarkdownScraper';
|
|
5
|
+
import { MarkdownScraper } from '../scrapers/markdown/MarkdownScraper';
|
|
6
|
+
import { _MarkdownScraperRegistration } from '../scrapers/markdown/register-constructor';
|
|
4
7
|
import type { string_markdown } from '../types/typeAliases';
|
|
5
8
|
import type { string_markdown_section } from '../types/typeAliases';
|
|
6
9
|
import type { string_markdown_section_content } from '../types/typeAliases';
|
|
@@ -21,6 +24,9 @@ import { splitMarkdownIntoSections } from '../utils/markdown/splitMarkdownIntoSe
|
|
|
21
24
|
export { PROMPTBOOK_VERSION };
|
|
22
25
|
export { extractBlock };
|
|
23
26
|
export { extractJsonBlock };
|
|
27
|
+
export { createMarkdownScraper };
|
|
28
|
+
export { MarkdownScraper };
|
|
29
|
+
export { _MarkdownScraperRegistration };
|
|
24
30
|
export type { string_markdown };
|
|
25
31
|
export type { string_markdown_section };
|
|
26
32
|
export type { string_markdown_section_content };
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
2
2
|
import { createCollectionFromDirectory } from '../collection/constructors/createCollectionFromDirectory';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { $provideExecutionToolsForNode } from '../execution/utils/$provideExecutionToolsForNode';
|
|
4
|
+
import { $provideLlmToolsConfigurationFromEnv } from '../llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv';
|
|
5
|
+
import { $provideLlmToolsFromEnv } from '../llm-providers/_common/register/$provideLlmToolsFromEnv';
|
|
6
|
+
import { $provideFilesystemForNode } from '../scrapers/_common/register/$provideFilesystemForNode';
|
|
7
|
+
import { $provideScrapersForNode } from '../scrapers/_common/register/$provideScrapersForNode';
|
|
5
8
|
import { FileCacheStorage } from '../storage/file-cache-storage/FileCacheStorage';
|
|
6
9
|
import { $execCommand } from '../utils/execCommand/$execCommand';
|
|
7
10
|
import { $execCommands } from '../utils/execCommand/$execCommands';
|
|
8
11
|
export { PROMPTBOOK_VERSION };
|
|
9
12
|
export { createCollectionFromDirectory };
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
13
|
+
export { $provideExecutionToolsForNode };
|
|
14
|
+
export { $provideLlmToolsConfigurationFromEnv };
|
|
15
|
+
export { $provideLlmToolsFromEnv };
|
|
16
|
+
export { $provideFilesystemForNode };
|
|
17
|
+
export { $provideScrapersForNode };
|
|
12
18
|
export { FileCacheStorage };
|
|
13
19
|
export { $execCommand };
|
|
14
20
|
export { $execCommands };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
2
|
+
import { createPdfScraper } from '../scrapers/pdf/createPdfScraper';
|
|
3
|
+
import { PdfScraper } from '../scrapers/pdf/PdfScraper';
|
|
4
|
+
import { _PdfScraperRegistration } from '../scrapers/pdf/register-constructor';
|
|
5
|
+
export { PROMPTBOOK_VERSION };
|
|
6
|
+
export { createPdfScraper };
|
|
7
|
+
export { PdfScraper };
|
|
8
|
+
export { _PdfScraperRegistration };
|
|
@@ -15,11 +15,12 @@ import type { renderPipelineMermaidOptions } from '../conversion/prettify/render
|
|
|
15
15
|
import type { CallbackInterfaceToolsOptions } from '../dialogs/callback/CallbackInterfaceToolsOptions';
|
|
16
16
|
import type { ErrorJson } from '../errors/utils/ErrorJson';
|
|
17
17
|
import type { AvailableModel } from '../execution/AvailableModel';
|
|
18
|
-
import type {
|
|
18
|
+
import type { CommonToolsOptions } from '../execution/CommonToolsOptions';
|
|
19
19
|
import type { CreatePipelineExecutorOptions } from '../execution/createPipelineExecutor/00-CreatePipelineExecutorOptions';
|
|
20
20
|
import type { CreatePipelineExecutorSettings } from '../execution/createPipelineExecutor/00-CreatePipelineExecutorSettings';
|
|
21
21
|
import type { EmbeddingVector } from '../execution/EmbeddingVector';
|
|
22
22
|
import type { ExecutionTools } from '../execution/ExecutionTools';
|
|
23
|
+
import type { FilesystemTools } from '../execution/FilesystemTools';
|
|
23
24
|
import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
|
|
24
25
|
import type { LlmExecutionToolsConstructor } from '../execution/LlmExecutionToolsConstructor';
|
|
25
26
|
import type { PipelineExecutor } from '../execution/PipelineExecutor';
|
|
@@ -37,9 +38,9 @@ import type { UserInterfaceTools } from '../execution/UserInterfaceTools';
|
|
|
37
38
|
import type { UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
|
|
38
39
|
import type { FormatSubvalueDefinition } from '../formats/_common/FormatSubvalueDefinition';
|
|
39
40
|
import type { CsvSettings } from '../formats/csv/CsvSettings';
|
|
40
|
-
import type { LlmToolsConfiguration } from '../llm-providers/_common/LlmToolsConfiguration';
|
|
41
|
-
import type { LlmToolsMetadata } from '../llm-providers/_common/LlmToolsMetadata';
|
|
42
|
-
import type { LlmToolsOptions } from '../llm-providers/_common/LlmToolsOptions';
|
|
41
|
+
import type { LlmToolsConfiguration } from '../llm-providers/_common/register/LlmToolsConfiguration';
|
|
42
|
+
import type { LlmToolsMetadata } from '../llm-providers/_common/register/LlmToolsMetadata';
|
|
43
|
+
import type { LlmToolsOptions } from '../llm-providers/_common/register/LlmToolsOptions';
|
|
43
44
|
import type { CacheItem } from '../llm-providers/_common/utils/cache/CacheItem';
|
|
44
45
|
import type { CacheLlmToolsOptions } from '../llm-providers/_common/utils/cache/CacheLlmToolsOptions';
|
|
45
46
|
import type { LlmExecutionToolsWithTotalUsage } from '../llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage';
|
|
@@ -67,6 +68,8 @@ import type { AnonymousRemoteServerOptions } from '../llm-providers/remote/inter
|
|
|
67
68
|
import type { CollectionRemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
|
|
68
69
|
import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions';
|
|
69
70
|
import type { Converter } from '../scrapers/_common/Converter';
|
|
71
|
+
import type { ScraperAndConverterMetadata } from '../scrapers/_common/register/ScraperAndConverterMetadata';
|
|
72
|
+
import type { ScraperConstructor } from '../scrapers/_common/register/ScraperConstructor';
|
|
70
73
|
import type { Scraper } from '../scrapers/_common/Scraper';
|
|
71
74
|
import type { ScraperSourceHandler } from '../scrapers/_common/Scraper';
|
|
72
75
|
import type { ScraperIntermediateSource } from '../scrapers/_common/ScraperIntermediateSource';
|
|
@@ -156,6 +159,7 @@ import type { string_data_url } from '../types/typeAliases';
|
|
|
156
159
|
import type { string_base64 } from '../types/typeAliases';
|
|
157
160
|
import type { string_href } from '../types/typeAliases';
|
|
158
161
|
import type { string_url_image } from '../types/typeAliases';
|
|
162
|
+
import type { string_executable_path } from '../types/typeAliases';
|
|
159
163
|
import type { string_uri } from '../types/typeAliases';
|
|
160
164
|
import type { string_uri_part } from '../types/typeAliases';
|
|
161
165
|
import type { string_uriid } from '../types/typeAliases';
|
|
@@ -218,6 +222,7 @@ import type { number_megabytes } from '../types/typeAliases';
|
|
|
218
222
|
import type { number_gigabytes } from '../types/typeAliases';
|
|
219
223
|
import type { number_terabytes } from '../types/typeAliases';
|
|
220
224
|
import type { Registered } from '../utils/$Register';
|
|
225
|
+
import type { Registration } from '../utils/$Register';
|
|
221
226
|
import type { IExecCommandOptions } from '../utils/execCommand/IExecCommandOptions';
|
|
222
227
|
import type { IExecCommandOptionsAdvanced } from '../utils/execCommand/IExecCommandOptions';
|
|
223
228
|
import type { FromtoItems } from '../utils/FromtoItems';
|
|
@@ -251,11 +256,12 @@ export type { renderPipelineMermaidOptions };
|
|
|
251
256
|
export type { CallbackInterfaceToolsOptions };
|
|
252
257
|
export type { ErrorJson };
|
|
253
258
|
export type { AvailableModel };
|
|
254
|
-
export type {
|
|
259
|
+
export type { CommonToolsOptions };
|
|
255
260
|
export type { CreatePipelineExecutorOptions };
|
|
256
261
|
export type { CreatePipelineExecutorSettings };
|
|
257
262
|
export type { EmbeddingVector };
|
|
258
263
|
export type { ExecutionTools };
|
|
264
|
+
export type { FilesystemTools };
|
|
259
265
|
export type { LlmExecutionTools };
|
|
260
266
|
export type { LlmExecutionToolsConstructor };
|
|
261
267
|
export type { PipelineExecutor };
|
|
@@ -303,6 +309,8 @@ export type { AnonymousRemoteServerOptions };
|
|
|
303
309
|
export type { CollectionRemoteServerOptions };
|
|
304
310
|
export type { PrepareAndScrapeOptions };
|
|
305
311
|
export type { Converter };
|
|
312
|
+
export type { ScraperAndConverterMetadata };
|
|
313
|
+
export type { ScraperConstructor };
|
|
306
314
|
export type { Scraper };
|
|
307
315
|
export type { ScraperSourceHandler };
|
|
308
316
|
export type { ScraperIntermediateSource };
|
|
@@ -392,6 +400,7 @@ export type { string_data_url };
|
|
|
392
400
|
export type { string_base64 };
|
|
393
401
|
export type { string_href };
|
|
394
402
|
export type { string_url_image };
|
|
403
|
+
export type { string_executable_path };
|
|
395
404
|
export type { string_uri };
|
|
396
405
|
export type { string_uri_part };
|
|
397
406
|
export type { string_uriid };
|
|
@@ -454,6 +463,7 @@ export type { number_megabytes };
|
|
|
454
463
|
export type { number_gigabytes };
|
|
455
464
|
export type { number_terabytes };
|
|
456
465
|
export type { Registered };
|
|
466
|
+
export type { Registration };
|
|
457
467
|
export type { IExecCommandOptions };
|
|
458
468
|
export type { IExecCommandOptionsAdvanced };
|
|
459
469
|
export type { FromtoItems };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
2
|
+
import { createWebsiteScraper } from '../scrapers/website/createWebsiteScraper';
|
|
3
|
+
import { _WebsiteScraperRegistration } from '../scrapers/website/register-constructor';
|
|
4
|
+
import { WebsiteScraper } from '../scrapers/website/WebsiteScraper';
|
|
5
|
+
export { PROMPTBOOK_VERSION };
|
|
6
|
+
export { createWebsiteScraper };
|
|
7
|
+
export { _WebsiteScraperRegistration };
|
|
8
|
+
export { WebsiteScraper };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
1
2
|
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
|
|
2
3
|
import type { string_dirname } from '../../types/typeAliases';
|
|
3
4
|
import type { PipelineCollection } from '../PipelineCollection';
|
|
@@ -40,13 +41,14 @@ type CreatePipelineCollectionFromDirectoryOptions = Omit<PrepareAndScrapeOptions
|
|
|
40
41
|
* Note: Works only in Node.js environment because it reads the file system
|
|
41
42
|
*
|
|
42
43
|
* @param path - path to the directory with pipelines
|
|
43
|
-
* @param
|
|
44
|
+
* @param tools - Execution tools to be used for pipeline preparation if needed - If not provided, `$provideExecutionToolsForNode` will be used
|
|
45
|
+
* @param options - Options for the collection creation
|
|
44
46
|
* @returns PipelineCollection
|
|
45
47
|
* @public exported from `@promptbook/node`
|
|
46
48
|
*/
|
|
47
|
-
export declare function createCollectionFromDirectory(path: string_dirname, options?: CreatePipelineCollectionFromDirectoryOptions): Promise<PipelineCollection>;
|
|
49
|
+
export declare function createCollectionFromDirectory(path: string_dirname, tools?: Pick<ExecutionTools, 'llm' | 'fs' | 'scrapers'>, options?: CreatePipelineCollectionFromDirectoryOptions): Promise<PipelineCollection>;
|
|
48
50
|
export {};
|
|
49
51
|
/**
|
|
50
|
-
* Note: [🟢] Code in this file should never be published outside of `@promptbook/node` and `@promptbook/cli`
|
|
51
52
|
* TODO: [🖇] What about symlinks? Maybe option isSymlinksFollowed
|
|
53
|
+
* TODO: Maybe move from `@promptbook/node` to `@promptbook/core` as we removes direct dependency on `fs`
|
|
52
54
|
*/
|
|
@@ -160,6 +160,12 @@ export declare const DEFAULT_CSV_SETTINGS: CsvSettings;
|
|
|
160
160
|
* @public exported from `@promptbook/core`
|
|
161
161
|
*/
|
|
162
162
|
export declare const IS_VERBOSE = false;
|
|
163
|
+
/**
|
|
164
|
+
* @@@
|
|
165
|
+
*
|
|
166
|
+
* @public exported from `@promptbook/core`
|
|
167
|
+
*/
|
|
168
|
+
export declare const IS_AUTO_INSTALLED = false;
|
|
163
169
|
/**
|
|
164
170
|
* @@@
|
|
165
171
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ExecutionTools } from '../execution/ExecutionTools';
|
|
1
2
|
import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions';
|
|
2
3
|
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
3
4
|
import type { PipelineString } from '../types/PipelineString';
|
|
@@ -13,12 +14,13 @@ import type { PipelineString } from '../types/PipelineString';
|
|
|
13
14
|
* Note: This function acts as compilation process
|
|
14
15
|
*
|
|
15
16
|
* @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
|
|
17
|
+
* @param tools - Tools for the preparation and scraping - if not provided together with `llm`, the preparation will be skipped
|
|
16
18
|
* @param options - Options and tools for the compilation
|
|
17
19
|
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
|
|
18
20
|
* @throws {ParseError} if the promptbook string is not valid
|
|
19
21
|
* @public exported from `@promptbook/core`
|
|
20
22
|
*/
|
|
21
|
-
export declare function pipelineStringToJson(pipelineString: PipelineString, options?: PrepareAndScrapeOptions): Promise<PipelineJson>;
|
|
23
|
+
export declare function pipelineStringToJson(pipelineString: PipelineString, tools?: Pick<ExecutionTools, 'llm' | 'fs' | 'scrapers'>, options?: PrepareAndScrapeOptions): Promise<PipelineJson>;
|
|
22
24
|
/**
|
|
23
25
|
* TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
24
26
|
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Promisable } from 'type-fest';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
3
3
|
import type { UserInterfaceToolsPromptDialogOptions } from '../../execution/UserInterfaceTools';
|
|
4
4
|
/**
|
|
5
5
|
* Options for `CallbackInterfaceTools`
|
|
6
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/core`
|
|
8
8
|
*/
|
|
9
|
-
export type CallbackInterfaceToolsOptions =
|
|
9
|
+
export type CallbackInterfaceToolsOptions = CommonToolsOptions & {
|
|
10
10
|
/**
|
|
11
11
|
* The callback function to be called when promptDialog is called
|
|
12
12
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
2
2
|
import type { UserInterfaceTools } from '../../execution/UserInterfaceTools';
|
|
3
3
|
import type { UserInterfaceToolsPromptDialogOptions } from '../../execution/UserInterfaceTools';
|
|
4
4
|
/**
|
|
@@ -10,8 +10,8 @@ import type { UserInterfaceToolsPromptDialogOptions } from '../../execution/User
|
|
|
10
10
|
* @public exported from `@promptbook/browser`
|
|
11
11
|
*/
|
|
12
12
|
export declare class SimplePromptInterfaceTools implements UserInterfaceTools {
|
|
13
|
-
protected readonly options:
|
|
14
|
-
constructor(options?:
|
|
13
|
+
protected readonly options: CommonToolsOptions;
|
|
14
|
+
constructor(options?: CommonToolsOptions);
|
|
15
15
|
/**
|
|
16
16
|
* Trigger window.DIALOG TEMPLATE
|
|
17
17
|
*/
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { Scraper } from '../scrapers/_common/Scraper';
|
|
1
2
|
import type { Arrayable } from '../types/Arrayable';
|
|
3
|
+
import type { FilesystemTools } from './FilesystemTools';
|
|
2
4
|
import type { LlmExecutionTools } from './LlmExecutionTools';
|
|
3
5
|
import type { ScriptExecutionTools } from './ScriptExecutionTools';
|
|
4
6
|
import type { UserInterfaceTools } from './UserInterfaceTools';
|
|
@@ -9,20 +11,36 @@ import type { UserInterfaceTools } from './UserInterfaceTools';
|
|
|
9
11
|
*/
|
|
10
12
|
export type ExecutionTools = {
|
|
11
13
|
/**
|
|
12
|
-
* Tools for executing prompts
|
|
14
|
+
* Tools for executing prompts in large language models
|
|
13
15
|
*
|
|
14
|
-
* Tip: Use `
|
|
15
|
-
*
|
|
16
|
+
* Tip: Use `$provideLlmToolsFromEnv` to use all available LLM providers you configured
|
|
17
|
+
*
|
|
18
|
+
* @default [] - If not provided, no LLM execution will be possible - it does not make sense in most cases
|
|
16
19
|
*/
|
|
17
20
|
readonly llm?: Arrayable<LlmExecutionTools>;
|
|
21
|
+
/**
|
|
22
|
+
* Tools for filesystem operations
|
|
23
|
+
*
|
|
24
|
+
* Tip: Use `$provideFilesystemForNode` to use filesystem in Node.js
|
|
25
|
+
*
|
|
26
|
+
* @default undefined - If not provided, no filesystem operations will be possible
|
|
27
|
+
*/
|
|
28
|
+
readonly fs?: FilesystemTools;
|
|
29
|
+
/**
|
|
30
|
+
* Scrapers for extracting knowledge from external sources
|
|
31
|
+
*
|
|
32
|
+
* Tip: Use `$provideScrapersForNode` OR `$provideScrapersForBrowser` to use all available scrapers
|
|
33
|
+
*
|
|
34
|
+
* @default [] - If not provided, no external knowledge extraction will be possible
|
|
35
|
+
*/
|
|
36
|
+
readonly scrapers?: Arrayable<Scraper>;
|
|
18
37
|
/**
|
|
19
38
|
* Tools for executing scripts
|
|
20
39
|
*
|
|
21
40
|
* Note: You can pass multiple ScriptExecutionTools, they will be tried one by one until one of them supports the script
|
|
22
41
|
* If none of them supports the script, an error is thrown
|
|
23
|
-
* Tip: Use here `new JavascriptExecutionTools
|
|
42
|
+
* Tip: Use here `new JavascriptExecutionTools`
|
|
24
43
|
*
|
|
25
|
-
* @see https://github.com/webgptorg/promptbook/?tab=readme-ov-file#script-execution-tools
|
|
26
44
|
* @default [] - If not provided, no script execution will be possible
|
|
27
45
|
*/
|
|
28
46
|
readonly script?: Arrayable<ScriptExecutionTools>;
|
|
@@ -30,7 +48,9 @@ export type ExecutionTools = {
|
|
|
30
48
|
* Tools for interacting with the user
|
|
31
49
|
*
|
|
32
50
|
* Note: When undefined, the user interface is disabled and promptbook which requires user interaction will fail
|
|
33
|
-
* @see https://github.com/webgptorg/promptbook/?tab=readme-ov-file#user-interface-tools
|
|
34
51
|
*/
|
|
35
52
|
readonly userInterface?: UserInterfaceTools;
|
|
36
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* TODO: !!!!!! Move here also the executables and make $provideXxxxForNode
|
|
56
|
+
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type fs from 'fs/promises';
|
|
3
|
+
/**
|
|
4
|
+
* Container for all the tools needed to manipulate with filesystem
|
|
5
|
+
*/
|
|
6
|
+
export type FilesystemTools = Pick<typeof fs, 'access' | 'constants' | 'readFile' | 'stat' | 'readdir'>;
|
|
7
|
+
/**
|
|
8
|
+
* TODO: Implement destroyable pattern to free resources
|
|
9
|
+
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Promisable, ReadonlyDeep } from 'type-fest';
|
|
2
|
-
import { MultipleLlmExecutionTools } from '../../llm-providers/multiple/MultipleLlmExecutionTools';
|
|
3
2
|
import type { ExecutionReportJson } from '../../types/execution-report/ExecutionReportJson';
|
|
4
3
|
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
5
4
|
import type { TemplateJson } from '../../types/PipelineJson/TemplateJson';
|
|
@@ -28,11 +27,7 @@ type executeSingleTemplateOptions = {
|
|
|
28
27
|
/**
|
|
29
28
|
* @@@
|
|
30
29
|
*/
|
|
31
|
-
readonly tools:
|
|
32
|
-
/**
|
|
33
|
-
* @@@
|
|
34
|
-
*/
|
|
35
|
-
readonly llmTools: MultipleLlmExecutionTools;
|
|
30
|
+
readonly tools: ExecutionTools;
|
|
36
31
|
/**
|
|
37
32
|
* @@@
|
|
38
33
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
2
|
-
import { MultipleLlmExecutionTools } from '../../llm-providers/multiple/MultipleLlmExecutionTools';
|
|
3
2
|
import type { ExecutionReportJson } from '../../types/execution-report/ExecutionReportJson';
|
|
4
3
|
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
5
4
|
import type { TemplateJson } from '../../types/PipelineJson/TemplateJson';
|
|
@@ -45,11 +44,7 @@ export type ExecuteAttemptsOptions = {
|
|
|
45
44
|
/**
|
|
46
45
|
* @@@
|
|
47
46
|
*/
|
|
48
|
-
readonly tools:
|
|
49
|
-
/**
|
|
50
|
-
* @@@
|
|
51
|
-
*/
|
|
52
|
-
readonly llmTools: MultipleLlmExecutionTools;
|
|
47
|
+
readonly tools: ExecutionTools;
|
|
53
48
|
/**
|
|
54
49
|
* Settings for the pipeline executor
|
|
55
50
|
*/
|
|
@@ -8,4 +8,5 @@ export declare function translateMessages({ automaticTranslator, from, to, }: {
|
|
|
8
8
|
} & TranslatorOptions): Promise<void>;
|
|
9
9
|
/**
|
|
10
10
|
* TODO: [😶] Unite floder listing
|
|
11
|
+
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
11
12
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
|
|
2
|
+
import type { ExecutionTools } from '../ExecutionTools';
|
|
3
|
+
/**
|
|
4
|
+
* Note: There is unfortunately no equivalent for this function in the browser environment
|
|
5
|
+
* because it is not possible automatically detect configured LLM providers
|
|
6
|
+
* you need to provide them manually BUT you can help by utilities like `$provideScrapersForBrowser`
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/node`
|
|
9
|
+
*/
|
|
10
|
+
export declare function $provideExecutionToolsForNode(options?: PrepareAndScrapeOptions): Promise<ExecutionTools>;
|
|
11
|
+
/**
|
|
12
|
+
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
13
|
+
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $Register } from '
|
|
1
|
+
import { $Register } from '../../../utils/$Register';
|
|
2
2
|
import type { LlmToolsMetadata } from './LlmToolsMetadata';
|
|
3
3
|
/**
|
|
4
4
|
* @@@
|
|
@@ -8,3 +8,6 @@ import type { LlmToolsMetadata } from './LlmToolsMetadata';
|
|
|
8
8
|
* @public exported from `@promptbook/core`
|
|
9
9
|
*/
|
|
10
10
|
export declare const $llmToolsMetadataRegister: $Register<LlmToolsMetadata>;
|
|
11
|
+
/**
|
|
12
|
+
* TODO: [®] DRY Register logic
|
|
13
|
+
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LlmExecutionToolsConstructor } from '
|
|
2
|
-
import { $Register } from '
|
|
1
|
+
import type { LlmExecutionToolsConstructor } from '../../../execution/LlmExecutionToolsConstructor';
|
|
2
|
+
import { $Register } from '../../../utils/$Register';
|
|
3
3
|
/**
|
|
4
4
|
* @@@
|
|
5
5
|
*
|
|
@@ -8,3 +8,6 @@ import { $Register } from '../../utils/$Register';
|
|
|
8
8
|
* @public exported from `@promptbook/core`
|
|
9
9
|
*/
|
|
10
10
|
export declare const $llmToolsRegister: $Register<LlmExecutionToolsConstructor>;
|
|
11
|
+
/**
|
|
12
|
+
* TODO: [®] DRY Register logic
|
|
13
|
+
*/
|
|
@@ -11,14 +11,14 @@ import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
|
|
|
11
11
|
* @returns @@@
|
|
12
12
|
* @public exported from `@promptbook/node`
|
|
13
13
|
*/
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function $provideLlmToolsConfigurationFromEnv(): LlmToolsConfiguration;
|
|
15
15
|
/**
|
|
16
16
|
* TODO: [🧠][🪁] Maybe do allow to do auto-install if package not registered and not found
|
|
17
17
|
* TODO: Add Azure OpenAI
|
|
18
18
|
* TODO: [🧠][🍛]
|
|
19
19
|
* TODO: [🧠] Is there some meaningfull way how to test this util
|
|
20
|
-
* Note: [🟢] Code in this file should never be
|
|
20
|
+
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
21
21
|
* TODO: [👷♂️] @@@ Manual about construction of llmTools
|
|
22
22
|
* TODO: This should be maybe not under `_common` but under `utils`
|
|
23
23
|
* TODO: [🧠] Maybe pass env as argument
|
|
24
|
-
*/
|
|
24
|
+
* TODO: [®] DRY Register logic */
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
type
|
|
3
|
-
/**
|
|
4
|
-
* @@@
|
|
5
|
-
*
|
|
6
|
-
* @default false
|
|
7
|
-
*/
|
|
8
|
-
isCacheReloaded?: boolean;
|
|
9
|
-
};
|
|
1
|
+
import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeOptions';
|
|
2
|
+
import type { LlmExecutionToolsWithTotalUsage } from '../utils/count-total-usage/LlmExecutionToolsWithTotalUsage';
|
|
10
3
|
/**
|
|
11
4
|
* Returns LLM tools for CLI
|
|
12
5
|
*
|
|
13
6
|
* @private within the repository - for CLI utils
|
|
14
7
|
*/
|
|
15
|
-
export declare function
|
|
16
|
-
export {};
|
|
8
|
+
export declare function $provideLlmToolsForCli(options?: Pick<PrepareAndScrapeOptions, 'isCacheCleaned'>): LlmExecutionToolsWithTotalUsage;
|
|
17
9
|
/**
|
|
18
10
|
* Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
|
|
19
11
|
* TODO: [👷♂️] @@@ Manual about construction of llmTools
|
|
20
12
|
* TODO: [🥃] Allow `ptbk make` without llm tools
|
|
21
13
|
* TODO: This should be maybe not under `_common` but under `utils-internal` / `utils/internal`
|
|
14
|
+
* TODO: [®] DRY Register logic
|
|
22
15
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../../../_packages/cli.index';
|
|
2
|
+
import type { LlmExecutionToolsWithTotalUsage } from '../utils/count-total-usage/LlmExecutionToolsWithTotalUsage';
|
|
2
3
|
import type { CreateLlmToolsFromConfigurationOptions } from './createLlmToolsFromConfiguration';
|
|
3
|
-
import type { LlmExecutionToolsWithTotalUsage } from './utils/count-total-usage/LlmExecutionToolsWithTotalUsage';
|
|
4
4
|
type GetLlmToolsForTestingAndScriptsAndPlaygroundOptions = CreateLlmToolsFromConfigurationOptions & {
|
|
5
5
|
/**
|
|
6
6
|
* @@@
|
|
@@ -14,10 +14,11 @@ type GetLlmToolsForTestingAndScriptsAndPlaygroundOptions = CreateLlmToolsFromCon
|
|
|
14
14
|
*
|
|
15
15
|
* @private within the repository - JUST FOR TESTS, SCRIPTS AND PLAYGROUND
|
|
16
16
|
*/
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function $provideLlmToolsForTestingAndScriptsAndPlayground(options?: GetLlmToolsForTestingAndScriptsAndPlaygroundOptions): LlmExecutionToolsWithTotalUsage;
|
|
18
18
|
export {};
|
|
19
19
|
/**
|
|
20
20
|
* Note: [⚪] This should never be in any released package
|
|
21
21
|
* TODO: [👷♂️] @@@ Manual about construction of llmTools
|
|
22
22
|
* TODO: This should be maybe not under `_common` but under `utils-internal` / `utils/internal`
|
|
23
|
+
* TODO: [®] DRY Register logic
|
|
23
24
|
*/
|