@promptbook/cli 0.69.0-15 → 0.69.0-17

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 (27) hide show
  1. package/README.md +4 -0
  2. package/esm/index.es.js +81 -34
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/promptbook-collection/index.d.ts +0 -3
  5. package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
  6. package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
  7. package/esm/typings/src/config.d.ts +2 -2
  8. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +1 -1
  9. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +5 -5
  10. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
  11. package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +1 -1
  12. package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +1 -1
  13. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  14. package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +2 -2
  15. package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +2 -2
  16. package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +1 -1
  17. package/esm/typings/src/personas/preparePersona.d.ts +1 -1
  18. package/esm/typings/src/prepare/isPipelinePrepared.d.ts +1 -1
  19. package/esm/typings/src/prepare/prepareTemplates.d.ts +1 -1
  20. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +1 -1
  21. package/esm/typings/src/types/typeAliases.d.ts +1 -1
  22. package/esm/typings/src/utils/serialization/checkSerializableAsJson.d.ts +1 -1
  23. package/esm/typings/src/utils/serialization/isSerializableAsJson.d.ts +1 -1
  24. package/package.json +1 -1
  25. package/umd/index.umd.js +81 -34
  26. package/umd/index.umd.js.map +1 -1
  27. package/esm/typings/src/personas/preparePersona.test.d.ts +0 -1
package/README.md CHANGED
@@ -16,6 +16,10 @@ Supercharge your use of large language models
16
16
 
17
17
 
18
18
 
19
+ ## ✨ New Features
20
+
21
+ - ✨ **Support of [OpenAI o1 model](https://openai.com/o1/)**
22
+
19
23
  ## 📦 Package `@promptbook/cli`
20
24
 
21
25
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
package/esm/index.es.js CHANGED
@@ -21,8 +21,8 @@ import OpenAI from 'openai';
21
21
  /**
22
22
  * The version of the Promptbook library
23
23
  */
24
- var PROMPTBOOK_VERSION = '0.69.0-14';
25
- // TODO: !!!! List here all the versions and annotate + put into script
24
+ var PROMPTBOOK_VERSION = '0.69.0-16';
25
+ // TODO:[main] !!!! List here all the versions and annotate + put into script
26
26
 
27
27
  /*! *****************************************************************************
28
28
  Copyright (c) Microsoft Corporation.
@@ -357,7 +357,7 @@ function checkSerializableAsJson(name, value) {
357
357
  }
358
358
  /**
359
359
  * TODO: [🧠][🛣] More elegant way to tracking than passing `name`
360
- * TODO: [🧠] !!! In-memory cache of same values to prevent multiple checks
360
+ * TODO: [🧠][main] !!! In-memory cache of same values to prevent multiple checks
361
361
  * Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
362
362
  */
363
363
 
@@ -682,7 +682,7 @@ function pipelineJsonToString(pipelineJson) {
682
682
  commands.push("PIPELINE URL ".concat(pipelineUrl));
683
683
  }
684
684
  commands.push("PROMPTBOOK VERSION ".concat(promptbookVersion));
685
- // TODO: !!! This increase size of the bundle and is probbably not necessary
685
+ // TODO:[main] !!! This increase size of the bundle and is probbably not necessary
686
686
  pipelineString = prettifyMarkdown(pipelineString);
687
687
  try {
688
688
  for (var _g = __values(parameters.filter(function (_a) {
@@ -830,12 +830,12 @@ function pipelineJsonToString(pipelineJson) {
830
830
  pipelineString += '```' + contentLanguage;
831
831
  pipelineString += '\n';
832
832
  pipelineString += spaceTrim$1(content);
833
- // <- TODO: !!! Escape
833
+ // <- TODO:[main] !!! Escape
834
834
  // <- TODO: [🧠] Some clear strategy how to spaceTrim the blocks
835
835
  pipelineString += '\n';
836
836
  pipelineString += '```';
837
837
  pipelineString += '\n\n';
838
- pipelineString += "`-> {".concat(resultingParameterName, "}`"); // <- TODO: !!! If the parameter here has description, add it and use templateParameterJsonToString
838
+ pipelineString += "`-> {".concat(resultingParameterName, "}`"); // <- TODO:[main] !!! If the parameter here has description, add it and use templateParameterJsonToString
839
839
  }
840
840
  }
841
841
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
@@ -1062,7 +1062,7 @@ function forEachAsync(array, options, callbackfunction) {
1062
1062
  });
1063
1063
  }
1064
1064
 
1065
- var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.69.0-14",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",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}",resultingParameterName:"knowledgePieces",dependentParameterNames:["knowledgeContent"]}],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.69.0-14",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",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}",resultingParameterName:"keywords",dependentParameterNames:["knowledgePieceContent"]}],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.69.0-14",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",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}",resultingParameterName:"title",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"]}],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.69.0-14",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}],templates:[{templateType:"PROMPT_TEMPLATE",name:"make-model-requirements",title:"Make modelRequirements",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- Your output format is JSON object\n- Write just the JSON object, no other text should be present\n- It contains the following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nPick from the following models:\n\n- {availableModelNames}\n\n### Key `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### Key `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}",resultingParameterName:"modelRequirements",format:"JSON",dependentParameterNames:["availableModelNames","personaDescription"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
1065
+ var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",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}",resultingParameterName:"knowledgePieces",dependentParameterNames:["knowledgeContent"]}],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",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",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}",resultingParameterName:"keywords",dependentParameterNames:["knowledgePieceContent"]}],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",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",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}",resultingParameterName:"title",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",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}],templates:[{templateType:"PROMPT_TEMPLATE",name:"make-model-requirements",title:"Make modelRequirements",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- Your output format is JSON object\n- Write just the JSON object, no other text should be present\n- It contains the following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nPick from the following models:\n\n- {availableModelNames}\n\n### Key `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### Key `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}",resultingParameterName:"modelRequirements",format:"JSON",dependentParameterNames:["availableModelNames","personaDescription"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
1066
1066
 
1067
1067
  /**
1068
1068
  * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
@@ -1137,7 +1137,7 @@ function isValidPromptbookVersion(version) {
1137
1137
  if ( /* version === '1.0.0' || */version === '2.0.0' || version === '3.0.0') {
1138
1138
  return false;
1139
1139
  }
