@promptbook/types 0.55.0 → 0.56.0-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/esm/index.es.js +0 -10
- package/esm/index.es.js.map +1 -1
- package/esm/typings/_packages/anthropic-claude.index.d.ts +2 -0
- package/esm/typings/_packages/azure-openai.index.d.ts +2 -0
- package/esm/typings/_packages/cli.index.d.ts +2 -0
- package/esm/typings/_packages/core.index.d.ts +3 -3
- package/esm/typings/_packages/execute-javascript.index.d.ts +2 -0
- package/esm/typings/_packages/{mock.index.d.ts → fake-llm.index.d.ts} +2 -1
- package/esm/typings/_packages/langtail.index.d.ts +2 -0
- package/esm/typings/_packages/node.index.d.ts +4 -0
- package/esm/typings/_packages/openai.index.d.ts +2 -0
- package/esm/typings/_packages/remote-client.index.d.ts +2 -0
- package/esm/typings/_packages/remote-server.index.d.ts +2 -0
- package/esm/typings/_packages/types.index.d.ts +3 -2
- package/esm/typings/_packages/utils.index.d.ts +2 -1
- package/esm/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.d.ts +0 -1
- package/esm/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +0 -10
- package/esm/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +0 -3
- package/esm/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +0 -3
- package/esm/typings/library/constructors/createPromptbookLibraryFromUrl.d.ts +0 -4
- package/esm/typings/library/constructors/createPromptbookSublibrary.d.ts +0 -3
- package/package.json +2 -2
- package/umd/index.umd.js +4 -17
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/_packages/anthropic-claude.index.d.ts +2 -0
- package/umd/typings/_packages/azure-openai.index.d.ts +2 -0
- package/umd/typings/_packages/cli.index.d.ts +2 -0
- package/umd/typings/_packages/core.index.d.ts +3 -3
- package/umd/typings/_packages/execute-javascript.index.d.ts +2 -0
- package/umd/typings/_packages/{mock.index.d.ts → fake-llm.index.d.ts} +2 -1
- package/umd/typings/_packages/langtail.index.d.ts +2 -0
- package/umd/typings/_packages/node.index.d.ts +4 -0
- package/umd/typings/_packages/openai.index.d.ts +2 -0
- package/umd/typings/_packages/remote-client.index.d.ts +2 -0
- package/umd/typings/_packages/remote-server.index.d.ts +2 -0
- package/umd/typings/_packages/types.index.d.ts +3 -2
- package/umd/typings/_packages/utils.index.d.ts +2 -1
- package/umd/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.d.ts +0 -1
- package/umd/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +0 -10
- package/umd/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +0 -3
- package/umd/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +0 -3
- package/umd/typings/library/constructors/createPromptbookLibraryFromUrl.d.ts +0 -4
- package/umd/typings/library/constructors/createPromptbookSublibrary.d.ts +0 -3
package/README.md
CHANGED
|
@@ -324,6 +324,7 @@ Or you can install them separately:
|
|
|
324
324
|
- ⭐ **[ptbk](https://www.npmjs.com/package/ptbk)** - Bundle of all packages, when you want to install everything and you don't care about the size
|
|
325
325
|
- **[promptbook](https://www.npmjs.com/package/promptbook)** - Same as `ptbk`
|
|
326
326
|
- **[@promptbook/core](https://www.npmjs.com/package/@promptbook/core)** - Core of the library, it contains the main logic for promptbooks
|
|
327
|
+
- **[@promptbook/node](https://www.npmjs.com/package/@promptbook/node)** - Core of the library for Node.js
|
|
327
328
|
- ⭐ **[@promptbook/utils](https://www.npmjs.com/package/@promptbook/utils)** - Utility functions used in the library but also useful for individual use in preprocessing and postprocessing LLM inputs and outputs
|
|
328
329
|
- _(Not finished)_ **[@promptbook/wizzard](https://www.npmjs.com/package/@promptbook/wizzard)** - Wizard for creating+running promptbooks in single line
|
|
329
330
|
- **[@promptbook/execute-javascript](https://www.npmjs.com/package/@promptbook/execute-javascript)** - Execution tools for javascript inside promptbooks
|
|
@@ -331,7 +332,7 @@ Or you can install them separately:
|
|
|
331
332
|
- **[@promptbook/anthropic-claude](https://www.npmjs.com/package/@promptbook/anthropic-claude)** - Execution tools for Anthropic Claude API, wrapper around Anthropic Claude SDK
|
|
332
333
|
- **[@promptbook/azure-openai](https://www.npmjs.com/package/@promptbook/azure-openai)** - Execution tools for Azure OpenAI API
|
|
333
334
|
- **[@promptbook/langtail](https://www.npmjs.com/package/@promptbook/langtail)** - Execution tools for Langtail API, wrapper around Langtail SDK
|
|
334
|
-
- **[@promptbook/
|
|
335
|
+
- **[@promptbook/fake-llm](https://www.npmjs.com/package/@promptbook/fake-llm)** - Mocked execution tools for testing the library and saving the tokens
|
|
335
336
|
- **[@promptbook/remote-client](https://www.npmjs.com/package/@promptbook/remote-client)** - Remote client for remote execution of promptbooks
|
|
336
337
|
- **[@promptbook/remote-server](https://www.npmjs.com/package/@promptbook/remote-server)** - Remote server for remote execution of promptbooks
|
|
337
338
|
- **[@promptbook/types](https://www.npmjs.com/package/@promptbook/types)** - Just typescript types used in the library
|
|
@@ -516,7 +517,7 @@ There are [postprocessing functions](#postprocessing-functions) that can be used
|
|
|
516
517
|
Executor is a simple async function that takes **input parameters** and returns **output parameters**.
|
|
517
518
|
It is constructed by combining execution tools and promptbook to execute together.
|
|
518
519
|
|
|
519
|
-
### 🃏 Jokers (conditions)
|
|
520
|
+
### 🃏 Jokers (conditions)
|
|
520
521
|
|
|
521
522
|
Joker is a previously defined parameter that is used to bypass some parts of the pipeline.
|
|
522
523
|
If the joker is present in the template, it is checked to see if it meets the requirements (without postprocessing), and if so, it is used instead of executing that prompt template. There can be multiple wildcards in a prompt template, if so they are checked in order and the first one that meets the requirements is used.
|
package/esm/index.es.js
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Units of text measurement
|
|
3
|
-
*/
|
|
4
|
-
var EXPECTATION_UNITS = ['CHARACTERS', 'WORDS', 'SENTENCES', 'LINES', 'PARAGRAPHS', 'PAGES'];
|
|
5
|
-
/**
|
|
6
|
-
* TODO: [💝] Unite object for expecting amount and format - remove expectFormat
|
|
7
|
-
* TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
|
|
8
|
-
* TODO: [👙][🧠] Just selecting gpt3 or gpt4 level of model
|
|
9
|
-
*/
|
|
10
1
|
|
|
11
|
-
export { EXPECTATION_UNITS };
|
|
12
2
|
//# sourceMappingURL=index.es.js.map
|
package/esm/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { AnthropicClaudeExecutionTools } from '../execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionTools';
|
|
2
2
|
import { AnthropicClaudeExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
|
|
3
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
4
|
+
export { PROMPTBOOK_VERSION };
|
|
3
5
|
export { AnthropicClaudeExecutionTools, AnthropicClaudeExecutionToolsOptions };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { AzureOpenAiExecutionTools } from '../execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionTools';
|
|
2
2
|
import { AzureOpenAiExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionToolsOptions';
|
|
3
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
4
|
+
export { PROMPTBOOK_VERSION };
|
|
3
5
|
export { AzureOpenAiExecutionTools, AzureOpenAiExecutionToolsOptions };
|
|
@@ -20,7 +20,6 @@ import { SimplePromptInterfaceTools } from '../execution/plugins/user-interface-
|
|
|
20
20
|
import { addUsage } from '../execution/utils/addUsage';
|
|
21
21
|
import { checkExpectations, isPassingExpectations } from '../execution/utils/checkExpectations';
|
|
22
22
|
import { usageToWorktime } from '../execution/utils/usageToWorktime';
|
|
23
|
-
import { createPromptbookLibraryFromDirectory } from '../library/constructors/createPromptbookLibraryFromDirectory';
|
|
24
23
|
import { createPromptbookLibraryFromSources } from '../library/constructors/createPromptbookLibraryFromSources';
|
|
25
24
|
import { createPromptbookLibraryFromUrl } from '../library/constructors/createPromptbookLibraryFromUrl';
|
|
26
25
|
import { createPromptbookSublibrary } from '../library/constructors/createPromptbookSublibrary';
|
|
@@ -30,10 +29,11 @@ import { executionReportJsonToString } from '../types/execution-report/execution
|
|
|
30
29
|
import { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
31
30
|
import { ExecutionTypes } from '../types/ExecutionTypes';
|
|
32
31
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
32
|
+
export { PROMPTBOOK_VERSION };
|
|
33
33
|
export { justTestFsImport };
|
|
34
|
-
export { ExecutionTypes
|
|
34
|
+
export { ExecutionTypes };
|
|
35
35
|
export { addUsage, assertsExecutionSuccessful, checkExpectations, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, isPassingExpectations, prettifyPromptbookString, usageToWorktime, };
|
|
36
|
-
export {
|
|
36
|
+
export { createPromptbookLibraryFromSources, createPromptbookLibraryFromUrl, createPromptbookSublibrary, SimplePromptbookLibrary, };
|
|
37
37
|
export { SimplePromptInterfaceTools };
|
|
38
38
|
export { promptbookJsonToString, promptbookStringToJson, validatePromptbookJson };
|
|
39
39
|
export { createPromptbookExecutor, MultipleLlmExecutionTools };
|
|
@@ -19,6 +19,8 @@ import { removeQuotes } from '../utils/removeQuotes';
|
|
|
19
19
|
import { trimCodeBlock } from '../utils/trimCodeBlock';
|
|
20
20
|
import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
|
|
21
21
|
import { unwrapResult } from '../utils/unwrapResult';
|
|
22
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
23
|
+
export { PROMPTBOOK_VERSION };
|
|
22
24
|
declare const POSTPROCESSING_FUNCTIONS: {
|
|
23
25
|
spaceTrim: typeof spaceTrim;
|
|
24
26
|
removeQuotes: typeof removeQuotes;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MockedEchoLlmExecutionTools } from '../execution/plugins/llm-execution-tools/mocked/MockedEchoLlmExecutionTools';
|
|
2
2
|
import { MockedFackedLlmExecutionTools } from '../execution/plugins/llm-execution-tools/mocked/MockedFackedLlmExecutionTools';
|
|
3
|
-
|
|
3
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
4
|
+
export { MockedEchoLlmExecutionTools, MockedFackedLlmExecutionTools, PROMPTBOOK_VERSION };
|
|
4
5
|
/**
|
|
5
6
|
* TODO: [🚏] FakeLLM
|
|
6
7
|
*/
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { LangtailExecutionTools } from '../execution/plugins/llm-execution-tools/langtail/LangtailExecutionTools';
|
|
2
2
|
import { LangtailExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/langtail/LangtailExecutionToolsOptions';
|
|
3
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
4
|
+
export { PROMPTBOOK_VERSION };
|
|
3
5
|
export { LangtailExecutionTools, LangtailExecutionToolsOptions };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { OPENAI_MODELS } from '../execution/plugins/llm-execution-tools/openai/openai-models';
|
|
2
2
|
import { OpenAiExecutionTools } from '../execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools';
|
|
3
3
|
import { OpenAiExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/openai/OpenAiExecutionToolsOptions';
|
|
4
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
5
|
+
export { PROMPTBOOK_VERSION };
|
|
4
6
|
export { OPENAI_MODELS, OpenAiExecutionTools, OpenAiExecutionToolsOptions };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { RemoteServerOptions } from '../execution/plugins/llm-execution-tools/remote/interfaces/RemoteServerOptions';
|
|
2
2
|
import { RemoteLlmExecutionTools } from '../execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionTools';
|
|
3
3
|
import { RemoteLlmExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionToolsOptions';
|
|
4
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
5
|
+
export { PROMPTBOOK_VERSION };
|
|
4
6
|
export { RemoteLlmExecutionTools, RemoteLlmExecutionToolsOptions, RemoteServerOptions };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { RemoteServerOptions } from '../execution/plugins/llm-execution-tools/remote/interfaces/RemoteServerOptions';
|
|
2
2
|
import { startRemoteServer } from '../execution/plugins/llm-execution-tools/remote/startRemoteServer';
|
|
3
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
4
|
+
export { PROMPTBOOK_VERSION };
|
|
3
5
|
export { RemoteServerOptions, startRemoteServer };
|
|
@@ -20,8 +20,9 @@ import type { TaskProgress } from '../types/TaskProgress';
|
|
|
20
20
|
import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
|
|
21
21
|
import type { string_char_emoji } from '../types/typeAliasEmoji';
|
|
22
22
|
import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version } from '../types/typeAliases';
|
|
23
|
-
import { FromtoItems } from '../utils/FromtoItems';
|
|
24
|
-
|
|
23
|
+
import type { FromtoItems } from '../utils/FromtoItems';
|
|
24
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
25
|
+
export type { AvailableModel, client_id, CommonExecutionToolsOptions, ExecutionReportJson, ExecutionTools, ExecutionType, EXPECTATION_UNITS, ExpectationAmount, Expectations, ExpectationUnit, FromtoItems, LlmExecutionTools, LlmTemplateJson, ModelRequirements, ModelVariant, Parameters, Prompt, PROMPTBOOK_VERSION, PromptbookExecutor, PromptbookJson, PromptbookLibrary, PromptbookString, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptDialogJson, PromptResult, PromptResultUsage, PromptResultUsageCounts, PromptTemplateJson, PromptTemplateParameterJson, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptJson, ScriptLanguage, SimpleTemplateJson, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version, TaskProgress, UncertainNumber, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, };
|
|
25
26
|
/**
|
|
26
27
|
* TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
|
|
27
28
|
*/
|
|
@@ -47,7 +47,8 @@ import { union } from '../utils/sets/union';
|
|
|
47
47
|
import { trimCodeBlock } from '../utils/trimCodeBlock';
|
|
48
48
|
import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
|
|
49
49
|
import { unwrapResult } from '../utils/unwrapResult';
|
|
50
|
-
|
|
50
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
51
|
+
export { forEachAsync, PROMPTBOOK_VERSION };
|
|
51
52
|
export { extractAllBlocksFromMarkdown, // <- [🌻]
|
|
52
53
|
extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
|
|
53
54
|
extractOneBlockFromMarkdown, extractParameters, extractVariables, isValidJsonString, parseNumber, // <- [🌻]
|
package/esm/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.d.ts
CHANGED
|
@@ -10,6 +10,5 @@ import type { PostprocessingFunction } from '../../script-execution-tools/javasc
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function $fakeTextToExpectations(expectations: Expectations, postprocessing?: Array<PostprocessingFunction>): Promise<string>;
|
|
12
12
|
/**
|
|
13
|
-
* TODO: [🚏] Implement better - create FakeLLM from this
|
|
14
13
|
* TODO: [💝] Unite object for expecting amount and format - use here also a format
|
|
15
14
|
*/
|
|
@@ -41,13 +41,3 @@ type CreatePromptbookLibraryFromDirectoryOptions = {
|
|
|
41
41
|
*/
|
|
42
42
|
export declare function createPromptbookLibraryFromDirectory(path: string_folder_path, options?: CreatePromptbookLibraryFromDirectoryOptions): Promise<PromptbookLibrary>;
|
|
43
43
|
export {};
|
|
44
|
-
/***
|
|
45
|
-
* TODO: [🧠] Maybe do not do hacks like [1] and just create package @promptbook/node
|
|
46
|
-
* [🍓][🚯] maybe make `@promptbook/library` package
|
|
47
|
-
* TODO: Fix the dynamic import issue in Webpack (! Not working !)
|
|
48
|
-
* > ./node_modules/@promptbook/core/esm/index.es.js
|
|
49
|
-
* > Critical dependency: the request of a dependency is an expression
|
|
50
|
-
*
|
|
51
|
-
* Note: [1] Using require(just('fs/promises')) to allow
|
|
52
|
-
* the `@promptbook/core` work for both Node.js and browser environments
|
|
53
|
-
*/
|
|
@@ -21,6 +21,3 @@ import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
|
21
21
|
* @private Just internal tool for other constructor functions
|
|
22
22
|
*/
|
|
23
23
|
export declare function createPromptbookLibraryFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PromptbookJson | PromptbookString>> | (() => Promise<Array<PromptbookJson | PromptbookString>>)): PromptbookLibrary;
|
|
24
|
-
/***
|
|
25
|
-
* TODO: [🍓][🚯] !!! Add to README and samples + maybe make `@promptbook/library` package
|
|
26
|
-
*/
|
|
@@ -11,6 +11,3 @@ import { SimplePromptbookLibrary } from '../SimplePromptbookLibrary';
|
|
|
11
11
|
* @returns PromptbookLibrary
|
|
12
12
|
*/
|
|
13
13
|
export declare function createPromptbookLibraryFromSources(...promptbookSources: Array<PromptbookJson | PromptbookString>): SimplePromptbookLibrary;
|
|
14
|
-
/***
|
|
15
|
-
* TODO: [🍓][🚯] !!! Add to README and samples + maybe make `@promptbook/library` package
|
|
16
|
-
*/
|
|
@@ -24,7 +24,3 @@ type CreatePromptbookLibraryFromUrlyOptions = {
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function createPromptbookLibraryFromUrl(url: string_url | URL, options: CreatePromptbookLibraryFromUrlyOptions): Promise<PromptbookLibrary>;
|
|
26
26
|
export {};
|
|
27
|
-
/***
|
|
28
|
-
* TODO: [⚖] Compatible with remote server
|
|
29
|
-
* TODO: [🍓][🚯] !!! Add to README and samples + maybe make `@promptbook/library` package
|
|
30
|
-
*/
|
|
@@ -10,6 +10,3 @@ import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
|
10
10
|
* @returns PromptbookLibrary
|
|
11
11
|
*/
|
|
12
12
|
export declare function createPromptbookSublibrary(library: PromptbookLibrary, predicate: (url: string_promptbook_url) => boolean): PromptbookLibrary;
|
|
13
|
-
/***
|
|
14
|
-
* TODO: [🍓][🚯] !!! Add to README and samples + maybe make `@promptbook/library` package
|
|
15
|
-
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.0-3",
|
|
4
4
|
"description": "Library to supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@promptbook/core": "0.
|
|
48
|
+
"@promptbook/core": "0.56.0-3"
|
|
49
49
|
},
|
|
50
50
|
"main": "./umd/index.umd.js",
|
|
51
51
|
"module": "./esm/index.es.js",
|
package/umd/index.umd.js
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
(function (
|
|
2
|
-
typeof
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
})(this, (function (exports) { 'use strict';
|
|
1
|
+
(function (factory) {
|
|
2
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
3
|
+
factory();
|
|
4
|
+
})((function () { 'use strict';
|
|
6
5
|
|
|
7
|
-
/**
|
|
8
|
-
* Units of text measurement
|
|
9
|
-
*/
|
|
10
|
-
var EXPECTATION_UNITS = ['CHARACTERS', 'WORDS', 'SENTENCES', 'LINES', 'PARAGRAPHS', 'PAGES'];
|
|
11
|
-
/**
|
|
12
|
-
* TODO: [💝] Unite object for expecting amount and format - remove expectFormat
|
|
13
|
-
* TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
|
|
14
|
-
* TODO: [👙][🧠] Just selecting gpt3 or gpt4 level of model
|
|
15
|
-
*/
|
|
16
6
|
|
|
17
|
-
exports.EXPECTATION_UNITS = EXPECTATION_UNITS;
|
|
18
|
-
|
|
19
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
20
7
|
|
|
21
8
|
}));
|
|
22
9
|
//# sourceMappingURL=index.umd.js.map
|
package/umd/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { AnthropicClaudeExecutionTools } from '../execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionTools';
|
|
2
2
|
import { AnthropicClaudeExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
|
|
3
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
4
|
+
export { PROMPTBOOK_VERSION };
|
|
3
5
|
export { AnthropicClaudeExecutionTools, AnthropicClaudeExecutionToolsOptions };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { AzureOpenAiExecutionTools } from '../execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionTools';
|
|
2
2
|
import { AzureOpenAiExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionToolsOptions';
|
|
3
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
4
|
+
export { PROMPTBOOK_VERSION };
|
|
3
5
|
export { AzureOpenAiExecutionTools, AzureOpenAiExecutionToolsOptions };
|
|
@@ -20,7 +20,6 @@ import { SimplePromptInterfaceTools } from '../execution/plugins/user-interface-
|
|
|
20
20
|
import { addUsage } from '../execution/utils/addUsage';
|
|
21
21
|
import { checkExpectations, isPassingExpectations } from '../execution/utils/checkExpectations';
|
|
22
22
|
import { usageToWorktime } from '../execution/utils/usageToWorktime';
|
|
23
|
-
import { createPromptbookLibraryFromDirectory } from '../library/constructors/createPromptbookLibraryFromDirectory';
|
|
24
23
|
import { createPromptbookLibraryFromSources } from '../library/constructors/createPromptbookLibraryFromSources';
|
|
25
24
|
import { createPromptbookLibraryFromUrl } from '../library/constructors/createPromptbookLibraryFromUrl';
|
|
26
25
|
import { createPromptbookSublibrary } from '../library/constructors/createPromptbookSublibrary';
|
|
@@ -30,10 +29,11 @@ import { executionReportJsonToString } from '../types/execution-report/execution
|
|
|
30
29
|
import { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
31
30
|
import { ExecutionTypes } from '../types/ExecutionTypes';
|
|
32
31
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
32
|
+
export { PROMPTBOOK_VERSION };
|
|
33
33
|
export { justTestFsImport };
|
|
34
|
-
export { ExecutionTypes
|
|
34
|
+
export { ExecutionTypes };
|
|
35
35
|
export { addUsage, assertsExecutionSuccessful, checkExpectations, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, isPassingExpectations, prettifyPromptbookString, usageToWorktime, };
|
|
36
|
-
export {
|
|
36
|
+
export { createPromptbookLibraryFromSources, createPromptbookLibraryFromUrl, createPromptbookSublibrary, SimplePromptbookLibrary, };
|
|
37
37
|
export { SimplePromptInterfaceTools };
|
|
38
38
|
export { promptbookJsonToString, promptbookStringToJson, validatePromptbookJson };
|
|
39
39
|
export { createPromptbookExecutor, MultipleLlmExecutionTools };
|
|
@@ -19,6 +19,8 @@ import { removeQuotes } from '../utils/removeQuotes';
|
|
|
19
19
|
import { trimCodeBlock } from '../utils/trimCodeBlock';
|
|
20
20
|
import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
|
|
21
21
|
import { unwrapResult } from '../utils/unwrapResult';
|
|
22
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
23
|
+
export { PROMPTBOOK_VERSION };
|
|
22
24
|
declare const POSTPROCESSING_FUNCTIONS: {
|
|
23
25
|
spaceTrim: typeof spaceTrim;
|
|
24
26
|
removeQuotes: typeof removeQuotes;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MockedEchoLlmExecutionTools } from '../execution/plugins/llm-execution-tools/mocked/MockedEchoLlmExecutionTools';
|
|
2
2
|
import { MockedFackedLlmExecutionTools } from '../execution/plugins/llm-execution-tools/mocked/MockedFackedLlmExecutionTools';
|
|
3
|
-
|
|
3
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
4
|
+
export { MockedEchoLlmExecutionTools, MockedFackedLlmExecutionTools, PROMPTBOOK_VERSION };
|
|
4
5
|
/**
|
|
5
6
|
* TODO: [🚏] FakeLLM
|
|
6
7
|
*/
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { LangtailExecutionTools } from '../execution/plugins/llm-execution-tools/langtail/LangtailExecutionTools';
|
|
2
2
|
import { LangtailExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/langtail/LangtailExecutionToolsOptions';
|
|
3
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
4
|
+
export { PROMPTBOOK_VERSION };
|
|
3
5
|
export { LangtailExecutionTools, LangtailExecutionToolsOptions };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { OPENAI_MODELS } from '../execution/plugins/llm-execution-tools/openai/openai-models';
|
|
2
2
|
import { OpenAiExecutionTools } from '../execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools';
|
|
3
3
|
import { OpenAiExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/openai/OpenAiExecutionToolsOptions';
|
|
4
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
5
|
+
export { PROMPTBOOK_VERSION };
|
|
4
6
|
export { OPENAI_MODELS, OpenAiExecutionTools, OpenAiExecutionToolsOptions };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { RemoteServerOptions } from '../execution/plugins/llm-execution-tools/remote/interfaces/RemoteServerOptions';
|
|
2
2
|
import { RemoteLlmExecutionTools } from '../execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionTools';
|
|
3
3
|
import { RemoteLlmExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionToolsOptions';
|
|
4
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
5
|
+
export { PROMPTBOOK_VERSION };
|
|
4
6
|
export { RemoteLlmExecutionTools, RemoteLlmExecutionToolsOptions, RemoteServerOptions };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { RemoteServerOptions } from '../execution/plugins/llm-execution-tools/remote/interfaces/RemoteServerOptions';
|
|
2
2
|
import { startRemoteServer } from '../execution/plugins/llm-execution-tools/remote/startRemoteServer';
|
|
3
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
4
|
+
export { PROMPTBOOK_VERSION };
|
|
3
5
|
export { RemoteServerOptions, startRemoteServer };
|
|
@@ -20,8 +20,9 @@ import type { TaskProgress } from '../types/TaskProgress';
|
|
|
20
20
|
import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
|
|
21
21
|
import type { string_char_emoji } from '../types/typeAliasEmoji';
|
|
22
22
|
import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version } from '../types/typeAliases';
|
|
23
|
-
import { FromtoItems } from '../utils/FromtoItems';
|
|
24
|
-
|
|
23
|
+
import type { FromtoItems } from '../utils/FromtoItems';
|
|
24
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
25
|
+
export type { AvailableModel, client_id, CommonExecutionToolsOptions, ExecutionReportJson, ExecutionTools, ExecutionType, EXPECTATION_UNITS, ExpectationAmount, Expectations, ExpectationUnit, FromtoItems, LlmExecutionTools, LlmTemplateJson, ModelRequirements, ModelVariant, Parameters, Prompt, PROMPTBOOK_VERSION, PromptbookExecutor, PromptbookJson, PromptbookLibrary, PromptbookString, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptDialogJson, PromptResult, PromptResultUsage, PromptResultUsageCounts, PromptTemplateJson, PromptTemplateParameterJson, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptJson, ScriptLanguage, SimpleTemplateJson, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version, TaskProgress, UncertainNumber, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, };
|
|
25
26
|
/**
|
|
26
27
|
* TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
|
|
27
28
|
*/
|
|
@@ -47,7 +47,8 @@ import { union } from '../utils/sets/union';
|
|
|
47
47
|
import { trimCodeBlock } from '../utils/trimCodeBlock';
|
|
48
48
|
import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
|
|
49
49
|
import { unwrapResult } from '../utils/unwrapResult';
|
|
50
|
-
|
|
50
|
+
import { PROMPTBOOK_VERSION } from '../version';
|
|
51
|
+
export { forEachAsync, PROMPTBOOK_VERSION };
|
|
51
52
|
export { extractAllBlocksFromMarkdown, // <- [🌻]
|
|
52
53
|
extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
|
|
53
54
|
extractOneBlockFromMarkdown, extractParameters, extractVariables, isValidJsonString, parseNumber, // <- [🌻]
|
package/umd/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.d.ts
CHANGED
|
@@ -10,6 +10,5 @@ import type { PostprocessingFunction } from '../../script-execution-tools/javasc
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function $fakeTextToExpectations(expectations: Expectations, postprocessing?: Array<PostprocessingFunction>): Promise<string>;
|
|
12
12
|
/**
|
|
13
|
-
* TODO: [🚏] Implement better - create FakeLLM from this
|
|
14
13
|
* TODO: [💝] Unite object for expecting amount and format - use here also a format
|
|
15
14
|
*/
|
|
@@ -41,13 +41,3 @@ type CreatePromptbookLibraryFromDirectoryOptions = {
|
|
|
41
41
|
*/
|
|
42
42
|
export declare function createPromptbookLibraryFromDirectory(path: string_folder_path, options?: CreatePromptbookLibraryFromDirectoryOptions): Promise<PromptbookLibrary>;
|
|
43
43
|
export {};
|
|
44
|
-
/***
|
|
45
|
-
* TODO: [🧠] Maybe do not do hacks like [1] and just create package @promptbook/node
|
|
46
|
-
* [🍓][🚯] maybe make `@promptbook/library` package
|
|
47
|
-
* TODO: Fix the dynamic import issue in Webpack (! Not working !)
|
|
48
|
-
* > ./node_modules/@promptbook/core/esm/index.es.js
|
|
49
|
-
* > Critical dependency: the request of a dependency is an expression
|
|
50
|
-
*
|
|
51
|
-
* Note: [1] Using require(just('fs/promises')) to allow
|
|
52
|
-
* the `@promptbook/core` work for both Node.js and browser environments
|
|
53
|
-
*/
|
|
@@ -21,6 +21,3 @@ import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
|
21
21
|
* @private Just internal tool for other constructor functions
|
|
22
22
|
*/
|
|
23
23
|
export declare function createPromptbookLibraryFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PromptbookJson | PromptbookString>> | (() => Promise<Array<PromptbookJson | PromptbookString>>)): PromptbookLibrary;
|
|
24
|
-
/***
|
|
25
|
-
* TODO: [🍓][🚯] !!! Add to README and samples + maybe make `@promptbook/library` package
|
|
26
|
-
*/
|
|
@@ -11,6 +11,3 @@ import { SimplePromptbookLibrary } from '../SimplePromptbookLibrary';
|
|
|
11
11
|
* @returns PromptbookLibrary
|
|
12
12
|
*/
|
|
13
13
|
export declare function createPromptbookLibraryFromSources(...promptbookSources: Array<PromptbookJson | PromptbookString>): SimplePromptbookLibrary;
|
|
14
|
-
/***
|
|
15
|
-
* TODO: [🍓][🚯] !!! Add to README and samples + maybe make `@promptbook/library` package
|
|
16
|
-
*/
|
|
@@ -24,7 +24,3 @@ type CreatePromptbookLibraryFromUrlyOptions = {
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function createPromptbookLibraryFromUrl(url: string_url | URL, options: CreatePromptbookLibraryFromUrlyOptions): Promise<PromptbookLibrary>;
|
|
26
26
|
export {};
|
|
27
|
-
/***
|
|
28
|
-
* TODO: [⚖] Compatible with remote server
|
|
29
|
-
* TODO: [🍓][🚯] !!! Add to README and samples + maybe make `@promptbook/library` package
|
|
30
|
-
*/
|
|
@@ -10,6 +10,3 @@ import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
|
10
10
|
* @returns PromptbookLibrary
|
|
11
11
|
*/
|
|
12
12
|
export declare function createPromptbookSublibrary(library: PromptbookLibrary, predicate: (url: string_promptbook_url) => boolean): PromptbookLibrary;
|
|
13
|
-
/***
|
|
14
|
-
* TODO: [🍓][🚯] !!! Add to README and samples + maybe make `@promptbook/library` package
|
|
15
|
-
*/
|