@promptbook/cli 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 +132 -28
  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 +133 -27
  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/cli",
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
@@ -39,7 +39,7 @@
39
39
  /**
40
40
  * The version of the Promptbook library
41
41
  */
42
- var PROMPTBOOK_VERSION = '0.66.0-3';
42
+ var PROMPTBOOK_VERSION = '0.66.0-5';
43
43
  // TODO: !!!! List here all the versions and annotate + put into script
44
44
 
45
45
  /*! *****************************************************************************
@@ -322,6 +322,18 @@
322
322
  * @private within the repository
323
323
  */
324
324
  var RESERVED_PARAMETER_RESTRICTED = 'RESTRICTED-' + REPLACING_NONCE;
325
+ /**
326
+ * @@@
327
+ *
328
+ * @public exported from `@promptbook/core`
329
+ */
330
+ var DEFAULT_REMOTE_URL = 'https://api.pavolhejny.com/';
331
+ /**
332
+ * @@@
333
+ *
334
+ * @public exported from `@promptbook/core`
335
+ */
336
+ var DEFAULT_REMOTE_URL_PATH = '/promptbook/socket.io';
325
337
  /**
326
338
  * TODO: [🧠][🧜‍♂️] Maybe join remoteUrl and path into single value
327
339
  */
@@ -854,7 +866,7 @@
854
866
  });
855
867
  }
856
868
 
857
- 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"}];
869
+ 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"}];
858
870
 
859
871
  /**
860
872
  * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
@@ -8130,7 +8142,7 @@
8130
8142
  /**
8131
8143
  * @@@
8132
8144
  *
8133
- * TODO: !!!!!! Not centralized - register each provider to each package
8145
+ * TODO: !!!!!! Remove EXECUTION_TOOLS_CLASSES and use $llmToolsRegister instead
8134
8146
  *
8135
8147
  * @private internal type for `createLlmToolsFromConfiguration`
8136
8148
  */
@@ -8178,6 +8190,38 @@
8178
8190
  * TODO: This should be maybe not under `_common` but under `utils`
8179
8191
  */
8180
8192
 
8193
+ /**
8194
+ * Register is @@@
8195
+ *
8196
+ * @private internal utility, exported are only signleton instances of this class
8197
+ */
8198
+ var Register = /** @class */ (function () {
8199
+ function Register(storage) {
8200
+ this.storage = storage;
8201
+ }
8202
+ Register.prototype.list = function () {
8203
+ // <- TODO: ReadonlyDeep<Array<TRegistered>>
8204
+ return this.storage;
8205
+ };
8206
+ Register.prototype.register = function (registered) {
8207
+ // !!!!!! <- TODO: What to return here
8208
+ // TODO: !!!!!! Compare if same is not already registered
8209
+ this.storage.push(registered);
8210
+ };
8211
+ return Register;
8212
+ }());
8213
+
8214
+ /**
8215
+ * @@@
8216
+ *
8217
+ * Note: `$` is used to indicate that this interacts with the global scope
8218
+ * @singleton Only one instance of each register is created per build, but thare can be more @@@
8219
+ * @public exported from `@promptbook/core`
8220
+ */
8221
+ var $llmToolsMetadataRegister = new Register([
8222
+ // TODO: !!!!!! Take from global scope
8223
+ ]);
8224
+
8181
8225
  /**
8182
8226
  * @@@
8183
8227
  *
@@ -8195,28 +8239,10 @@
8195
8239
  throw new EnvironmentMismatchError('Function `createLlmToolsFromEnv` works only in Node.js environment');
8196
8240
  }
8197
8241
  dotenv__namespace.config();
8198
- var llmToolsConfiguration = [];
8199
- if (typeof process.env.OPENAI_API_KEY === 'string') {
8200
- llmToolsConfiguration.push({
8201
- title: 'OpenAI (from env)',
8202
- packageName: '@promptbook/openai',
8203
- className: 'OpenAiExecutionTools',
8204
- options: {
8205
- apiKey: process.env.OPENAI_API_KEY,
8206
- },
8207
- });
8208
- }
8209
- if (typeof process.env.ANTHROPIC_CLAUDE_API_KEY === 'string') {
8210
- llmToolsConfiguration.push({
8211
- title: 'Claude (from env)',
8212
- packageName: '@promptbook/antrhopic-claude',
8213
- className: 'AnthropicClaudeExecutionTools',
8214
- options: {
8215
- apiKey: process.env.ANTHROPIC_CLAUDE_API_KEY,
8216
- },
8217
- });
8218
- }
8219
- // <- Note: [🦑] Add here new LLM provider
8242
+ var llmToolsConfiguration = $llmToolsMetadataRegister
8243
+ .list()
8244
+ .map(function (metadata) { return metadata.createConfigurationFromEnv(process.env); })
8245
+ .filter(function (configuration) { return configuration !== null; });
8220
8246
  return llmToolsConfiguration;
8221
8247
  }
8222
8248
  /**
@@ -8251,7 +8277,7 @@
8251
8277
  var configuration = createLlmToolsFromConfigurationFromEnv();
8252
8278
  if (configuration.length === 0) {
8253
8279
  // TODO: [🥃]
8254
- throw new Error(spaceTrim__default["default"]("\n No LLM tools found in the environment\n\n Please set one of environment variables:\n - OPENAI_API_KEY\n - ANTHROPIC_CLAUDE_API_KEY\n "));
8280
+ throw new Error(spaceTrim__default["default"]("\n No LLM tools found in the environment\n\n !!!!!!!@@@@You have maybe forgotten to two things:\n\n Please set one of environment variables:\n - OPENAI_API_KEY\n - ANTHROPIC_CLAUDE_API_KEY\n "));
8255
8281
  }
8256
8282
  return createLlmToolsFromConfiguration(configuration, options);
8257
8283
  }
@@ -8469,6 +8495,7 @@
8469
8495
  * TODO: This should be maybe not under `_common` but under `utils-internal` / `utils/internal`
8470
8496
  */
8471
8497
 
8498
+ // TODO: !!!!!! Probbably all LLM tools should be registered in `@promptbook/cli`
8472
8499
  /**
8473
8500
  * Initializes `make` command for Promptbook CLI utilities
8474
8501
  *
@@ -8653,7 +8680,7 @@
8653
8680
  });
8654
8681
  }
8655
8682
  /**
8656
- * TODO: [🥃] !!! Allow `ptbk make` without llm tools
8683
+ * TODO: [🥃] !!! Allow `ptbk make` without configuring any llm tools
8657
8684
  * TODO: Maybe remove this command - "about" command should be enough?
8658
8685
  * TODO: [0] DRY Javascript and typescript - Maybe make ONLY typescript and for javascript just remove types
8659
8686
  * Note: [🟡] This code should never be published outside of `@promptbook/cli`
@@ -8988,7 +9015,86 @@
8988
9015
  * Note: [🟡] This code should never be published outside of `@promptbook/cli`
8989
9016
  */
8990
9017
 
9018
+ /**
9019
+ * @@@ registration1 of default configuration for Anthropic Claude
9020
+ *
9021
+ * Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
9022
+ *
9023
+ * @public exported from `@promptbook/core`
9024
+ * @public exported from `@promptbook/cli`
9025
+ */
9026
+ var _AnthropicClaudeMetadataRegistration = $llmToolsMetadataRegister.register({
9027
+ title: 'Anthropic Claude',
9028
+ packageName: '@promptbook/anthropic-claude',
9029
+ className: 'AnthropicClaudeExecutionTools',
9030
+ getBoilerplateConfiguration: function () {
9031
+ return {
9032
+ title: 'Anthropic Claude (boilerplate)',
9033
+ packageName: '@promptbook/anthropic-claude',
9034
+ className: 'AnthropicClaudeExecutionTools',
9035
+ options: {
9036
+ apiKey: 'sk-ant-api03-',
9037
+ isProxied: true,
9038
+ remoteUrl: DEFAULT_REMOTE_URL,
9039
+ path: DEFAULT_REMOTE_URL_PATH,
9040
+ },
9041
+ };
9042
+ },
9043
+ createConfigurationFromEnv: function (env) {
9044
+ if (typeof env.ANTHROPIC_CLAUDE_API_KEY === 'string') {
9045
+ return {
9046
+ title: 'Claude (from env)',
9047
+ packageName: '@promptbook/antrhopic-claude',
9048
+ className: 'AnthropicClaudeExecutionTools',
9049
+ options: {
9050
+ apiKey: process.env.ANTHROPIC_CLAUDE_API_KEY,
9051
+ },
9052
+ };
9053
+ }
9054
+ return null;
9055
+ },
9056
+ });
9057
+
9058
+ /**
9059
+ * @@@ registration1 of default configuration for Open AI
9060
+ *
9061
+ * Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
9062
+ *
9063
+ * @public exported from `@promptbook/core`
9064
+ * @public exported from `@promptbook/cli`
9065
+ */
9066
+ var _OpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
9067
+ title: 'Anthropic Claude',
9068
+ packageName: '@promptbook/anthropic-claude',
9069
+ className: 'AnthropicClaudeExecutionTools',
9070
+ getBoilerplateConfiguration: function () {
9071
+ return {
9072
+ title: 'Open AI (boilerplate)',
9073
+ packageName: '@promptbook/openai',
9074
+ className: 'OpenAiExecutionTools',
9075
+ options: {
9076
+ apiKey: 'sk-',
9077
+ },
9078
+ };
9079
+ },
9080
+ createConfigurationFromEnv: function (env) {
9081
+ if (typeof env.OPENAI_API_KEY === 'string') {
9082
+ return {
9083
+ title: 'Open AI (from env)',
9084
+ packageName: '@promptbook/openai',
9085
+ className: 'OpenAiExecutionTools',
9086
+ options: {
9087
+ apiKey: process.env.OPENAI_API_KEY,
9088
+ },
9089
+ };
9090
+ }
9091
+ return null;
9092
+ },
9093
+ });
9094
+
8991
9095
  exports.PROMPTBOOK_VERSION = PROMPTBOOK_VERSION;
9096
+ exports._AnthropicClaudeMetadataRegistration = _AnthropicClaudeMetadataRegistration;
9097
+ exports._OpenAiMetadataRegistration = _OpenAiMetadataRegistration;
8992
9098
  exports.__CLI = __CLI;
8993
9099
 
8994
9100
  Object.defineProperty(exports, '__esModule', { value: true });