1140
- // <- TODO: !!! Check isValidPromptbookVersion against PROMPTBOOK_VERSIONS
1140
+ // <- TODO:[main] !!! Check isValidPromptbookVersion against PROMPTBOOK_VERSIONS
1141
1141
  return true;
1142
1142
  }
1143
1143
 
@@ -1306,7 +1306,7 @@ function validatePipelineCore(pipeline) {
1306
1306
  // <- Note: [🚲]
1307
1307
  throw new PipelineLogicError(spaceTrim(function (block) { return "\n Invalid promptbook URL \"".concat(pipeline.pipelineUrl, "\"\n\n ").concat(block(pipelineIdentification), "\n "); }));
1308
1308
  }
1309
- if (!isValidPromptbookVersion(pipeline.promptbookVersion)) {
1309
+ if (pipeline.promptbookVersion !== undefined && !isValidPromptbookVersion(pipeline.promptbookVersion)) {
1310
1310
  // <- Note: [🚲]
1311
1311
  throw new PipelineLogicError(spaceTrim(function (block) { return "\n Invalid Promptbook Version \"".concat(pipeline.promptbookVersion, "\"\n\n ").concat(block(pipelineIdentification), "\n "); }));
1312
1312
  }
@@ -1501,11 +1501,11 @@ function validatePipelineCore(pipeline) {
1501
1501
  * > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
1502
1502
  */
1503
1503
  /**
1504
- * TODO: [🐣] !!!! Validate that all samples match expectations
1505
- * TODO: [🐣][🐝] !!!! Validate that knowledge is valid (non-void)
1506
- * TODO: [🐣] !!!! Validate that persona can be used only with CHAT variant
1507
- * TODO: [🐣] !!!! Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
1508
- * TODO: [🐣] !!!! Validate that reserved parameter is not used as joker
1504
+ * TODO: [🐣][main] !!!! Validate that all samples match expectations
1505
+ * TODO: [🐣][🐝][main] !!!! Validate that knowledge is valid (non-void)
1506
+ * TODO: [🐣][main] !!!! Validate that persona can be used only with CHAT variant
1507
+ * TODO: [🐣][main] !!!! Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
1508
+ * TODO: [🐣][main] !!!! Validate that reserved parameter is not used as joker
1509
1509
  * TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
1510
1510
  * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
1511
1511
  */
@@ -2233,7 +2233,7 @@ function isPipelinePrepared(pipeline) {
2233
2233
  return true;
2234
2234
  }
2235
2235
  /**
2236
- * TODO: [🔃] !!!!! If the pipeline was prepared with different version or different set of models, prepare it once again
2236
+ * TODO: [🔃][main] !!!!! If the pipeline was prepared with different version or different set of models, prepare it once again
2237
2237
  * TODO: [🐠] Maybe base this on `makeValidator`
2238
2238
  * TODO: [🧊] Pipeline can be partially prepared, this should return true ONLY if fully prepared
2239
2239
  * TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
@@ -4644,7 +4644,7 @@ function prepareKnowledgeFromMarkdown(knowledgeContent /* <- TODO: [🖖] (?mayb
4644
4644
  outputParameters = result.outputParameters;
4645
4645
  knowledgePiecesRaw = outputParameters.knowledgePieces;
4646
4646
  knowledgeTextPieces = (knowledgePiecesRaw || '').split('\n---\n');
4647
- // <- TODO: !!!!! Smarter split and filter out empty pieces
4647
+ // <- TODO:[main] !!!!! Smarter split and filter out empty pieces
4648
4648
  if (isVerbose) {
4649
4649
  console.info('knowledgeTextPieces:', knowledgeTextPieces);
4650
4650
  }
@@ -4729,7 +4729,7 @@ function prepareKnowledgeFromMarkdown(knowledgeContent /* <- TODO: [🖖] (?mayb
4729
4729
  });
4730
4730
  }
4731
4731
  /**
4732
- * TODO: [🐝][🔼] !!! Export via `@promptbook/markdown`
4732
+ * TODO: [🐝][🔼][main] !!! Export via `@promptbook/markdown`
4733
4733
  * TODO: [🪂] Do it in parallel 11:11
4734
4734
  * Note: No need to aggregate usage here, it is done by intercepting the llmTools
4735
4735
  */
@@ -4753,7 +4753,7 @@ function prepareKnowledgePieces(knowledgeSources, options) {
4753
4753
  var partialPieces, pieces;
4754
4754
  return __generator(this, function (_a) {
4755
4755
  switch (_a.label) {
4756
- case 0: return [4 /*yield*/, prepareKnowledgeFromMarkdown(knowledgeSource.sourceContent, // <- TODO: [🐝] !!! Unhardcode markdown, detect which type it is - BE AWARE of big package size
4756
+ case 0: return [4 /*yield*/, prepareKnowledgeFromMarkdown(knowledgeSource.sourceContent, // <- TODO: [🐝][main] !!! Unhardcode markdown, detect which type it is - BE AWARE of big package size
4757
4757
  options)];
4758
4758
  case 1:
4759
4759
  partialPieces = _a.sent();
@@ -4945,7 +4945,7 @@ function preparePersona(personaDescription, options) {
4945
4945
  });
4946
4946
  }
4947
4947
  /**
4948
- * TODO: [🔃] !!!!! If the persona was prepared with different version or different set of models, prepare it once again
4948
+ * TODO: [🔃][main] !!!!! If the persona was prepared with different version or different set of models, prepare it once again
4949
4949
  * TODO: [🏢] !! Check validity of `modelName` in pipeline
4950
4950
  * TODO: [🏢] !! Check validity of `systemMessage` in pipeline
4951
4951
  * TODO: [🏢] !! Check validity of `temperature` in pipeline
@@ -4994,7 +4994,7 @@ function prepareTemplates(pipeline, options) {
4994
4994
  case 0:
4995
4995
  _a = options.maxParallelCount, maxParallelCount = _a === void 0 ? MAX_PARALLEL_COUNT : _a;
4996
4996
  templates = pipeline.templates, parameters = pipeline.parameters, knowledgePiecesCount = pipeline.knowledgePiecesCount;
4997
- // TODO: !!!!! Apply samples to each template (if missing and is for the template defined)
4997
+ // TODO:[main] !!!!! Apply samples to each template (if missing and is for the template defined)
4998
4998
  TODO_USE(parameters);
4999
4999
  templatesPrepared = new Array(
5000
5000
  // <- TODO: [🧱] Implement in a functional (not new Class) way
@@ -5026,7 +5026,7 @@ function prepareTemplates(pipeline, options) {
5026
5026
  /**
5027
5027
  * TODO: [🧠] Add context to each template (if missing)
5028
5028
  * TODO: [🧠] What is better name `prepareTemplate` or `prepareTemplateAndParameters`
5029
- * TODO: [♨] !!! Prepare index the samples and maybe templates
5029
+ * TODO: [♨][main] !!! Prepare index the samples and maybe templates
5030
5030
  * TODO: Write tests for `preparePipeline`
5031
5031
  * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
5032
5032
  * TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
@@ -5198,7 +5198,7 @@ var knowledgeCommandParser = {
5198
5198
  if (sourceContent === '') {
5199
5199
  throw new ParseError("Source is not defined");
5200
5200
  }
5201
- // TODO: !!!! Following checks should be applied every link in the `sourceContent`
5201
+ // TODO:[main] !!!! Following checks should be applied every link in the `sourceContent`
5202
5202
  if (sourceContent.startsWith('http://')) {
5203
5203
  throw new ParseError("Source is not secure");
5204
5204
  }
@@ -5401,7 +5401,7 @@ var templateCommandParser = {
5401
5401
  if (command.templateType === 'KNOWLEDGE') {
5402
5402
  knowledgeCommandParser.$applyToPipelineJson({
5403
5403
  type: 'KNOWLEDGE',
5404
- sourceContent: $templateJson.content, // <- TODO: [🐝] !!! Work with KNOWLEDGE which not referring to the source file or website, but its content itself
5404
+ sourceContent: $templateJson.content, // <- TODO: [🐝][main] !!! Work with KNOWLEDGE which not referring to the source file or website, but its content itself
5405
5405
  }, $pipelineJson);
5406
5406
  $templateJson.isTemplate = false;
5407
5407
  return;
@@ -6698,6 +6698,7 @@ var promptbookVersionCommandParser = {
6698
6698
  * Note: `$` is used to indicate that this function mutates given `pipelineJson`
6699
6699
  */
6700
6700
  $applyToPipelineJson: function (command, $pipelineJson) {
6701
+ // TODO: Warn if the version is overridden
6701
6702
  $pipelineJson.promptbookVersion = command.promptbookVersion;
6702
6703
  },
6703
6704
  /**
@@ -7518,7 +7519,7 @@ function pipelineStringToJsonSync(pipelineString) {
7518
7519
  var $pipelineJson = {
7519
7520
  title: undefined /* <- Note: [🍙] Putting here placeholder to keep `title` on top at final JSON */,
7520
7521
  pipelineUrl: undefined /* <- Note: Putting here placeholder to keep `pipelineUrl` on top at final JSON */,
7521
- promptbookVersion: PROMPTBOOK_VERSION,
7522
+ promptbookVersion: undefined /* <- Note: By default no explicit version */,
7522
7523
  description: undefined /* <- Note: [🍙] Putting here placeholder to keep `description` on top at final JSON */,
7523
7524
  parameters: [],
7524
7525
  templates: [],
@@ -7809,7 +7810,7 @@ function pipelineStringToJsonSync(pipelineString) {
7809
7810
  return $asDeeplyFrozenSerializableJson('pipelineJson', $pipelineJson);
7810
7811
  }
7811
7812
  /**
7812
- * TODO: !!!! Warn if used only sync version
7813
+ * TODO:[main] !!!! Warn if used only sync version
7813
7814
  * TODO: [🚞] Report here line/column of error
7814
7815
  * TODO: Use spaceTrim more effectively
7815
7816
  * TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
@@ -8314,7 +8315,7 @@ function isSerializableAsJson(value) {
8314
8315
  }
8315
8316
  }
8316
8317
  /**
8317
- * TODO: [🧠] !!! In-memory cache of same values to prevent multiple checks
8318
+ * TODO: [🧠][main] !!! In-memory cache of same values to prevent multiple checks
8318
8319
  * TODO: [🧠][💺] Can be done this on type-level?
8319
8320
  */
8320
8321
 
@@ -9175,7 +9176,7 @@ function initializeMakeCommand(program) {
9175
9176
  });
9176
9177
  }
9177
9178
  /**
9178
- * TODO: [🥃] !!! Allow `ptbk make` without configuring any llm tools
9179
+ * TODO: [🥃][main] !!! Allow `ptbk make` without configuring any llm tools
9179
9180
  * TODO: Maybe remove this command - "about" command should be enough?
9180
9181
  * TODO: [0] DRY Javascript and typescript - Maybe make ONLY typescript and for javascript just remove types
9181
9182
  * Note: [🟡] This code should never be published outside of `@promptbook/cli`
@@ -9593,7 +9594,7 @@ var RemoteLlmExecutionTools = /** @class */ (function () {
9593
9594
  socket.on('connect', function () {
9594
9595
  resolve(socket);
9595
9596
  });
9596
- // TODO: !!!! Better timeout handling
9597
+ // TODO:[main] !!!! Better timeout handling
9597
9598
  setTimeout(function () {
9598
9599
  reject(new Error("Timeout while connecting to ".concat(_this.options.remoteUrl)));
9599
9600
  }, CONNECTION_TIMEOUT_MS);
@@ -9773,11 +9774,11 @@ var ANTHROPIC_CLAUDE_MODELS = $asDeeplyFrozenSerializableJson('ANTHROPIC_CLAUDE_
9773
9774
  output: computeUsage("$2.40 / 1M tokens"),
9774
9775
  },
9775
9776
  },
9776
- // TODO: !!! Claude 1 and 2 has also completion versions - ask Hoagy
9777
+ // TODO:[main] !!! Claude 1 and 2 has also completion versions - ask Hoagy
9777
9778
  ]);
9778
9779
  /**
9779
9780
  * Note: [🤖] Add models of new variant
9780
- * TODO: [🧠] !!! Add embedding models OR Anthropic has only chat+completion models?
9781
+ * TODO: [🧠][main] !!! Add embedding models OR Anthropic has only chat+completion models?
9781
9782
  * TODO: [🧠] Some mechanism to propagate unsureness
9782
9783
  * TODO: [🧠][👮‍♀️] Put here more info like description, isVision, trainingDateCutoff, languages, strengths ( Top-level performance, intelligence, fluency, and understanding), contextWindow,...
9783
9784
  * TODO: [🎰] Some mechanism to auto-update available models
@@ -10133,8 +10134,8 @@ var createAnthropicClaudeExecutionTools = Object.assign(function (options) {
10133
10134
  className: 'AnthropicClaudeExecutionTools',
10134
10135
  });
10135
10136
  /**
10136
- * TODO: [🧠] !!!! Make anonymous this with all LLM providers
10137
- * TODO: [🧠][🧱] !!!! Maybe change all `new AnthropicClaudeExecutionTools` -> `createAnthropicClaudeExecutionTools` in manual
10137
+ * TODO: [🧠][main] !!!! Make anonymous this with all LLM providers
10138
+ * TODO: [🧠][🧱][main] !!!! Maybe change all `new AnthropicClaudeExecutionTools` -> `createAnthropicClaudeExecutionTools` in manual
10138
10139
  * TODO: [🧠] Maybe auto-detect usage in browser and determine default value of `isProxied`
10139
10140
  * TODO: [🦺] Is there some way how to put `packageName` and `className` on top and function definition on bottom?
10140
10141
  * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
@@ -10512,6 +10513,7 @@ var OPENAI_MODELS = $asDeeplyFrozenSerializableJson('OPENAI_MODELS', [
10512
10513
  prompt: computeUsage("$5.00 / 1M tokens"),
10513
10514
  output: computeUsage("$15.00 / 1M tokens"),
10514
10515
  },
10516
+ //TODO:[main] !!!!!! Add gpt-4o-mini-2024-07-18 and all others to be up to date
10515
10517
  },
10516
10518
  /**/
10517
10519
  /**/
@@ -10526,6 +10528,51 @@ var OPENAI_MODELS = $asDeeplyFrozenSerializableJson('OPENAI_MODELS', [
10526
10528
  },
10527
10529
  /**/
10528
10530
  /**/
10531
+ {
10532
+ modelVariant: 'CHAT',
10533
+ modelTitle: 'o1-preview',
10534
+ modelName: 'o1-preview',
10535
+ pricing: {
10536
+ prompt: computeUsage("$15.00 / 1M tokens"),
10537
+ output: computeUsage("$60.00 / 1M tokens"),
10538
+ },
10539
+ },
10540
+ /**/
10541
+ /**/
10542
+ {
10543
+ modelVariant: 'CHAT',
10544
+ modelTitle: 'o1-preview-2024-09-12',
10545
+ modelName: 'o1-preview-2024-09-12',
10546
+ // <- TODO:[main] !!!!!! Some better system to organize theese date suffixes and versions
10547
+ pricing: {
10548
+ prompt: computeUsage("$15.00 / 1M tokens"),
10549
+ output: computeUsage("$60.00 / 1M tokens"),
10550
+ },
10551
+ },
10552
+ /**/
10553
+ /**/
10554
+ {
10555
+ modelVariant: 'CHAT',
10556
+ modelTitle: 'o1-mini',
10557
+ modelName: 'o1-mini',
10558
+ pricing: {
10559
+ prompt: computeUsage("$3.00 / 1M tokens"),
10560
+ output: computeUsage("$12.00 / 1M tokens"),
10561
+ },
10562
+ },
10563
+ /**/
10564
+ /**/
10565
+ {
10566
+ modelVariant: 'CHAT',
10567
+ modelTitle: 'o1-mini-2024-09-12',
10568
+ modelName: 'o1-mini-2024-09-12',
10569
+ pricing: {
10570
+ prompt: computeUsage("$3.00 / 1M tokens"),
10571
+ output: computeUsage("$12.00 / 1M tokens"),
10572
+ },
10573
+ },
10574
+ /**/
10575
+ /**/
10529
10576
  {
10530
10577
  modelVariant: 'CHAT',
10531
10578
  modelTitle: 'gpt-3.5-turbo-16k-0613',
@@ -10614,7 +10661,7 @@ var AzureOpenAiExecutionTools = /** @class */ (function () {
10614
10661
  AzureOpenAiExecutionTools.prototype.listModels = function () {
10615
10662
  return __awaiter(this, void 0, void 0, function () {
10616
10663
  return __generator(this, function (_a) {
10617
- // TODO: !!! Do here some filtering which models are really available as deployment
10664
+ // TODO:[main] !!! Do here some filtering which models are really available as deployment
10618
10665
  // @see https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName/deployments?api-version=2023-05-01
10619
10666
  return [2 /*return*/, OPENAI_MODELS.map(function (_a) {
10620
10667
  var modelTitle = _a.modelTitle, modelName = _a.modelName, modelVariant = _a.modelVariant;
@@ -11305,7 +11352,7 @@ var OpenAiExecutionTools = /** @class */ (function () {
11305
11352
  * @public exported from `@promptbook/openai`
11306
11353
  */
11307
11354
  var createOpenAiExecutionTools = Object.assign(function (options) {
11308
- // TODO: [🧠] !!!! If browser, auto add `dangerouslyAllowBrowser`
11355
+ // TODO: [🧠][main] !!!! If browser, auto add `dangerouslyAllowBrowser`
11309
11356
  if (($isRunningInBrowser() || $isRunningInWebWorker()) && !options.dangerouslyAllowBrowser) {
11310
11357
  options = __assign(__assign({}, options), { dangerouslyAllowBrowser: true });
11311
11358
  }