@promptbook/core 0.66.0-4 → 0.66.0-6

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.
Files changed (22) hide show
  1. package/esm/index.es.js +59 -17
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/cli.index.d.ts +4 -0
  4. package/esm/typings/src/_packages/core.index.d.ts +6 -6
  5. package/esm/typings/src/_packages/types.index.d.ts +4 -0
  6. package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
  7. package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -1
  8. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +1 -1
  9. package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts +1 -1
  10. package/esm/typings/src/llm-providers/_common/{$llmToolsConfigurationBoilerplatesRegister.d.ts → $llmToolsMetadataRegister.d.ts} +2 -4
  11. package/esm/typings/src/llm-providers/_common/LlmToolsConfiguration.d.ts +5 -3
  12. package/esm/typings/src/llm-providers/_common/LlmToolsMetadata.d.ts +27 -0
  13. package/esm/typings/src/llm-providers/_common/LlmToolsOptions.d.ts +7 -0
  14. package/esm/typings/src/llm-providers/_common/config.d.ts +1 -1
  15. package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +2 -1
  16. package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +1 -1
  17. package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -1
  18. package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +1 -1
  19. package/esm/typings/src/personas/preparePersona.test.d.ts +1 -1
  20. package/package.json +1 -1
  21. package/umd/index.umd.js +61 -19
  22. package/umd/index.umd.js.map +1 -1
@@ -1,4 +1,8 @@
1
1
  import { PROMPTBOOK_VERSION } from '../version';
2
2
  import { __CLI } from '../cli/main';
3
+ import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
4
+ import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
3
5
  export { PROMPTBOOK_VERSION };
4
6
  export { __CLI };
7
+ export { _AnthropicClaudeMetadataRegistration };
8
+ export { _OpenAiMetadataRegistration };
@@ -47,15 +47,15 @@ import { CallbackInterfaceTools } from '../knowledge/dialogs/callback/CallbackIn
47
47
  import type { CallbackInterfaceToolsOptions } from '../knowledge/dialogs/callback/CallbackInterfaceToolsOptions';
48
48
  import { prepareKnowledgePieces } from '../knowledge/prepare-knowledge/_common/prepareKnowledgePieces';
49
49
  import { prepareKnowledgeFromMarkdown } from '../knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown';
50
- import { $llmToolsConfigurationBoilerplatesRegister } from '../llm-providers/_common/$llmToolsConfigurationBoilerplatesRegister';
50
+ import { $llmToolsMetadataRegister } from '../llm-providers/_common/$llmToolsMetadataRegister';
51
51
  import { $llmToolsRegister } from '../llm-providers/_common/$llmToolsRegister';
52
52
  import { createLlmToolsFromConfiguration } from '../llm-providers/_common/createLlmToolsFromConfiguration';
53
53
  import { cacheLlmTools } from '../llm-providers/_common/utils/cache/cacheLlmTools';
54
54
  import { countTotalUsage } from '../llm-providers/_common/utils/count-total-usage/countTotalUsage';
55
55
  import { limitTotalUsage } from '../llm-providers/_common/utils/count-total-usage/limitTotalUsage';
56
- import { _AnthropicClaudeConfigurationRegistration } from '../llm-providers/anthropic-claude/register-configuration';
56
+ import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
57
57
  import { joinLlmExecutionTools } from '../llm-providers/multiple/joinLlmExecutionTools';
58
- import { _OpenAiConfigurationRegistration } from '../llm-providers/openai/register-configuration';
58
+ import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
59
59
  import { preparePersona } from '../personas/preparePersona';
60
60
  import { isPipelinePrepared } from '../prepare/isPipelinePrepared';
61
61
  import { preparePipeline } from '../prepare/preparePipeline';
@@ -117,15 +117,15 @@ export { CallbackInterfaceTools };
117
117
  export type { CallbackInterfaceToolsOptions };
118
118
  export { prepareKnowledgePieces };
119
119
  export { prepareKnowledgeFromMarkdown };
120
- export { $llmToolsConfigurationBoilerplatesRegister };
120
+ export { $llmToolsMetadataRegister };
121
121
  export { $llmToolsRegister };
122
122
  export { createLlmToolsFromConfiguration };
123
123
  export { cacheLlmTools };
124
124
  export { countTotalUsage };
125
125
  export { limitTotalUsage };
126
- export { _AnthropicClaudeConfigurationRegistration };
126
+ export { _AnthropicClaudeMetadataRegistration };
127
127
  export { joinLlmExecutionTools };
128
- export { _OpenAiConfigurationRegistration };
128
+ export { _OpenAiMetadataRegistration };
129
129
  export { preparePersona };
130
130
  export { isPipelinePrepared };
131
131
  export { preparePipeline };
@@ -32,6 +32,8 @@ import type { UserInterfaceTools } from '../execution/UserInterfaceTools';
32
32
  import type { UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
33
33
  import type { CallbackInterfaceToolsOptions } from '../knowledge/dialogs/callback/CallbackInterfaceToolsOptions';
34
34
  import type { LlmToolsConfiguration } from '../llm-providers/_common/LlmToolsConfiguration';
35
+ import type { LlmToolsMetadata } from '../llm-providers/_common/LlmToolsMetadata';
36
+ import type { LlmToolsOptions } from '../llm-providers/_common/LlmToolsOptions';
35
37
  import type { CacheItem } from '../llm-providers/_common/utils/cache/CacheItem';
36
38
  import type { CacheLlmToolsOptions } from '../llm-providers/_common/utils/cache/CacheLlmToolsOptions';
37
39
  import type { LlmExecutionToolsWithTotalUsage } from '../llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage';
@@ -249,6 +251,8 @@ export type { UserInterfaceTools };
249
251
  export type { UserInterfaceToolsPromptDialogOptions };
250
252
  export type { CallbackInterfaceToolsOptions };
251
253
  export type { LlmToolsConfiguration };
254
+ export type { LlmToolsMetadata };
255
+ export type { LlmToolsOptions };
252
256
  export type { CacheItem };
253
257
  export type { CacheLlmToolsOptions };
254
258
  export type { LlmExecutionToolsWithTotalUsage };
@@ -6,7 +6,7 @@ import type { Command as Program } from 'commander';
6
6
  */
7
7
  export declare function initializeMakeCommand(program: Program): void;
8
8
  /**
9
- * TODO: [🥃] !!! Allow `ptbk make` without llm tools
9
+ * TODO: [🥃] !!! Allow `ptbk make` without configuring any llm tools
10
10
  * TODO: Maybe remove this command - "about" command should be enough?
11
11
  * TODO: [0] DRY Javascript and typescript - Maybe make ONLY typescript and for javascript just remove types
12
12
  * Note: [🟡] This code should never be published outside of `@promptbook/cli`
@@ -1 +1 @@
1
- export {};
1
+ import '../../../_packages/core.index';
@@ -1,4 +1,4 @@
1
- export {};
1
+ import '../../../_packages/core.index';
2
2
  /**
3
3
  * TODO: [📓] Maybe test all file in samples (not just 10-simple.md)
4
4
  */
@@ -1 +1 @@
1
- export {};
1
+ import '../../../_packages/core.index';
@@ -1,4 +1,5 @@
1
1
  import { Register } from '../../utils/Register';
2
+ import type { LlmToolsMetadata } from './LlmToolsMetadata';
2
3
  /**
3
4
  * @@@
4
5
  *
@@ -6,7 +7,4 @@ import { Register } from '../../utils/Register';
6
7
  * @singleton Only one instance of each register is created per build, but thare can be more @@@
7
8
  * @public exported from `@promptbook/core`
8
9
  */
9
- export declare const $llmToolsConfigurationBoilerplatesRegister: Register<import("../../utils/Register").Registered & {
10
- title: string;
11
- options: object;
12
- }>;
10
+ export declare const $llmToolsMetadataRegister: Register<LlmToolsMetadata>;
@@ -1,8 +1,10 @@
1
1
  import type { string_title } from '../../types/typeAliases';
2
- import type { TODO_object } from '../../utils/organization/TODO_object';
3
2
  import type { Registered } from '../../utils/Register';
3
+ import type { LlmToolsOptions } from './LlmToolsOptions';
4
4
  /**
5
5
  * @@@
6
+ *
7
+ * @@@ `LlmToolsMetadata` vs `LlmToolsConfiguration` vs `LlmToolsOptions` (vs `Registered`)
6
8
  */
7
9
  export type LlmToolsConfiguration = Array<Registered & {
8
10
  /**
@@ -12,9 +14,9 @@ export type LlmToolsConfiguration = Array<Registered & {
12
14
  /**
13
15
  * @@@
14
16
  */
15
- options: TODO_object;
17
+ options: LlmToolsOptions;
16
18
  }>;
17
19
  /**
18
20
  * TODO: [🧠][🌰] `title` is redundant BUT maybe allow each provider pass it's own title for tracking purposes
19
- * TODO: [🧠] Maybe add option for `constructorName` instead of `className`
21
+ * TODO: Maybe instead of `LlmToolsConfiguration[number]` make `LlmToolsConfigurationItem`
20
22
  */
@@ -0,0 +1,27 @@
1
+ import type { string_name } from '../../types/typeAliases';
2
+ import type { string_title } from '../../types/typeAliases';
3
+ import type { Registered } from '../../utils/Register';
4
+ import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
5
+ /**
6
+ * @@@
7
+ *
8
+ * @@@ `LlmToolsMetadata` vs `LlmToolsConfiguration` vs `LlmToolsOptions` (vs `Registered`)
9
+ */
10
+ export type LlmToolsMetadata = Registered & {
11
+ /**
12
+ * @@@
13
+ */
14
+ title: string_title;
15
+ /**
16
+ * @@@
17
+ */
18
+ getBoilerplateConfiguration(): LlmToolsConfiguration[number];
19
+ /**
20
+ * @@@
21
+ */
22
+ createConfigurationFromEnv(env: Record<string_name, string>): LlmToolsConfiguration[number] | null;
23
+ };
24
+ /**
25
+ * TODO: Add configuration schema and maybe some documentation link
26
+ * TODO: Maybe constrain LlmToolsConfiguration[number] by generic to ensure that `createConfigurationFromEnv` and `getBoilerplateConfiguration` always create same `packageName` and `className`
27
+ */
@@ -0,0 +1,7 @@
1
+ import type { TODO_object } from '../../utils/organization/TODO_object';
2
+ /**
3
+ * @@@
4
+ *
5
+ * @@@ `LlmToolsMetadata` vs `LlmToolsConfiguration` vs `LlmToolsOptions` (vs `Registered`)
6
+ */
7
+ export type LlmToolsOptions = TODO_object;
@@ -3,7 +3,7 @@ import type { TODO_any } from '../../utils/organization/TODO_any';
3
3
  /**
4
4
  * @@@
5
5
  *
6
- * TODO: !!!!!! Not centralized - register each provider to each package
6
+ * TODO: !!!!!! Remove EXECUTION_TOOLS_CLASSES and use $llmToolsRegister instead
7
7
  *
8
8
  * @private internal type for `createLlmToolsFromConfiguration`
9
9
  */
@@ -4,5 +4,6 @@
4
4
  * Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
5
5
  *
6
6
  * @public exported from `@promptbook/core`
7
+ * @public exported from `@promptbook/cli`
7
8
  */
8
- export declare const _AnthropicClaudeConfigurationRegistration: void;
9
+ export declare const _AnthropicClaudeMetadataRegistration: void;
@@ -8,4 +8,4 @@
8
8
  export declare const _AnthropicClaudeRegistration: void;
9
9
  /**
10
10
  * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
11
- */
11
+ */
@@ -4,5 +4,6 @@
4
4
  * Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
5
5
  *
6
6
  * @public exported from `@promptbook/core`
7
+ * @public exported from `@promptbook/cli`
7
8
  */
8
- export declare const _OpenAiConfigurationRegistration: void;
9
+ export declare const _OpenAiMetadataRegistration: void;
@@ -8,4 +8,4 @@
8
8
  export declare const _OpenAiRegistration: void;
9
9
  /**
10
10
  * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
11
- */
11
+ */
@@ -1 +1 @@
1
- export {};
1
+ import '../../src/_packages/core.index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/core",
3
- "version": "0.66.0-4",
3
+ "version": "0.66.0-6",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -19,7 +19,7 @@
19
19
  /**
20
20
  * The version of the Promptbook library
21
21
  */
22
- var PROMPTBOOK_VERSION = '0.66.0-3';
22
+ var PROMPTBOOK_VERSION = '0.66.0-5';
23
23
  // TODO: !!!! List here all the versions and annotate + put into script
24
24
 
25
25
  /*! *****************************************************************************
@@ -1650,7 +1650,7 @@
1650
1650
  });
1651
1651
  }
1652
1652
 
1653
- var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.66.0-3",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",dependentParameterNames:["knowledgeContent"],resultingParameterName:"knowledgePieces"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-from-markdown.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.ptbk.md",promptbookVersion:"0.66.0-3",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",dependentParameterNames:["knowledgePieceContent"],resultingParameterName:"keywords"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-keywords.ptbk.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.ptbk.md",promptbookVersion:"0.66.0-3",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Title should be concise and clear\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"],resultingParameterName:"title"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",promptbookVersion:"0.66.0-3",parameters:[{name:"availableModelNames",description:"List of available model names separated by comma (,)",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"make-model-requirements",title:"Make modelRequirements",modelRequirements:{modelVariant:"CHAT",modelName:"gpt-4-turbo"},content:"You are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Sample\n\n```json\n{\n\"modelName\": \"gpt-4o\",\n\"systemMessage\": \"You are experienced AI engineer and helpfull assistant.\",\n\"temperature\": 0.7\n}\n```\n\n## Instructions\n\n### Option `modelName`\n\nPick from the following models:\n\n- {availableModelNames}\n\n### Option `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Option `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",expectFormat:"JSON",dependentParameterNames:["availableModelNames","personaDescription"],resultingParameterName:"modelRequirements"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
1653
+ var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.66.0-5",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",dependentParameterNames:["knowledgeContent"],resultingParameterName:"knowledgePieces"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-from-markdown.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.ptbk.md",promptbookVersion:"0.66.0-5",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",dependentParameterNames:["knowledgePieceContent"],resultingParameterName:"keywords"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-keywords.ptbk.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.ptbk.md",promptbookVersion:"0.66.0-5",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Title should be concise and clear\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"],resultingParameterName:"title"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",promptbookVersion:"0.66.0-5",parameters:[{name:"availableModelNames",description:"List of available model names separated by comma (,)",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"make-model-requirements",title:"Make modelRequirements",modelRequirements:{modelVariant:"CHAT",modelName:"gpt-4-turbo"},content:"You are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Sample\n\n```json\n{\n\"modelName\": \"gpt-4o\",\n\"systemMessage\": \"You are experienced AI engineer and helpfull assistant.\",\n\"temperature\": 0.7\n}\n```\n\n## Instructions\n\n### Option `modelName`\n\nPick from the following models:\n\n- {availableModelNames}\n\n### Option `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Option `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",expectFormat:"JSON",dependentParameterNames:["availableModelNames","personaDescription"],resultingParameterName:"modelRequirements"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
1654
1654
 
1655
1655
  var defaultDiacriticsRemovalMap = [
1656
1656
  {
@@ -6530,7 +6530,7 @@
6530
6530
  * @singleton Only one instance of each register is created per build, but thare can be more @@@
6531
6531
  * @public exported from `@promptbook/core`
6532
6532
  */
6533
- var $llmToolsConfigurationBoilerplatesRegister = new Register([
6533
+ var $llmToolsMetadataRegister = new Register([
6534
6534
  // TODO: !!!!!! Take from global scope
6535
6535
  ]);
6536
6536
 
@@ -8083,7 +8083,7 @@
8083
8083
  /**
8084
8084
  * @@@
8085
8085
  *
8086
- * TODO: !!!!!! Not centralized - register each provider to each package
8086
+ * TODO: !!!!!! Remove EXECUTION_TOOLS_CLASSES and use $llmToolsRegister instead
8087
8087
  *
8088
8088
  * @private internal type for `createLlmToolsFromConfiguration`
8089
8089
  */
@@ -8366,16 +8366,37 @@
8366
8366
  * Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
8367
8367
  *
8368
8368
  * @public exported from `@promptbook/core`
8369
+ * @public exported from `@promptbook/cli`
8369
8370
  */
8370
- var _AnthropicClaudeConfigurationRegistration = $llmToolsConfigurationBoilerplatesRegister.register({
8371
+ var _AnthropicClaudeMetadataRegistration = $llmToolsMetadataRegister.register({
8371
8372
  title: 'Anthropic Claude',
8372
8373
  packageName: '@promptbook/anthropic-claude',
8373
8374
  className: 'AnthropicClaudeExecutionTools',
8374
- options: {
8375
- apiKey: 'sk-ant-api03-',
8376
- isProxied: true,
8377
- remoteUrl: DEFAULT_REMOTE_URL,
8378
- path: DEFAULT_REMOTE_URL_PATH,
8375
+ getBoilerplateConfiguration: function () {
8376
+ return {
8377
+ title: 'Anthropic Claude (boilerplate)',
8378
+ packageName: '@promptbook/anthropic-claude',
8379
+ className: 'AnthropicClaudeExecutionTools',
8380
+ options: {
8381
+ apiKey: 'sk-ant-api03-',
8382
+ isProxied: true,
8383
+ remoteUrl: DEFAULT_REMOTE_URL,
8384
+ path: DEFAULT_REMOTE_URL_PATH,
8385
+ },
8386
+ };
8387
+ },
8388
+ createConfigurationFromEnv: function (env) {
8389
+ if (typeof env.ANTHROPIC_CLAUDE_API_KEY === 'string') {
8390
+ return {
8391
+ title: 'Claude (from env)',
8392
+ packageName: '@promptbook/antrhopic-claude',
8393
+ className: 'AnthropicClaudeExecutionTools',
8394
+ options: {
8395
+ apiKey: process.env.ANTHROPIC_CLAUDE_API_KEY,
8396
+ },
8397
+ };
8398
+ }
8399
+ return null;
8379
8400
  },
8380
8401
  });
8381
8402
 
@@ -8385,13 +8406,34 @@
8385
8406
  * Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
8386
8407
  *
8387
8408
  * @public exported from `@promptbook/core`
8409
+ * @public exported from `@promptbook/cli`
8388
8410
  */
8389
- var _OpenAiConfigurationRegistration = $llmToolsConfigurationBoilerplatesRegister.register({
8390
- title: 'Open AI',
8391
- packageName: '@promptbook/openai',
8392
- className: 'OpenAiExecutionTools',
8393
- options: {
8394
- apiKey: 'sk-',
8411
+ var _OpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
8412
+ title: 'Anthropic Claude',
8413
+ packageName: '@promptbook/anthropic-claude',
8414
+ className: 'AnthropicClaudeExecutionTools',
8415
+ getBoilerplateConfiguration: function () {
8416
+ return {
8417
+ title: 'Open AI (boilerplate)',
8418
+ packageName: '@promptbook/openai',
8419
+ className: 'OpenAiExecutionTools',
8420
+ options: {
8421
+ apiKey: 'sk-',
8422
+ },
8423
+ };
8424
+ },
8425
+ createConfigurationFromEnv: function (env) {
8426
+ if (typeof env.OPENAI_API_KEY === 'string') {
8427
+ return {
8428
+ title: 'Open AI (from env)',
8429
+ packageName: '@promptbook/openai',
8430
+ className: 'OpenAiExecutionTools',
8431
+ options: {
8432
+ apiKey: process.env.OPENAI_API_KEY,
8433
+ },
8434
+ };
8435
+ }
8436
+ return null;
8395
8437
  },
8396
8438
  });
8397
8439
 
@@ -8745,7 +8787,7 @@
8745
8787
  * TODO: [🧠] Should be in generated file GENERATOR_WARNING
8746
8788
  */
8747
8789
 
8748
- exports.$llmToolsConfigurationBoilerplatesRegister = $llmToolsConfigurationBoilerplatesRegister;
8790
+ exports.$llmToolsMetadataRegister = $llmToolsMetadataRegister;
8749
8791
  exports.$llmToolsRegister = $llmToolsRegister;
8750
8792
  exports.BlockTypes = BlockTypes;
8751
8793
  exports.CLAIM = CLAIM;
@@ -8778,8 +8820,8 @@
8778
8820
  exports.UnexpectedError = UnexpectedError;
8779
8821
  exports.VersionMismatchError = VersionMismatchError;
8780
8822
  exports.ZERO_USAGE = ZERO_USAGE;
8781
- exports._AnthropicClaudeConfigurationRegistration = _AnthropicClaudeConfigurationRegistration;
8782
- exports._OpenAiConfigurationRegistration = _OpenAiConfigurationRegistration;
8823
+ exports._AnthropicClaudeMetadataRegistration = _AnthropicClaudeMetadataRegistration;
8824
+ exports._OpenAiMetadataRegistration = _OpenAiMetadataRegistration;
8783
8825
  exports.addUsage = addUsage;
8784
8826
  exports.assertsExecutionSuccessful = assertsExecutionSuccessful;
8785
8827
  exports.cacheLlmTools = cacheLlmTools;