Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@promptbook/node

Package Overview
Dependencies
Maintainers
0
Versions
243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@promptbook/node - npm Package Compare versions

Comparing version 0.58.0 to 0.59.0-0

esm/typings/expectations/drafts/isDomainNameFree.d.ts

19

esm/typings/_packages/core.index.d.ts

@@ -16,15 +16,14 @@ import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptbookString';

import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
import { CallbackInterfaceTools } from '../knowledgebase/dialogs/callback/CallbackInterfaceTools';
import type { CallbackInterfaceToolsOptions } from '../knowledgebase/dialogs/callback/CallbackInterfaceToolsOptions';
import { SimplePromptInterfaceTools } from '../knowledgebase/dialogs/simple-prompt/SimplePromptInterfaceTools';
import { addUsage } from '../execution/utils/addUsage';
import { checkExpectations } from '../execution/utils/checkExpectations';
import { isPassingExpectations } from '../execution/utils/checkExpectations';
import { checkExpectations, isPassingExpectations } from '../execution/utils/checkExpectations';
import { usageToWorktime } from '../execution/utils/usageToWorktime';
import { createPromptbookLibraryFromPromise } from '../library/constructors/createPromptbookLibraryFromPromise';
import { createPromptbookLibraryFromSources } from '../library/constructors/createPromptbookLibraryFromSources';
import { createPromptbookLibraryFromUrl } from '../library/constructors/createPromptbookLibraryFromUrl';
import { createPromptbookSublibrary } from '../library/constructors/createPromptbookSublibrary';
import { SimplePromptbookLibrary } from '../library/SimplePromptbookLibrary';
import { CallbackInterfaceTools } from '../knowledge/dialogs/callback/CallbackInterfaceTools';
import type { CallbackInterfaceToolsOptions } from '../knowledge/dialogs/callback/CallbackInterfaceToolsOptions';
import { SimplePromptInterfaceTools } from '../knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools';
import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools';
import { createPromptbookLibraryFromPromise } from '../promptbook-library/constructors/createPromptbookLibraryFromPromise';
import { createPromptbookLibraryFromSources } from '../promptbook-library/constructors/createPromptbookLibraryFromSources';
import { createPromptbookLibraryFromUrl } from '../promptbook-library/constructors/createPromptbookLibraryFromUrl';
import { createPromptbookSublibrary } from '../promptbook-library/constructors/createPromptbookSublibrary';
import { SimplePromptbookLibrary } from '../promptbook-library/SimplePromptbookLibrary';
import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';

@@ -31,0 +30,0 @@ import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';

@@ -1,4 +0,4 @@

