@promptbook/cli 0.61.0-26 โ†’ 0.61.0-28

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 (33) hide show
  1. package/esm/index.es.js +52 -45
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +0 -1
  4. package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +1 -1
  5. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +6 -6
  6. package/esm/typings/src/execution/PipelineExecutor.d.ts +1 -1
  7. package/esm/typings/src/execution/PromptResult.d.ts +15 -0
  8. package/esm/typings/src/execution/createPipelineExecutor.d.ts +3 -3
  9. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
  10. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -1
  11. package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +2 -2
  12. package/esm/typings/src/prepare/isPipelinePrepared.d.ts +3 -3
  13. package/esm/typings/src/prepare/preparePipeline.d.ts +1 -1
  14. package/esm/typings/src/prepare/prepareTemplates.d.ts +1 -1
  15. package/esm/typings/src/types/ModelRequirements.d.ts +1 -1
  16. package/esm/typings/src/utils/extractParameterNames.d.ts +0 -3
  17. package/package.json +2 -2
  18. package/umd/index.umd.js +52 -45
  19. package/umd/index.umd.js.map +1 -1
  20. package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +0 -1
  21. package/umd/typings/src/conversion/utils/stringifyPipelineJson.d.ts +1 -1
  22. package/umd/typings/src/conversion/validation/validatePipeline.d.ts +6 -6
  23. package/umd/typings/src/execution/PipelineExecutor.d.ts +1 -1
  24. package/umd/typings/src/execution/PromptResult.d.ts +15 -0
  25. package/umd/typings/src/execution/createPipelineExecutor.d.ts +3 -3
  26. package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
  27. package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -1
  28. package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +2 -2
  29. package/umd/typings/src/prepare/isPipelinePrepared.d.ts +3 -3
  30. package/umd/typings/src/prepare/preparePipeline.d.ts +1 -1
  31. package/umd/typings/src/prepare/prepareTemplates.d.ts +1 -1
  32. package/umd/typings/src/types/ModelRequirements.d.ts +1 -1
  33. package/umd/typings/src/utils/extractParameterNames.d.ts +0 -3
@@ -43,6 +43,5 @@ type CreatePipelineCollectionFromDirectoryOptions = PipelineStringToJsonOptions
43
43
  export declare function createCollectionFromDirectory(path: string_folder_path, options?: CreatePipelineCollectionFromDirectoryOptions): Promise<PipelineCollection>;
44
44
  export {};
45
45
  /**
46
- * TODO: !!!! [๐Ÿง ] Library precompilation and do not mix markdown and json pipelines
47
46
  * Note: [๐ŸŸข] This code should never be published outside of `@pipeline/node`
48
47
  */
@@ -7,7 +7,7 @@ import type { string_json } from '../../types/typeAliases';
7
7
  */
8
8
  export declare function stringifyPipelineJson<TType>(pipeline: TType): string_json<TType>;
9
9
  /**
10
- * TODO: !!!! Not Working propperly @see https://promptbook.studio/samples/mixed-knowledge.ptbk.md
10
+ * TODO: [๐Ÿ] Not Working propperly @see https://promptbook.studio/samples/mixed-knowledge.ptbk.md
11
11
  * TODO: [๐Ÿง ][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
12
12
  * TODO: [๐Ÿง ] Maybe more elegant solution than replacing via regex
13
13
  * TODO: [๐Ÿ™] Make some standart order of json properties
@@ -26,11 +26,11 @@ export declare function validatePipeline(pipeline: PipelineJson): PipelineJson;
26
26
  * > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
27
27
  */
28
28
  /**
29
- * TODO: [๐Ÿง ][๐Ÿฃ] !!!! Validate that all samples match expectations
30
- * TODO: [๐Ÿง ][๐Ÿฃ] !!!! Validate that knowledge is valid (non-void)
31
- * TODO: [๐Ÿง ][๐Ÿฃ] !!!! Validate that persona can be used only with CHAT variant
32
- * TODO: !!!! Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
33
- * TODO: !!!! Validate that reserved parameter is not used as joker
34
- * TODO: [๐Ÿง ] !!! Validationg not only logic itself but imports around - files and websites and rerefenced pipelines exists
29
+ * TODO: [๐Ÿฃ] !!!! Validate that all samples match expectations
30
+ * TODO: [๐Ÿฃ][๐Ÿ] !!!! Validate that knowledge is valid (non-void)
31
+ * TODO: [๐Ÿฃ] !!!! Validate that persona can be used only with CHAT variant
32
+ * TODO: [๐Ÿฃ] !!!! Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
33
+ * TODO: [๐Ÿฃ] !!!! Validate that reserved parameter is not used as joker
34
+ * TODO: [๐Ÿง ] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
35
35
  * TODO: [๐Ÿ› ] Actions, instruments (and maybe knowledge) => Functions and tools
36
36
  */
@@ -48,5 +48,5 @@ export type PipelineExecutorResult = {
48
48
  };
49
49
  /**
50
50
  * TODO: [๐Ÿง ] Should this file be in /execution or /types folder?
51
- * TODO: [๐Ÿ’ท] !!!! `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result
51
+ * TODO: [๐Ÿ’ท] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result
52
52
  */
@@ -1,5 +1,6 @@
1
1
  import type { string_date_iso8601 } from '../types/typeAliases';
2
2
  import type { string_model_name } from '../types/typeAliases';
3
+ import type { string_prompt } from '../types/typeAliases';
3
4
  import type { TODO_object } from '../utils/organization/TODO_object';
4
5
  import type { EmbeddingVector } from './EmbeddingVector';
5
6
  import type { PromptResultUsage } from './PromptResultUsage';
@@ -69,8 +70,22 @@ export type CommonPromptResult = {
69
70
  * Usage of the prompt execution
70
71
  */
71
72
  readonly usage: PromptResultUsage;
73
+ /**
74
+ * Exact text of the prompt (with all replacements)
75
+ *
76
+ * Note: This contains redundant information
77
+ */
78
+ readonly rawPromptContent: string_prompt;
79
+ /**
80
+ * Raw request to the model
81
+ *
82
+ * Note: This contains redundant information
83
+ */
84
+ readonly rawRequest: TODO_object | null;
72
85
  /**
73
86
  * Raw response from the model
87
+ *
88
+ * Note: This contains redundant information
74
89
  */
75
90
  readonly rawResponse: TODO_object;
76
91
  };
@@ -47,8 +47,8 @@ interface CreatePipelineExecutorOptions {
47
47
  export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor;
48
48
  export {};
49
49
  /**
50
- * TODO: !!!! return `preparedPipeline` from execution
51
- * TODO: !!!! `isNotPreparedWarningSupressed`
50
+ * TODO: !!!!! return `preparedPipeline` from execution
51
+ * TODO: !!!!! `isNotPreparedWarningSupressed`
52
52
  * TODO: Use isVerbose here (not only pass to `preparePipeline`)
53
53
  * TODO: [๐Ÿช‚] Use maxParallelCount here (not only pass to `preparePipeline`)
54
54
  * TODO: [โ™ˆ] Probbably move expectations from templates to parameters
@@ -57,5 +57,5 @@ export {};
57
57
  * Note: CreatePipelineExecutorOptions are just connected to PipelineExecutor so do not extract to types folder
58
58
  * TODO: [๐Ÿง ][3] transparent = (report intermediate parameters) / opaque execution = (report only output parameters) progress reporting mode
59
59
  * TODO: [๐Ÿ› ] Actions, instruments (and maybe knowledge) => Functions and tools
60
- * TODO: [๐Ÿ’ท] !!!! `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result
60
+ * TODO: [๐Ÿง ][๐Ÿ’ท] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result BUT maybe NOT to preserve pure JSON object
61
61
  */
@@ -41,7 +41,7 @@ export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools
41
41
  listModels(): Array<AvailableModel>;
42
42
  }
43
43
  /**
44
- * TODO: !!!! [๐Ÿ†] JSON mode
44
+ * TODO: [๐Ÿ†] JSON mode
45
45
  * TODO: [๐Ÿง ] Maybe handle errors via transformAnthropicError (like transformAzureError)
46
46
  * TODO: Maybe Create some common util for callChatModel and callCompletionModel
47
47
  * TODO: Maybe make custom OpenaiError
@@ -50,5 +50,5 @@ export declare class RemoteLlmExecutionTools implements LlmExecutionTools {
50
50
  }
51
51
  /**
52
52
  * TODO: [๐Ÿ“] Allow to list compatible models with each variant
53
- * TODO: [๐Ÿคนโ€โ™‚๏ธ] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable
53
+ * TODO: [๐Ÿ—ฏ] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable
54
54
  */
@@ -12,8 +12,8 @@ export declare function startRemoteServer(options: RemoteServerOptions): IDestro
12
12
  /**
13
13
  * TODO: [โš–] Expose the collection to be able to connect to same collection via createCollectionFromUrl
14
14
  * TODO: Handle progress - support streaming
15
- * TODO: [๐Ÿคนโ€โ™‚๏ธ] Do not hang up immediately but wait until client closes OR timeout
16
- * TODO: [๐Ÿคนโ€โ™‚๏ธ] Timeout on chat to free up resources
15
+ * TODO: [๐Ÿ—ฏ] Do not hang up immediately but wait until client closes OR timeout
16
+ * TODO: [๐Ÿ—ฏ] Timeout on chat to free up resources
17
17
  * TODO: [๐Ÿƒ] Pass here some security token to prevent malitious usage and/or DDoS
18
18
  * TODO: [0] Set unavailable models as undefined in `RemoteLlmExecutionTools` NOT throw error here
19
19
  */
@@ -8,7 +8,7 @@ export declare function isPipelinePrepared(pipeline: PipelineJson): boolean;
8
8
  * TODO: [๐Ÿ”ผ] Export via core or utils
9
9
  * TODO: [๐ŸงŠ] Pipeline can be partially prepared, this should return true ONLY if fully prepared
10
10
  * TODO: [๐Ÿงฟ] Maybe do same process with same granularity and subfinctions as `preparePipeline`
11
- * - Is context in each template
12
- * - Are samples prepared
13
- * - Are templates prepared
11
+ * - [๐Ÿ] ? Is context in each template
12
+ * - [โ™จ] Are samples prepared
13
+ * - [โ™จ] Are templates prepared
14
14
  */
@@ -12,6 +12,6 @@ export declare function preparePipeline(pipeline: PipelineJson, options: Prepare
12
12
  * TODO: Write tests for `preparePipeline`
13
13
  * TODO: [๐Ÿ] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
14
14
  * TODO: [๐ŸงŠ] In future one preparation can take data from previous preparation and save tokens and time
15
- * TODO: [๐ŸŽ] !!!! Use here countTotalUsage
15
+ * TODO: [๐ŸŽ] !!!!! Use here countTotalUsage
16
16
  * TODO: [๐Ÿ› ] Actions, instruments (and maybe knowledge) => Functions and tools
17
17
  */
@@ -21,7 +21,7 @@ export {};
21
21
  /**
22
22
  * TODO: [๐Ÿง ] Add context to each template (if missing)
23
23
  * TODO: [๐Ÿง ] What is better name `prepareTemplate` or `prepareTemplateAndParameters`
24
- * TODO: !!!!! Index the samples and maybe templates
24
+ * TODO: [โ™จ] !!! Prepare index the samples and maybe templates
25
25
  * TODO: [๐Ÿ”ผ] !!! Export via `@promptbook/core`
26
26
  * TODO: Write tests for `preparePipeline`
27
27
  * TODO: [๐Ÿ] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
@@ -91,7 +91,7 @@ export type CommonModelRequirements = {
91
91
  readonly maxTokens?: number;
92
92
  };
93
93
  /**
94
- * TODO: [๐Ÿ”ผ] !!!! Export all from `@promptbook/types`
94
+ * TODO: [๐Ÿ”ผ] !!!!! (<- To all [๐Ÿ”ผ]) Export all from `@promptbook/types`
95
95
  * TODO: [๐Ÿง ][๐Ÿˆ] `seed` should maybe be somewhere else (not in `ModelRequirements`) (simmilar that `user` identification is not here)
96
96
  * TODO: [๐Ÿง ][๐Ÿ’ฑ] Add more model options: `stop_token`, `logit_bias`, `logprobs` (`top_logprobs`), `top_k`, `top_p`, `presence_penalty`, `frequency_penalty`, `bestOf`, `logitBias`, `logitBiasType`,...
97
97
  * [๐Ÿ’ฑ] Probbably keep using just `temperature` in Promptbook (not `top_k` and `top_p`)
@@ -7,6 +7,3 @@ import type { string_template } from '../types/typeAliases';
7
7
  * @returns the list of parameter names
8
8
  */
9
9
  export declare function extractParameterNames(template: string_template): Set<string_parameter_name>;
10
- /**
11
- * TODO: !!!!! Rename to extractParameterNames
12
- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/cli",
3
- "version": "0.61.0-26",
3
+ "version": "0.61.0-28",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -54,7 +54,7 @@
54
54
  }
55
55
  ],
56
56
  "peerDependencies": {
57
- "@promptbook/core": "0.61.0-26"
57
+ "@promptbook/core": "0.61.0-28"
58
58
  },
59
59
  "main": "./umd/index.umd.js",
60
60
  "module": "./esm/index.es.js",
package/umd/index.umd.js CHANGED
@@ -154,7 +154,7 @@
154
154
  /**
155
155
  * The version of the Promptbook library
156
156
  */
157
- var PROMPTBOOK_VERSION = '0.61.0-25';
157
+ var PROMPTBOOK_VERSION = '0.61.0-27';
158
158
  // TODO: !!!! List here all the versions and annotate + put into script
159
159
 
160
160
  /**
@@ -751,7 +751,7 @@
751
751
  });
752
752
  }
753
753
 
754
- var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.61.0-25",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:[{id:1,promptbookVersion:"0.61.0-25",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-from-markdown.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.ptbk.md",promptbookVersion:"0.61.0-25",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:[{id:1,promptbookVersion:"0.61.0-25",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-keywords.ptbk.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.ptbk.md",promptbookVersion:"0.61.0-25",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:[{id:1,promptbookVersion:"0.61.0-25",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",promptbookVersion:"0.61.0-25",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:[{id:1,promptbookVersion:"0.61.0-25",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
754
+ var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.61.0-27",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:[{id:1,promptbookVersion:"0.61.0-27",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-from-markdown.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.ptbk.md",promptbookVersion:"0.61.0-27",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:[{id:1,promptbookVersion:"0.61.0-27",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-keywords.ptbk.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.ptbk.md",promptbookVersion:"0.61.0-27",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:[{id:1,promptbookVersion:"0.61.0-27",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",promptbookVersion:"0.61.0-27",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:[{id:1,promptbookVersion:"0.61.0-27",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
755
755
 
756
756
  /**
757
757
  * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
@@ -829,7 +829,7 @@
829
829
  if ( /* version === '1.0.0' || */version === '2.0.0' || version === '3.0.0') {
830
830
  return false;
831
831
  }
832
- // <- TODO: !!!! Check isValidPromptbookVersion against PROMPTBOOK_VERSIONS
832
+ // <- TODO: !!! Check isValidPromptbookVersion against PROMPTBOOK_VERSIONS
833
833
  return true;
834
834
  }
835
835
 
@@ -1169,12 +1169,12 @@
1169
1169
  * > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
1170
1170
  */
1171
1171
  /**
1172
- * TODO: [๐Ÿง ][๐Ÿฃ] !!!! Validate that all samples match expectations
1173
- * TODO: [๐Ÿง ][๐Ÿฃ] !!!! Validate that knowledge is valid (non-void)
1174
- * TODO: [๐Ÿง ][๐Ÿฃ] !!!! Validate that persona can be used only with CHAT variant
1175
- * TODO: !!!! Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
1176
- * TODO: !!!! Validate that reserved parameter is not used as joker
1177
- * TODO: [๐Ÿง ] !!! Validationg not only logic itself but imports around - files and websites and rerefenced pipelines exists
1172
+ * TODO: [๐Ÿฃ] !!!! Validate that all samples match expectations
1173
+ * TODO: [๐Ÿฃ][๐Ÿ] !!!! Validate that knowledge is valid (non-void)
1174
+ * TODO: [๐Ÿฃ] !!!! Validate that persona can be used only with CHAT variant
1175
+ * TODO: [๐Ÿฃ] !!!! Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
1176
+ * TODO: [๐Ÿฃ] !!!! Validate that reserved parameter is not used as joker
1177
+ * TODO: [๐Ÿง ] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
1178
1178
  * TODO: [๐Ÿ› ] Actions, instruments (and maybe knowledge) => Functions and tools
1179
1179
  */
1180
1180
 
@@ -1232,9 +1232,6 @@
1232
1232
  }
1233
1233
  return parameterNames;
1234
1234
  }
1235
- /**
1236
- * TODO: !!!!! Rename to extractParameterNames
1237
- */
1238
1235
 
1239
1236
  /**
1240
1237
  * Unprepare just strips the preparation data of the pipeline
@@ -1875,7 +1872,7 @@
1875
1872
  /**
1876
1873
  * Function isValidJsonString will tell you if the string is valid JSON or not
1877
1874
  */
1878
- function isValidJsonString(value /* <-[๐Ÿ‘จโ€โš–๏ธ] */) {
1875
+ function isValidJsonString(value /* <- [๐Ÿ‘จโ€โš–๏ธ] */) {
1879
1876
  try {
1880
1877
  JSON.parse(value);
1881
1878
  return true;
@@ -2159,9 +2156,9 @@
2159
2156
  * TODO: [๐Ÿ”ผ] Export via core or utils
2160
2157
  * TODO: [๐ŸงŠ] Pipeline can be partially prepared, this should return true ONLY if fully prepared
2161
2158
  * TODO: [๐Ÿงฟ] Maybe do same process with same granularity and subfinctions as `preparePipeline`
2162
- * - Is context in each template
2163
- * - Are samples prepared
2164
- * - Are templates prepared
2159
+ * - [๐Ÿ] ? Is context in each template
2160
+ * - [โ™จ] Are samples prepared
2161
+ * - [โ™จ] Are templates prepared
2165
2162
  */
2166
2163
 
2167
2164
  /**
@@ -2492,7 +2489,7 @@
2492
2489
  pipeline = rawPipeline;
2493
2490
  }
2494
2491
  else {
2495
- // TODO: !!!! This should be maybe warning in report
2492
+ // TODO: !!!!! This should be maybe warning in report
2496
2493
  console.warn(spaceTrim.spaceTrim("\n Pipeline ".concat(rawPipeline.pipelineUrl || rawPipeline.sourceFile || rawPipeline.title, " is not prepared\n\n ").concat(rawPipeline.sourceFile, "\n\n It will be prepared ad-hoc before the first execution\n But it is recommended to prepare the pipeline during collection preparation\n\n @see more at https://ptbk.io/prepare-pipeline\n ")));
2497
2494
  }
2498
2495
  var pipelineExecutor = function (inputParameters, onProgress) { return __awaiter(_this, void 0, void 0, function () {
@@ -2502,7 +2499,7 @@
2502
2499
  return __awaiter(this, void 0, void 0, function () {
2503
2500
  return __generator(this, function (_a) {
2504
2501
  TODO_USE(template);
2505
- return [2 /*return*/, RESERVED_PARAMETER_MISSING_VALUE /* <- TODO: !!!! Implement */];
2502
+ return [2 /*return*/, RESERVED_PARAMETER_MISSING_VALUE /* <- TODO: [๐Ÿ] Implement */];
2506
2503
  });
2507
2504
  });
2508
2505
  }
@@ -2510,7 +2507,7 @@
2510
2507
  template) {
2511
2508
  return __awaiter(this, void 0, void 0, function () {
2512
2509
  return __generator(this, function (_a) {
2513
- // TODO: !!!! Implement Better - use real index and keyword search
2510
+ // TODO: [โ™จ] Implement Better - use real index and keyword search
2514
2511
  TODO_USE(template);
2515
2512
  return [2 /*return*/, pipeline.knowledgePieces.map(function (_a) {
2516
2513
  var content = _a.content;
@@ -2523,9 +2520,9 @@
2523
2520
  template) {
2524
2521
  return __awaiter(this, void 0, void 0, function () {
2525
2522
  return __generator(this, function (_a) {
2526
- // TODO: !!!! Implement Better - use real index and keyword search
2523
+ // TODO: [โ™จ] Implement Better - use real index and keyword search
2527
2524
  TODO_USE(template);
2528
- return [2 /*return*/, RESERVED_PARAMETER_MISSING_VALUE /* <- TODO: !!!! Implement */];
2525
+ return [2 /*return*/, RESERVED_PARAMETER_MISSING_VALUE /* <- TODO: [โ™จ] Implement */];
2529
2526
  });
2530
2527
  });
2531
2528
  }
@@ -3251,8 +3248,8 @@
3251
3248
  return pipelineExecutor;
3252
3249
  }
3253
3250
  /**
3254
- * TODO: !!!! return `preparedPipeline` from execution
3255
- * TODO: !!!! `isNotPreparedWarningSupressed`
3251
+ * TODO: !!!!! return `preparedPipeline` from execution
3252
+ * TODO: !!!!! `isNotPreparedWarningSupressed`
3256
3253
  * TODO: Use isVerbose here (not only pass to `preparePipeline`)
3257
3254
  * TODO: [๐Ÿช‚] Use maxParallelCount here (not only pass to `preparePipeline`)
3258
3255
  * TODO: [โ™ˆ] Probbably move expectations from templates to parameters
@@ -3261,7 +3258,7 @@
3261
3258
  * Note: CreatePipelineExecutorOptions are just connected to PipelineExecutor so do not extract to types folder
3262
3259
  * TODO: [๐Ÿง ][3] transparent = (report intermediate parameters) / opaque execution = (report only output parameters) progress reporting mode
3263
3260
  * TODO: [๐Ÿ› ] Actions, instruments (and maybe knowledge) => Functions and tools
3264
- * TODO: [๐Ÿ’ท] !!!! `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result
3261
+ * TODO: [๐Ÿง ][๐Ÿ’ท] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result BUT maybe NOT to preserve pure JSON object
3265
3262
  */
3266
3263
 
3267
3264
  /**
@@ -3537,7 +3534,7 @@
3537
3534
  case 0:
3538
3535
  _a = options.maxParallelCount, maxParallelCount = _a === void 0 ? MAX_PARALLEL_COUNT : _a;
3539
3536
  promptTemplates = pipeline.promptTemplates, parameters = pipeline.parameters, knowledgePiecesCount = pipeline.knowledgePiecesCount;
3540
- // TODO: !!!! Apply samples to each template (if missing and is for the template defined)
3537
+ // TODO: !!!!! Apply samples to each template (if missing and is for the template defined)
3541
3538
  TODO_USE(parameters);
3542
3539
  promptTemplatesPrepared = new Array(promptTemplates.length);
3543
3540
  return [4 /*yield*/, forEachAsync(promptTemplates, { maxParallelCount: maxParallelCount /* <- TODO: [๐Ÿช‚] When there are subtasks, this maximul limit can be broken */ }, function (template, index) { return __awaiter(_this, void 0, void 0, function () {
@@ -3567,7 +3564,7 @@
3567
3564
  /**
3568
3565
  * TODO: [๐Ÿง ] Add context to each template (if missing)
3569
3566
  * TODO: [๐Ÿง ] What is better name `prepareTemplate` or `prepareTemplateAndParameters`
3570
- * TODO: !!!!! Index the samples and maybe templates
3567
+ * TODO: [โ™จ] !!! Prepare index the samples and maybe templates
3571
3568
  * TODO: [๐Ÿ”ผ] !!! Export via `@promptbook/core`
3572
3569
  * TODO: Write tests for `preparePipeline`
3573
3570
  * TODO: [๐Ÿ] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
@@ -3646,7 +3643,7 @@
3646
3643
  * TODO: Write tests for `preparePipeline`
3647
3644
  * TODO: [๐Ÿ] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
3648
3645
  * TODO: [๐ŸงŠ] In future one preparation can take data from previous preparation and save tokens and time
3649
- * TODO: [๐ŸŽ] !!!! Use here countTotalUsage
3646
+ * TODO: [๐ŸŽ] !!!!! Use here countTotalUsage
3650
3647
  * TODO: [๐Ÿ› ] Actions, instruments (and maybe knowledge) => Functions and tools
3651
3648
  */
3652
3649
 
@@ -5959,7 +5956,6 @@
5959
5956
  });
5960
5957
  }
5961
5958
  /**
5962
- * TODO: !!!! [๐Ÿง ] Library precompilation and do not mix markdown and json pipelines
5963
5959
  * Note: [๐ŸŸข] This code should never be published outside of `@pipeline/node`
5964
5960
  */
5965
5961
 
@@ -6242,7 +6238,7 @@
6242
6238
  */
6243
6239
  AnthropicClaudeExecutionTools.prototype.callChatModel = function (prompt) {
6244
6240
  return __awaiter(this, void 0, void 0, function () {
6245
- var content, parameters, modelRequirements, modelName, rawRequest, start, complete, rawResponse, resultContent, usage;
6241
+ var content, parameters, modelRequirements, modelName, rawPromptContent, rawRequest, start, complete, rawResponse, resultContent, usage;
6246
6242
  return __generator(this, function (_a) {
6247
6243
  switch (_a.label) {
6248
6244
  case 0:
@@ -6255,6 +6251,7 @@
6255
6251
  throw new PipelineExecutionError('Use callChatModel only for CHAT variant');
6256
6252
  }
6257
6253
  modelName = modelRequirements.modelName || this.getDefaultChatModel().modelName;
6254
+ rawPromptContent = replaceParameters(content, __assign(__assign({}, parameters), { modelName: modelName }));
6258
6255
  rawRequest = {
6259
6256
  model: modelRequirements.modelName || this.getDefaultChatModel().modelName,
6260
6257
  max_tokens: modelRequirements.maxTokens || 4096,
@@ -6266,7 +6263,7 @@
6266
6263
  messages: [
6267
6264
  {
6268
6265
  role: 'user',
6269
- content: replaceParameters(content, __assign(__assign({}, parameters), { modelName: modelName })),
6266
+ content: rawPromptContent,
6270
6267
  },
6271
6268
  ],
6272
6269
  // TODO: Is here some equivalent of user identification?> user: this.options.user,
@@ -6303,8 +6300,10 @@
6303
6300
  complete: complete,
6304
6301
  },
6305
6302
  usage: usage,
6303
+ rawPromptContent: rawPromptContent,
6304
+ rawRequest: rawRequest,
6306
6305
  rawResponse: rawResponse,
6307
- // <- [๐Ÿคนโ€โ™‚๏ธ]
6306
+ // <- [๐Ÿ—ฏ]
6308
6307
  }];
6309
6308
  }
6310
6309
  });
@@ -6337,7 +6336,7 @@
6337
6336
 
6338
6337
  const rawRequest: xxxx.Completions.CompletionCreateParamsNonStreaming = {
6339
6338
  ...modelSettings,
6340
- prompt: replaceParameters(content, { ...parameters, modelName }),
6339
+ prompt: rawPromptContent,
6341
6340
  user: this.options.user,
6342
6341
  };
6343
6342
  const start: string_date_iso8601 = getCurrentIsoDate();
@@ -6376,7 +6375,7 @@
6376
6375
  },
6377
6376
  usage,
6378
6377
  rawResponse,
6379
- // <- [๐Ÿคนโ€โ™‚๏ธ]
6378
+ // <- [๐Ÿ—ฏ]
6380
6379
  };
6381
6380
  }
6382
6381
  */
@@ -6415,7 +6414,7 @@
6415
6414
  return AnthropicClaudeExecutionTools;
6416
6415
  }());
6417
6416
  /**
6418
- * TODO: !!!! [๐Ÿ†] JSON mode
6417
+ * TODO: [๐Ÿ†] JSON mode
6419
6418
  * TODO: [๐Ÿง ] Maybe handle errors via transformAnthropicError (like transformAzureError)
6420
6419
  * TODO: Maybe Create some common util for callChatModel and callCompletionModel
6421
6420
  * TODO: Maybe make custom OpenaiError
@@ -6844,7 +6843,7 @@
6844
6843
  */
6845
6844
  OpenAiExecutionTools.prototype.callChatModel = function (prompt) {
6846
6845
  return __awaiter(this, void 0, void 0, function () {
6847
- var content, parameters, modelRequirements, expectFormat, modelName, modelSettings, rawRequest, start, complete, rawResponse, resultContent, usage;
6846
+ var content, parameters, modelRequirements, expectFormat, modelName, modelSettings, rawPromptContent, rawRequest, start, complete, rawResponse, resultContent, usage;
6848
6847
  return __generator(this, function (_a) {
6849
6848
  switch (_a.label) {
6850
6849
  case 0:
@@ -6870,6 +6869,7 @@
6870
6869
  type: 'json_object',
6871
6870
  };
6872
6871
  }
6872
+ rawPromptContent = replaceParameters(content, __assign(__assign({}, parameters), { modelName: modelName }));
6873
6873
  rawRequest = __assign(__assign({}, modelSettings), { messages: __spreadArray(__spreadArray([], __read((modelRequirements.systemMessage === undefined
6874
6874
  ? []
6875
6875
  : [
@@ -6880,7 +6880,7 @@
6880
6880
  ])), false), [
6881
6881
  {
6882
6882
  role: 'user',
6883
- content: replaceParameters(content, __assign(__assign({}, parameters), { modelName: modelName })),
6883
+ content: rawPromptContent,
6884
6884
  },
6885
6885
  ], false), user: this.options.user });
6886
6886
  start = getCurrentIsoDate();
@@ -6915,8 +6915,10 @@
6915
6915
  complete: complete,
6916
6916
  },
6917
6917
  usage: usage,
6918
+ rawPromptContent: rawPromptContent,
6919
+ rawRequest: rawRequest,
6918
6920
  rawResponse: rawResponse,
6919
- // <- [๐Ÿคนโ€โ™‚๏ธ]
6921
+ // <- [๐Ÿ—ฏ]
6920
6922
  }];
6921
6923
  }
6922
6924
  });
@@ -6927,7 +6929,7 @@
6927
6929
  */
6928
6930
  OpenAiExecutionTools.prototype.callCompletionModel = function (prompt) {
6929
6931
  return __awaiter(this, void 0, void 0, function () {
6930
- var content, parameters, modelRequirements, modelName, modelSettings, rawRequest, start, complete, rawResponse, resultContent, usage;
6932
+ var content, parameters, modelRequirements, modelName, modelSettings, rawPromptContent, rawRequest, start, complete, rawResponse, resultContent, usage;
6931
6933
  return __generator(this, function (_a) {
6932
6934
  switch (_a.label) {
6933
6935
  case 0:
@@ -6948,7 +6950,8 @@
6948
6950
  // <- TODO: [๐Ÿˆ] Use `seed` here AND/OR use is `isDeterministic` for entire execution tools
6949
6951
  // <- Note: [๐Ÿง†]
6950
6952
  };
6951
- rawRequest = __assign(__assign({}, modelSettings), { prompt: replaceParameters(content, __assign(__assign({}, parameters), { modelName: modelName })), user: this.options.user });
6953
+ rawPromptContent = replaceParameters(content, __assign(__assign({}, parameters), { modelName: modelName }));
6954
+ rawRequest = __assign(__assign({}, modelSettings), { prompt: rawPromptContent, user: this.options.user });
6952
6955
  start = getCurrentIsoDate();
6953
6956
  if (this.options.isVerbose) {
6954
6957
  console.info(colors__default["default"].bgWhite('rawRequest'), JSON.stringify(rawRequest, null, 4));
@@ -6978,8 +6981,10 @@
6978
6981
  complete: complete,
6979
6982
  },
6980
6983
  usage: usage,
6984
+ rawPromptContent: rawPromptContent,
6985
+ rawRequest: rawRequest,
6981
6986
  rawResponse: rawResponse,
6982
- // <- [๐Ÿคนโ€โ™‚๏ธ]
6987
+ // <- [๐Ÿ—ฏ]
6983
6988
  }];
6984
6989
  }
6985
6990
  });
@@ -6990,7 +6995,7 @@
6990
6995
  */
6991
6996
  OpenAiExecutionTools.prototype.callEmbeddingModel = function (prompt) {
6992
6997
  return __awaiter(this, void 0, void 0, function () {
6993
- var content, parameters, modelRequirements, modelName, rawRequest, start, complete, rawResponse, resultContent, usage;
6998
+ var content, parameters, modelRequirements, modelName, rawPromptContent, rawRequest, start, complete, rawResponse, resultContent, usage;
6994
6999
  return __generator(this, function (_a) {
6995
7000
  switch (_a.label) {
6996
7001
  case 0:
@@ -7003,10 +7008,10 @@
7003
7008
  throw new PipelineExecutionError('Use embed only for EMBEDDING variant');
7004
7009
  }
7005
7010
  modelName = modelRequirements.modelName || this.getDefaultEmbeddingModel().modelName;
7011
+ rawPromptContent = replaceParameters(content, __assign(__assign({}, parameters), { modelName: modelName }));
7006
7012
  rawRequest = {
7007
- input: replaceParameters(content, __assign(__assign({}, parameters), { modelName: modelName })),
7013
+ input: rawPromptContent,
7008
7014
  model: modelName,
7009
- // TODO: !!!! Test model 3 and dimensions
7010
7015
  };
7011
7016
  start = getCurrentIsoDate();
7012
7017
  if (this.options.isVerbose) {
@@ -7033,8 +7038,10 @@
7033
7038
  complete: complete,
7034
7039
  },
7035
7040
  usage: usage,
7041
+ rawPromptContent: rawPromptContent,
7042
+ rawRequest: rawRequest,
7036
7043
  rawResponse: rawResponse,
7037
- // <- [๐Ÿคนโ€โ™‚๏ธ]
7044
+ // <- [๐Ÿ—ฏ]
7038
7045
  }];
7039
7046
  }
7040
7047
  });
@@ -7347,7 +7354,7 @@
7347
7354
  return pipelineJsonStringified;
7348
7355
  }
7349
7356
  /**
7350
- * TODO: !!!! Not Working propperly @see https://promptbook.studio/samples/mixed-knowledge.ptbk.md
7357
+ * TODO: [๐Ÿ] Not Working propperly @see https://promptbook.studio/samples/mixed-knowledge.ptbk.md
7351
7358
  * TODO: [๐Ÿง ][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
7352
7359
  * TODO: [๐Ÿง ] Maybe more elegant solution than replacing via regex
7353
7360
  * TODO: [๐Ÿ™] Make some standart order of json properties