import { createPromptbookLibraryFromDirectory } from '../library/constructors/createPromptbookLibraryFromDirectory';
import { createPromptbookLibraryFromDirectory } from '../promptbook-library/constructors/createPromptbookLibraryFromDirectory';
import { PROMPTBOOK_VERSION } from '../version';
export { PROMPTBOOK_VERSION };
export { createPromptbookLibraryFromDirectory };
import type { CommonExecutionToolsOptions } from '../execution/CommonExecutionToolsOptions';
import type { ExecutionTools } from '../execution/ExecutionTools';
import type { AvailableModel } from '../execution/LlmExecutionTools';
import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
import type { PromptChatResult } from '../execution/PromptResult';
import type { PromptCommonResult } from '../execution/PromptResult';
import type { PromptCompletionResult } from '../execution/PromptResult';
import type { PromptResult } from '../execution/PromptResult';
import type { PromptResultUsage } from '../execution/PromptResult';
import type { PromptResultUsageCounts } from '../execution/PromptResult';
import type { UncertainNumber } from '../execution/PromptResult';
import type { AvailableModel, LlmExecutionTools } from '../execution/LlmExecutionTools';
import type { PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, UncertainNumber } from '../execution/PromptResult';
import type { PromptbookExecutor } from '../execution/PromptbookExecutor';
import type { ScriptExecutionTools } from '../execution/ScriptExecutionTools';
import type { ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';
import type { UserInterfaceTools } from '../execution/UserInterfaceTools';
import type { UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
import type { PromptbookLibrary } from '../library/PromptbookLibrary';
import type { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';
import type { UserInterfaceTools, UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
import type { PromptbookLibrary } from '../promptbook-library/PromptbookLibrary';
import type { ExecutionType } from '../types/ExecutionTypes';
import type { ModelRequirements } from '../types/ModelRequirements';
import type { ModelVariant } from '../types/ModelRequirements';
import type { ModelRequirements, ModelVariant } from '../types/ModelRequirements';
import type { Parameters } from '../types/Parameters';
import type { Prompt } from '../types/Prompt';
import type { ExpectationAmount } from '../types/PromptbookJson/PromptTemplateJson';
import type { Expectations } from '../types/PromptbookJson/PromptTemplateJson';
import type { ExpectationUnit } from '../types/PromptbookJson/PromptTemplateJson';
import type { LlmTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
import type { PromptDialogJson } from '../types/PromptbookJson/PromptTemplateJson';
import type { PromptTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
import type { ScriptJson } from '../types/PromptbookJson/PromptTemplateJson';
import type { SimpleTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
import { KnowledgeJson } from '../types/PromptbookJson/KnowledgeJson';
import { MaterialKnowledgePieceJson } from '../types/PromptbookJson/MaterialKnowledgePieceJson';
import type { ExpectationAmount, Expectations, ExpectationUnit, LlmTemplateJson, PromptDialogJson, PromptTemplateJson, ScriptJson, SimpleTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
import { EXPECTATION_UNITS } from '../types/PromptbookJson/PromptTemplateJson';

@@ -39,47 +24,3 @@ import type { PromptTemplateParameterJson } from '../types/PromptbookJson/PromptTemplateParameterJson';

import type { string_char_emoji } from '../types/typeAliasEmoji';
import type { client_id } from '../types/typeAliases';
import type { string_char } from '../types/typeAliases';
import type { string_chat_prompt } from '../types/typeAliases';
import type { string_completion_prompt } from '../types/typeAliases';
import type { string_data_url } from '../types/typeAliases';
import type { string_domain } from '../types/typeAliases';
import type { string_email } from '../types/typeAliases';
import type { string_file_absolute_path } from '../types/typeAliases';
import type { string_file_extension } from '../types/typeAliases';
import type { string_file_path } from '../types/typeAliases';
import type { string_file_relative_path } from '../types/typeAliases';
import type { string_filename } from '../types/typeAliases';
import type { string_folder_absolute_path } from '../types/typeAliases';
import type { string_folder_path } from '../types/typeAliases';
import type { string_folder_relative_path } from '../types/typeAliases';
import type { string_host } from '../types/typeAliases';
import type { string_hostname } from '../types/typeAliases';
import type { string_href } from '../types/typeAliases';
import type { string_html } from '../types/typeAliases';
import type { string_javascript } from '../types/typeAliases';
import type { string_javascript_name } from '../types/typeAliases';
import type { string_license } from '../types/typeAliases';
import type { string_markdown } from '../types/typeAliases';
import type { string_markdown_text } from '../types/typeAliases';
import type { string_mime_type } from '../types/typeAliases';
import type { string_mime_type_with_wildcard } from '../types/typeAliases';
import type { string_model_name } from '../types/typeAliases';
import type { string_name } from '../types/typeAliases';
import type { string_person_fullname } from '../types/typeAliases';
import type { string_prompt } from '../types/typeAliases';
import type { string_promptbook_url } from '../types/typeAliases';
import type { string_promptbook_url_with_hashtemplate } from '../types/typeAliases';
import type { string_script } from '../types/typeAliases';
import type { string_sha256 } from '../types/typeAliases';
import type { string_tdl } from '../types/typeAliases';
import type { string_template } from '../types/typeAliases';
import type { string_text_prompt } from '../types/typeAliases';
import type { string_title } from '../types/typeAliases';
import type { string_token } from '../types/typeAliases';
import type { string_translate_language } from '../types/typeAliases';
import type { string_uri } from '../types/typeAliases';
import type { string_uri_part } from '../types/typeAliases';
import type { string_url } from '../types/typeAliases';
import type { string_url_image } from '../types/typeAliases';
import type { string_version } from '../types/typeAliases';
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';
import type { FromtoItems } from '../utils/FromtoItems';

@@ -89,5 +30,5 @@ import { PROMPTBOOK_VERSION } from '../version';

export { EXPECTATION_UNITS };
export type { AvailableModel, client_id, CommonExecutionToolsOptions, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, Expectations, ExpectationUnit, FromtoItems, LlmExecutionTools, LlmTemplateJson, ModelRequirements, ModelVariant, Parameters, Prompt, 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, };
export type { AvailableModel, client_id, CommonExecutionToolsOptions, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, Expectations, ExpectationUnit, FromtoItems, KnowledgeJson, LlmExecutionTools, LlmTemplateJson, MaterialKnowledgePieceJson, ModelRequirements, ModelVariant, Parameters, Prompt, 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, };
/**
* TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
*/

@@ -6,3 +6,3 @@ import type { PromptbookString } from '../../types/PromptbookString';

*/
export declare function prettifyPromptbookString(promptbookString: PromptbookString, options: PrettifyOptions): PromptbookString;
export declare function prettifyPromptbookString(promptbookString: PromptbookString, options: PrettifyOptions): Promise<PromptbookString>;
/**

@@ -9,0 +9,0 @@ * TODO: Maybe use some Mermaid library instead of string templating

@@ -0,11 +1,16 @@

import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
import type { PromptbookString } from '../types/PromptbookString';
/**
* Parse promptbook from string format to JSON format
* Compile promptbook from string (markdown) format to JSON format
*
* @param promptbookString {Promptbook} in string markdown format (.ptbk.md)
* @param llmTools {LlmExecutionTools} - tools for processing required for knowledge processing *(not for actual execution)*
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
* @throws {PromptbookSyntaxError} if the promptbook string is not valid
*
* Note: This function does not validate logic of the pipeline only the syntax
* Note: This function acts as compilation process
*/
export declare function promptbookStringToJson(promptbookString: PromptbookString): PromptbookJson;
export declare function promptbookStringToJson(promptbookString: PromptbookString, llmTools?: LlmExecutionTools): Promise<PromptbookJson>;
/**

@@ -12,0 +17,0 @@ * TODO: Report here line/column of error

import type { AutomaticTranslator } from './AutomaticTranslator';
import type { TranslatorOptions } from './TranslatorOptions';
interface LindatAutomaticTranslatorOptions extends TranslatorOptions {
apiUrl: URL;
apiUrl?: URL;
}

@@ -6,0 +6,0 @@ export declare class LindatAutomaticTranslator implements AutomaticTranslator {

export type TranslatorOptions = {
from: string;
from?: string;
to: string;
};

@@ -16,2 +16,6 @@ import type { string_mime_type } from '../../types/typeAliases';

/**
* Aliases for the name
*/
readonly aliases?: Array<string_name>;
/**
* The mime type of the format (if any)

@@ -49,7 +53,19 @@ *

heal(value: string, scheme?: TSchema): TValue;
/**
* Parses just the values and removes structural information
*
* Note: This is useful when you want to combine format expectations with counting words, characters,...
*
* @param value The value to check, for example "{\"name\": "John Smith"}"
* @param schema Optional schema
* @example "{\"name\": "John Smith"}" -> ["John Smith"]
*/
extractValues(value: string, schema?: TSchema): Array<string>;
};
/**
* TODO: [👨‍⚖️] Compute TPartialValue dynamically - PartialString<TValue>
* TODO: [🧠] Should execution tools be aviable to heal, canBeValid and isValid?
* TODO: [🧠] llm Provider Bindings
*/
* TODO: [🍓]`name` and `aliases` should be UPPERCASE only and interpreted as case-insensitive (via normalization)
* TODO: [🍓][👨‍⚖️] Compute TPartialValue dynamically - PartialString<TValue>
* TODO: [🍓][🧠] Should execution tools be aviable to heal, canBeValid and isValid?
* TODO: [🍓][🧠] llm Provider Bindings
* TODO: [🍓]Export via some package
*/

@@ -11,2 +11,6 @@ import type { FormatDefinition } from '../_common/FormatDefinition';

* TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
*/
* TODO: [🍓] In `JsonFormatDefinition` implement simple `isValid`
* TODO: [🍓] In `JsonFormatDefinition` implement partial `canBeValid`
* TODO: [🍓] In `JsonFormatDefinition` implement `heal
* TODO: [🍓] In `JsonFormatDefinition` implement `extractValues`
*/

@@ -11,2 +11,6 @@ import type { FormatDefinition } from '../_common/FormatDefinition';

* TODO: [🧠] What to use for validating XMLs - XSD,...
* TODO: [🍓] In `XmlFormatDefinition` implement simple `isValid`
* TODO: [🍓] In `XmlFormatDefinition` implement partial `canBeValid`
* TODO: [🍓] In `XmlFormatDefinition` implement `heal
* TODO: [🍓] In `XmlFormatDefinition` implement `extractValues`
*/

@@ -21,3 +21,3 @@ import type { AvailableModel } from '../../execution/LlmExecutionTools';

*/
constructor(options: AnthropicClaudeExecutionToolsOptions);
constructor(options?: AnthropicClaudeExecutionToolsOptions);
/**

@@ -24,0 +24,0 @@ * Calls Anthropic Claude API to use a chat model.

@@ -12,3 +12,3 @@ import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';

private readonly options;
constructor(options: CommonExecutionToolsOptions);
constructor(options?: CommonExecutionToolsOptions);
/**

@@ -15,0 +15,0 @@ * Mocks chat model

@@ -12,3 +12,3 @@ import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';

private readonly options;
constructor(options: CommonExecutionToolsOptions);
constructor(options?: CommonExecutionToolsOptions);
/**

@@ -15,0 +15,0 @@ * Fakes chat model

@@ -21,3 +21,3 @@ import type { AvailableModel } from '../../execution/LlmExecutionTools';

*/
constructor(options: OpenAiExecutionToolsOptions);
constructor(options?: OpenAiExecutionToolsOptions);
/**

@@ -24,0 +24,0 @@ * Calls OpenAI API to use a chat model.

import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecutionToolsOptions';
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
import type { PromptbookLibrary } from '../../../library/PromptbookLibrary';
import type { PromptbookLibrary } from '../../../promptbook-library/PromptbookLibrary';
import type { client_id } from '../../../types/typeAliases';

@@ -5,0 +5,0 @@ import type { string_uri } from '../../../types/typeAliases';

@@ -11,3 +11,3 @@ import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';

private readonly options;
constructor(options: CommonExecutionToolsOptions);
constructor(options?: CommonExecutionToolsOptions);
/**

@@ -14,0 +14,0 @@ * Executes a Python

@@ -11,3 +11,3 @@ import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';

private readonly options;
constructor(options: CommonExecutionToolsOptions);
constructor(options?: CommonExecutionToolsOptions);
/**

@@ -14,0 +14,0 @@ * Executes a TypeScript

import type { string_markdown_text } from '../typeAliases';
import type { string_promptbook_url } from '../typeAliases';
import type { string_version } from '../typeAliases';
import type { KnowledgeJson } from './KnowledgeJson';
import type { PromptTemplateJson } from './PromptTemplateJson';

@@ -45,10 +46,11 @@ import type { PromptTemplateParameterJson } from './PromptTemplateParameterJson';

readonly promptTemplates: Array<PromptTemplateJson>;
/**
* Set of information that are used as external knowledge in the pipeline
*/
readonly knowledge: KnowledgeJson;
};
/**
* TODO: [🧠] Best format of this code?
* There must be possible to make
* - Branching
* - Loops
* - Paralelization
* - ...and more
* Note: There was a proposal for multiple types of promptbook objects 78816ff33e2705ee1a187aa2eb8affd976d4ea1a
* But then immediately reverted back to the single type
* With knowledge as part of the promptbook and library just as a collection of promptbooks
*/
{
"name": "@promptbook/node",
"version": "0.58.0",
"version": "0.59.0-0",
"description": "Library to supercharge your use of large language models",

@@ -38,3 +38,3 @@ "private": false,

"prettier": "2.8.1",
"spacetrim": "0.11.36"
"spacetrim": "0.11.37"
},

@@ -52,3 +52,3 @@ "funding": [

"peerDependencies": {
"@promptbook/core": "0.58.0"
"@promptbook/core": "0.59.0-0"
},

@@ -55,0 +55,0 @@ "main": "./umd/index.umd.js",

@@ -16,15 +16,14 @@ import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptbookString';

import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
import { CallbackInterfaceTools } from '../knowledgebase/dialogs/callback/CallbackInterfaceTools';
import type { CallbackInterfaceToolsOptions } from '../knowledgebase/dialogs/callback/CallbackInterfaceToolsOptions';
import { SimplePromptInterfaceTools } from '../knowledgebase/dialogs/simple-prompt/SimplePromptInterfaceTools';
import { addUsage } from '../execution/utils/addUsage';
import { checkExpectations } from '../execution/utils/checkExpectations';
import { isPassingExpectations } from '../execution/utils/checkExpectations';
import { checkExpectations, isPassingExpectations } from '../execution/utils/checkExpectations';
import { usageToWorktime } from '../execution/utils/usageToWorktime';
import { createPromptbookLibraryFromPromise } from '../library/constructors/createPromptbookLibraryFromPromise';
import { createPromptbookLibraryFromSources } from '../library/constructors/createPromptbookLibraryFromSources';
import { createPromptbookLibraryFromUrl } from '../library/constructors/createPromptbookLibraryFromUrl';
import { createPromptbookSublibrary } from '../library/constructors/createPromptbookSublibrary';
import { SimplePromptbookLibrary } from '../library/SimplePromptbookLibrary';
import { CallbackInterfaceTools } from '../knowledge/dialogs/callback/CallbackInterfaceTools';
import type { CallbackInterfaceToolsOptions } from '../knowledge/dialogs/callback/CallbackInterfaceToolsOptions';
import { SimplePromptInterfaceTools } from '../knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools';
import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools';
import { createPromptbookLibraryFromPromise } from '../promptbook-library/constructors/createPromptbookLibraryFromPromise';
import { createPromptbookLibraryFromSources } from '../promptbook-library/constructors/createPromptbookLibraryFromSources';
import { createPromptbookLibraryFromUrl } from '../promptbook-library/constructors/createPromptbookLibraryFromUrl';
import { createPromptbookSublibrary } from '../promptbook-library/constructors/createPromptbookSublibrary';
import { SimplePromptbookLibrary } from '../promptbook-library/SimplePromptbookLibrary';
import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';

@@ -31,0 +30,0 @@ import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';

@@ -1,4 +0,4 @@

import { createPromptbookLibraryFromDirectory } from '../library/constructors/createPromptbookLibraryFromDirectory';
import { createPromptbookLibraryFromDirectory } from '../promptbook-library/constructors/createPromptbookLibraryFromDirectory';
import { PROMPTBOOK_VERSION } from '../version';
export { PROMPTBOOK_VERSION };
export { createPromptbookLibraryFromDirectory };
import type { CommonExecutionToolsOptions } from '../execution/CommonExecutionToolsOptions';
import type { ExecutionTools } from '../execution/ExecutionTools';
import type { AvailableModel } from '../execution/LlmExecutionTools';
import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
import type { PromptChatResult } from '../execution/PromptResult';
import type { PromptCommonResult } from '../execution/PromptResult';
import type { PromptCompletionResult } from '../execution/PromptResult';
import type { PromptResult } from '../execution/PromptResult';
import type { PromptResultUsage } from '../execution/PromptResult';
import type { PromptResultUsageCounts } from '../execution/PromptResult';
import type { UncertainNumber } from '../execution/PromptResult';
import type { AvailableModel, LlmExecutionTools } from '../execution/LlmExecutionTools';
import type { PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, UncertainNumber } from '../execution/PromptResult';
import type { PromptbookExecutor } from '../execution/PromptbookExecutor';
import type { ScriptExecutionTools } from '../execution/ScriptExecutionTools';
import type { ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';
import type { UserInterfaceTools } from '../execution/UserInterfaceTools';
import type { UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
import type { PromptbookLibrary } from '../library/PromptbookLibrary';
import type { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';
import type { UserInterfaceTools, UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
import type { PromptbookLibrary } from '../promptbook-library/PromptbookLibrary';
import type { ExecutionType } from '../types/ExecutionTypes';
import type { ModelRequirements } from '../types/ModelRequirements';
import type { ModelVariant } from '../types/ModelRequirements';
import type { ModelRequirements, ModelVariant } from '../types/ModelRequirements';
import type { Parameters } from '../types/Parameters';
import type { Prompt } from '../types/Prompt';
import type { ExpectationAmount } from '../types/PromptbookJson/PromptTemplateJson';
import type { Expectations } from '../types/PromptbookJson/PromptTemplateJson';
import type { ExpectationUnit } from '../types/PromptbookJson/PromptTemplateJson';
import type { LlmTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
import type { PromptDialogJson } from '../types/PromptbookJson/PromptTemplateJson';
import type { PromptTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
import type { ScriptJson } from '../types/PromptbookJson/PromptTemplateJson';
import type { SimpleTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
import { KnowledgeJson } from '../types/PromptbookJson/KnowledgeJson';
import { MaterialKnowledgePieceJson } from '../types/PromptbookJson/MaterialKnowledgePieceJson';
import type { ExpectationAmount, Expectations, ExpectationUnit, LlmTemplateJson, PromptDialogJson, PromptTemplateJson, ScriptJson, SimpleTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
import { EXPECTATION_UNITS } from '../types/PromptbookJson/PromptTemplateJson';

@@ -39,47 +24,3 @@ import type { PromptTemplateParameterJson } from '../types/PromptbookJson/PromptTemplateParameterJson';

import type { string_char_emoji } from '../types/typeAliasEmoji';
import type { client_id } from '../types/typeAliases';
import type { string_char } from '../types/typeAliases';
import type { string_chat_prompt } from '../types/typeAliases';
import type { string_completion_prompt } from '../types/typeAliases';
import type { string_data_url } from '../types/typeAliases';
import type { string_domain } from '../types/typeAliases';
import type { string_email } from '../types/typeAliases';
import type { string_file_absolute_path } from '../types/typeAliases';
import type { string_file_extension } from '../types/typeAliases';
import type { string_file_path } from '../types/typeAliases';
import type { string_file_relative_path } from '../types/typeAliases';
import type { string_filename } from '../types/typeAliases';
import type { string_folder_absolute_path } from '../types/typeAliases';
import type { string_folder_path } from '../types/typeAliases';
import type { string_folder_relative_path } from '../types/typeAliases';
import type { string_host } from '../types/typeAliases';
import type { string_hostname } from '../types/typeAliases';
import type { string_href } from '../types/typeAliases';
import type { string_html } from '../types/typeAliases';
import type { string_javascript } from '../types/typeAliases';
import type { string_javascript_name } from '../types/typeAliases';
import type { string_license } from '../types/typeAliases';
import type { string_markdown } from '../types/typeAliases';
import type { string_markdown_text } from '../types/typeAliases';
import type { string_mime_type } from '../types/typeAliases';
import type { string_mime_type_with_wildcard } from '../types/typeAliases';
import type { string_model_name } from '../types/typeAliases';
import type { string_name } from '../types/typeAliases';
import type { string_person_fullname } from '../types/typeAliases';
import type { string_prompt } from '../types/typeAliases';
import type { string_promptbook_url } from '../types/typeAliases';
import type { string_promptbook_url_with_hashtemplate } from '../types/typeAliases';
import type { string_script } from '../types/typeAliases';
import type { string_sha256 } from '../types/typeAliases';
import type { string_tdl } from '../types/typeAliases';
import type { string_template } from '../types/typeAliases';
import type { string_text_prompt } from '../types/typeAliases';
import type { string_title } from '../types/typeAliases';
import type { string_token } from '../types/typeAliases';
import type { string_translate_language } from '../types/typeAliases';
import type { string_uri } from '../types/typeAliases';
import type { string_uri_part } from '../types/typeAliases';
import type { string_url } from '../types/typeAliases';
import type { string_url_image } from '../types/typeAliases';
import type { string_version } from '../types/typeAliases';
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';
import type { FromtoItems } from '../utils/FromtoItems';

@@ -89,5 +30,5 @@ import { PROMPTBOOK_VERSION } from '../version';

export { EXPECTATION_UNITS };
export type { AvailableModel, client_id, CommonExecutionToolsOptions, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, Expectations, ExpectationUnit, FromtoItems, LlmExecutionTools, LlmTemplateJson, ModelRequirements, ModelVariant, Parameters, Prompt, 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, };
export type { AvailableModel, client_id, CommonExecutionToolsOptions, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, Expectations, ExpectationUnit, FromtoItems, KnowledgeJson, LlmExecutionTools, LlmTemplateJson, MaterialKnowledgePieceJson, ModelRequirements, ModelVariant, Parameters, Prompt, 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, };
/**
* TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
*/

@@ -6,3 +6,3 @@ import type { PromptbookString } from '../../types/PromptbookString';

*/
export declare function prettifyPromptbookString(promptbookString: PromptbookString, options: PrettifyOptions): PromptbookString;
export declare function prettifyPromptbookString(promptbookString: PromptbookString, options: PrettifyOptions): Promise<PromptbookString>;
/**

@@ -9,0 +9,0 @@ * TODO: Maybe use some Mermaid library instead of string templating

@@ -0,11 +1,16 @@

import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
import type { PromptbookString } from '../types/PromptbookString';
/**
* Parse promptbook from string format to JSON format
* Compile promptbook from string (markdown) format to JSON format
*
* @param promptbookString {Promptbook} in string markdown format (.ptbk.md)
* @param llmTools {LlmExecutionTools} - tools for processing required for knowledge processing *(not for actual execution)*
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
* @throws {PromptbookSyntaxError} if the promptbook string is not valid
*
* Note: This function does not validate logic of the pipeline only the syntax
* Note: This function acts as compilation process
*/
export declare function promptbookStringToJson(promptbookString: PromptbookString): PromptbookJson;
export declare function promptbookStringToJson(promptbookString: PromptbookString, llmTools?: LlmExecutionTools): Promise<PromptbookJson>;
/**

@@ -12,0 +17,0 @@ * TODO: Report here line/column of error

import type { AutomaticTranslator } from './AutomaticTranslator';
import type { TranslatorOptions } from './TranslatorOptions';
interface LindatAutomaticTranslatorOptions extends TranslatorOptions {
apiUrl: URL;
apiUrl?: URL;
}

@@ -6,0 +6,0 @@ export declare class LindatAutomaticTranslator implements AutomaticTranslator {

export type TranslatorOptions = {
from: string;
from?: string;
to: string;
};

@@ -16,2 +16,6 @@ import type { string_mime_type } from '../../types/typeAliases';

/**
* Aliases for the name
*/
readonly aliases?: Array<string_name>;
/**
* The mime type of the format (if any)

@@ -49,7 +53,19 @@ *

heal(value: string, scheme?: TSchema): TValue;
/**
* Parses just the values and removes structural information
*
* Note: This is useful when you want to combine format expectations with counting words, characters,...
*
* @param value The value to check, for example "{\"name\": "John Smith"}"
* @param schema Optional schema
* @example "{\"name\": "John Smith"}" -> ["John Smith"]
*/
extractValues(value: string, schema?: TSchema): Array<string>;
};
/**
* TODO: [👨‍⚖️] Compute TPartialValue dynamically - PartialString<TValue>
* TODO: [🧠] Should execution tools be aviable to heal, canBeValid and isValid?
* TODO: [🧠] llm Provider Bindings
*/
* TODO: [🍓]`name` and `aliases` should be UPPERCASE only and interpreted as case-insensitive (via normalization)
* TODO: [🍓][👨‍⚖️] Compute TPartialValue dynamically - PartialString<TValue>
* TODO: [🍓][🧠] Should execution tools be aviable to heal, canBeValid and isValid?
* TODO: [🍓][🧠] llm Provider Bindings
* TODO: [🍓]Export via some package
*/

@@ -11,2 +11,6 @@ import type { FormatDefinition } from '../_common/FormatDefinition';

* TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
*/
* TODO: [🍓] In `JsonFormatDefinition` implement simple `isValid`
* TODO: [🍓] In `JsonFormatDefinition` implement partial `canBeValid`
* TODO: [🍓] In `JsonFormatDefinition` implement `heal
* TODO: [🍓] In `JsonFormatDefinition` implement `extractValues`
*/

@@ -11,2 +11,6 @@ import type { FormatDefinition } from '../_common/FormatDefinition';

* TODO: [🧠] What to use for validating XMLs - XSD,...
* TODO: [🍓] In `XmlFormatDefinition` implement simple `isValid`
* TODO: [🍓] In `XmlFormatDefinition` implement partial `canBeValid`
* TODO: [🍓] In `XmlFormatDefinition` implement `heal
* TODO: [🍓] In `XmlFormatDefinition` implement `extractValues`
*/

@@ -21,3 +21,3 @@ import type { AvailableModel } from '../../execution/LlmExecutionTools';

*/
constructor(options: AnthropicClaudeExecutionToolsOptions);
constructor(options?: AnthropicClaudeExecutionToolsOptions);
/**

@@ -24,0 +24,0 @@ * Calls Anthropic Claude API to use a chat model.

@@ -12,3 +12,3 @@ import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';

private readonly options;
constructor(options: CommonExecutionToolsOptions);
constructor(options?: CommonExecutionToolsOptions);
/**

@@ -15,0 +15,0 @@ * Mocks chat model

@@ -12,3 +12,3 @@ import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';

private readonly options;
constructor(options: CommonExecutionToolsOptions);
constructor(options?: CommonExecutionToolsOptions);
/**

@@ -15,0 +15,0 @@ * Fakes chat model

@@ -21,3 +21,3 @@ import type { AvailableModel } from '../../execution/LlmExecutionTools';

*/
constructor(options: OpenAiExecutionToolsOptions);
constructor(options?: OpenAiExecutionToolsOptions);
/**

@@ -24,0 +24,0 @@ * Calls OpenAI API to use a chat model.

import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecutionToolsOptions';
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
import type { PromptbookLibrary } from '../../../library/PromptbookLibrary';
import type { PromptbookLibrary } from '../../../promptbook-library/PromptbookLibrary';
import type { client_id } from '../../../types/typeAliases';

@@ -5,0 +5,0 @@ import type { string_uri } from '../../../types/typeAliases';

@@ -11,3 +11,3 @@ import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';

private readonly options;
constructor(options: CommonExecutionToolsOptions);
constructor(options?: CommonExecutionToolsOptions);
/**

@@ -14,0 +14,0 @@ * Executes a Python

@@ -11,3 +11,3 @@ import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';

private readonly options;
constructor(options: CommonExecutionToolsOptions);
constructor(options?: CommonExecutionToolsOptions);
/**

@@ -14,0 +14,0 @@ * Executes a TypeScript

import type { string_markdown_text } from '../typeAliases';
import type { string_promptbook_url } from '../typeAliases';
import type { string_version } from '../typeAliases';
import type { KnowledgeJson } from './KnowledgeJson';
import type { PromptTemplateJson } from './PromptTemplateJson';

@@ -45,10 +46,11 @@ import type { PromptTemplateParameterJson } from './PromptTemplateParameterJson';

readonly promptTemplates: Array<PromptTemplateJson>;
/**
* Set of information that are used as external knowledge in the pipeline
*/
readonly knowledge: KnowledgeJson;
};
/**
* TODO: [🧠] Best format of this code?
* There must be possible to make
* - Branching
* - Loops
* - Paralelization
* - ...and more
* Note: There was a proposal for multiple types of promptbook objects 78816ff33e2705ee1a187aa2eb8affd976d4ea1a
* But then immediately reverted back to the single type
* With knowledge as part of the promptbook and library just as a collection of promptbooks
*/

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc