@promptbook/documents 0.72.0 → 0.73.0

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.
package/README.md CHANGED
@@ -18,6 +18,8 @@ Build responsible, controlled and transparent applications on top of LLM models!
18
18
 
19
19
  ## ✨ New Features
20
20
 
21
+ - 💙 Working on [the **Book** language v1](https://github.com/webgptorg/book)
22
+ - 📚 Support of `.docx`, `.doc` and `.pdf` documents
21
23
  - ✨ **Support of [OpenAI o1 model](https://openai.com/o1/)**
22
24
 
23
25
 
@@ -49,11 +51,9 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
49
51
 
50
52
  ## 🤍 The Promptbook Whitepaper
51
53
 
52
-
53
-
54
54
  If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 3, or whatever, it doesn't matter how you integrate it. Whether it's calling a REST API directly, using the SDK, hardcoding the prompt into the source code, or importing a text file, the process remains the same.
55
55
 
56
- But often you will struggle with the **limitations of LLMs**, such as **hallucinations, off-topic responses, poor quality output, language and prompt drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w𝒆𝐢rd responses**. When this happens, you generally have three options:
56
+ But often you will struggle with the **limitations of LLMs**, such as **hallucinations, off-topic responses, poor quality output, language and prompt drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w𝒆𝐢rd resp0nses**. When this happens, you generally have three options:
57
57
 
58
58
  1. **Fine-tune** the model to your specifications or even train your own.
59
59
  2. **Prompt-engineer** the prompt to the best shape you can achieve.
@@ -61,248 +61,38 @@ But often you will struggle with the **limitations of LLMs**, such as **hallucin
61
61
 
62
62
  In all of these situations, but especially in 3., the **✨ Promptbook can make your life waaaaaaaaaay easier**.
63
63
 
64
- - [**Separates concerns**](https://github.com/webgptorg/promptbook/discussions/32) between prompt-engineer and programmer, between code files and prompt files, and between prompts and their execution logic.
65
- - Establishes a [**common format `.ptbk.md`**](https://github.com/webgptorg/promptbook/discussions/85) that can be used to describe your prompt business logic without having to write code or deal with the technicalities of LLMs.
66
- - **Forget** about **low-level details** like choosing the right model, tokens, context size, temperature, top-k, top-p, or kernel sampling. **Just write your intent** and [**persona**](https://github.com/webgptorg/promptbook/discussions/22) who should be responsible for the task and let the library do the rest.
67
- - Has built-in **orchestration** of [pipeline](https://github.com/webgptorg/promptbook/discussions/64) execution and many tools to make the process easier, more reliable, and more efficient, such as caching, [compilation+preparation](https://github.com/webgptorg/promptbook/discussions/78), [just-in-time fine-tuning](https://github.com/webgptorg/promptbook/discussions/33), [expectation-aware generation](https://github.com/webgptorg/promptbook/discussions/37), [agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39), and more.
64
+ - [**Separates concerns**](https://github.com/webgptorg/promptbook/discussions/32) between prompt-engineer and programmer, between code files and prompt files, and between prompts and their execution logic. For this purpose, it introduces a new language called [the **💙 Book**](https://github.com/webgptorg/book).
65
+ - Book allows you to **focus on the business** logic without having to write code or deal with the technicalities of LLMs.
66
+ - **Forget** about **low-level details** like choosing the right model, tokens, context size, `temperature`, `top-k`, `top-p`, or kernel sampling. **Just write your intent** and [**persona**](https://github.com/webgptorg/promptbook/discussions/22) who should be responsible for the task and let the library do the rest.
67
+ - We have built-in **orchestration** of [pipeline](https://github.com/webgptorg/promptbook/discussions/64) execution and many tools to make the process easier, more reliable, and more efficient, such as caching, [compilation+preparation](https://github.com/webgptorg/promptbook/discussions/78), [just-in-time fine-tuning](https://github.com/webgptorg/promptbook/discussions/33), [expectation-aware generation](https://github.com/webgptorg/promptbook/discussions/37), [agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39), and more.
68
68
  - Sometimes even the best prompts with the best framework like Promptbook `:)` can't avoid the problems. In this case, the library has built-in **[anomaly detection](https://github.com/webgptorg/promptbook/discussions/40) and logging** to help you find and fix the problems.
69
- - Promptbook has built in versioning. You can test multiple **A/B versions** of pipelines and see which one works best.
70
- - Promptbook is designed to do [**RAG** (Retrieval-Augmented Generation)](https://github.com/webgptorg/promptbook/discussions/41) and other advanced techniques. You can use **knowledge** to improve the quality of the output.
71
-
72
-
73
-
74
- ## 🧔 Pipeline _(for prompt-engeneers)_
75
-
76
- **P**romp**t** **b**oo**k** markdown file (or `.ptbk.md` file) is document that describes a **pipeline** - a series of prompts that are chained together to form somewhat reciepe for transforming natural language input.
77
-
78
- - Multiple pipelines forms a **collection** which will handle core **know-how of your LLM application**.
79
- - Theese pipelines are designed such as they **can be written by non-programmers**.
80
-
81
-
82
-
83
- ### Sample:
84
-
85
- File `write-website-content.ptbk.md`:
86
-
87
-
88
-
89
-
90
-
91
- > # 🌍 Create website content
92
- >
93
- > Instructions for creating web page content.
94
- >
95
- > - PIPELINE URL https://promptbook.studio/webgpt/write-website-content.ptbk.md
96
- > - INPUT  PARAM `{rawTitle}` Automatically suggested a site name or empty text
97
- > - INPUT  PARAM `{rawAssigment}` Automatically generated site entry from image recognition
98
- > - OUTPUT PARAM `{websiteContent}` Web content
99
- > - OUTPUT PARAM `{keywords}` Keywords
100
- >
101
- > ## 👤 Specifying the assigment
102
- >
103
- > What is your web about?
104
- >
105
- > - DIALOG TEMPLATE
106
- >
107
- > ```
108
- > {rawAssigment}
109
- > ```
110
- >
111
- > `-> {assigment}` Website assignment and specification
112
- >
113
- > ## ✨ Improving the title
114
- >
115
- > - PERSONA Jane, Copywriter and Marketing Specialist.
116
- >
117
- > ```
118
- > As an experienced marketing specialist, you have been entrusted with improving the name of your client's business.
119
- >
120
- > A suggested name from a client:
121
- > "{rawTitle}"
122
- >
123
- > Assignment from customer:
124
- >
125
- > > {assigment}
126
- >
127
- > ## Instructions:
128
- >
129
- > - Write only one name suggestion
130
- > - The name will be used on the website, business cards, visuals, etc.
131
- > ```
132
- >
133
- > `-> {enhancedTitle}` Enhanced title
134
- >
135
- > ## 👤 Website title approval
136
- >
137
- > Is the title for your website okay?
138
- >
139
- > - DIALOG TEMPLATE
140
- >
141
- > ```
142
- > {enhancedTitle}
143
- > ```
144
- >
145
- > `-> {title}` Title for the website
146
- >
147
- > ## 🐰 Cunning subtitle
148
- >
149
- > - PERSONA Josh, a copywriter, tasked with creating a claim for the website.
150
- >
151
- > ```
152
- > As an experienced copywriter, you have been entrusted with creating a claim for the "{title}" web page.
153
- >
154
- > A website assignment from a customer:
155
- >
156
- > > {assigment}
157
- >
158
- > ## Instructions:
159
- >
160
- > - Write only one name suggestion
161
- > - Claim will be used on website, business cards, visuals, etc.
162
- > - Claim should be punchy, funny, original
163
- > ```
164
- >
165
- > `-> {claim}` Claim for the web
166
- >
167
- > ## 🚦 Keyword analysis
168
- >
169
- > - PERSONA Paul, extremely creative SEO specialist.
170
- >
171
- > ```
172
- > As an experienced SEO specialist, you have been entrusted with creating keywords for the website "{title}".
173
- >
174
- > Website assignment from the customer:
175
- >
176
- > > {assigment}
177
- >
178
- > ## Instructions:
179
- >
180
- > - Write a list of keywords
181
- > - Keywords are in basic form
182
- >
183
- > ## Example:
184
- >
185
- > - Ice cream
186
- > - Olomouc
187
- > - Quality
188
- > - Family
189
- > - Tradition
190
- > - Italy
191
- > - Craft
192
- >
193
- > ```
194
- >
195
- > `-> {keywords}` Keywords
196
- >
197
- > ## 🔗 Combine the beginning
198
- >
199
- > - SIMPLE TEMPLATE
200
- >
201
- > ```
202
- >
203
- > # {title}
204
- >
205
- > > {claim}
206
- >
207
- > ```
208
- >
209
- > `-> {contentBeginning}` Beginning of web content
210
- >
211
- > ## 🖋 Write the content
212
- >
213
- > - PERSONA Jane
214
- >
215
- > ```
216
- > As an experienced copywriter and web designer, you have been entrusted with creating text for a new website {title}.
217
- >
218
- > A website assignment from a customer:
219
- >
220
- > > {assigment}
221
- >
222
- > ## Instructions:
223
- >
224
- > - Text formatting is in Markdown
225
- > - Be concise and to the point
226
- > - Use keywords, but they should be naturally in the text
227
- > - This is the complete content of the page, so don't forget all the important information and elements the page should contain
228
- > - Use headings, bullets, text formatting
229
- >
230
- > ## Keywords:
231
- >
232
- > {keywords}
233
- >
234
- > ## Web Content:
235
- >
236
- > {contentBeginning}
237
- > ```
238
- >
239
- > `-> {contentBody}` Middle of the web content
240
- >
241
- > ## 🔗 Combine the content
242
- >
243
- > - SIMPLE TEMPLATE
244
- >
245
- > ```markdown
246
- > {contentBeginning}
247
- >
248
- > {contentBody}
249
- > ```
250
- >
251
- > `-> {websiteContent}`
252
-
253
-
254
-
255
- Following is the scheme how the promptbook above is executed:
256
-
257
- ```mermaid
258
- %% 🔮 Tip: Open this on GitHub or in the VSCode website to see the Mermaid graph visually
259
-
260
- flowchart LR
261
- subgraph "🌍 Create website content"
262
-
263
- direction TB
264
-
265
- input((Input)):::input
266
- templateSpecifyingTheAssigment(👤 Specifying the assigment)
267
- input--"{rawAssigment}"-->templateSpecifyingTheAssigment
268
- templateImprovingTheTitle(✨ Improving the title)
269
- input--"{rawTitle}"-->templateImprovingTheTitle
270
- templateSpecifyingTheAssigment--"{assigment}"-->templateImprovingTheTitle
271
- templateWebsiteTitleApproval(👤 Website title approval)
272
- templateImprovingTheTitle--"{enhancedTitle}"-->templateWebsiteTitleApproval
273
- templateCunningSubtitle(🐰 Cunning subtitle)
274
- templateWebsiteTitleApproval--"{title}"-->templateCunningSubtitle
275
- templateSpecifyingTheAssigment--"{assigment}"-->templateCunningSubtitle
276
- templateKeywordAnalysis(🚦 Keyword analysis)
277
- templateWebsiteTitleApproval--"{title}"-->templateKeywordAnalysis
278
- templateSpecifyingTheAssigment--"{assigment}"-->templateKeywordAnalysis
279
- templateCombineTheBeginning(🔗 Combine the beginning)
280
- templateWebsiteTitleApproval--"{title}"-->templateCombineTheBeginning
281
- templateCunningSubtitle--"{claim}"-->templateCombineTheBeginning
282
- templateWriteTheContent(🖋 Write the content)
283
- templateWebsiteTitleApproval--"{title}"-->templateWriteTheContent
284
- templateSpecifyingTheAssigment--"{assigment}"-->templateWriteTheContent
285
- templateKeywordAnalysis--"{keywords}"-->templateWriteTheContent
286
- templateCombineTheBeginning--"{contentBeginning}"-->templateWriteTheContent
287
- templateCombineTheContent(🔗 Combine the content)
288
- templateCombineTheBeginning--"{contentBeginning}"-->templateCombineTheContent
289
- templateWriteTheContent--"{contentBody}"-->templateCombineTheContent
290
-
291
- templateCombineTheContent--"{websiteContent}"-->output
292
- output((Output)):::output
293
-
294
- classDef input color: grey;
295
- classDef output color: grey;
296
-
297
- end;
298
- ```
69
+ - Versioning is build in. You can test multiple **A/B versions** of pipelines and see which one works best.
70
+ - Promptbook is designed to use [**RAG** (Retrieval-Augmented Generation)](https://github.com/webgptorg/promptbook/discussions/41) and other advanced techniques to bring the context of your business to generic LLM. You can use **knowledge** to improve the quality of the output.
71
+
72
+
73
+
74
+ ## 💙 Book language _(for prompt-engineer)_
75
+
76
+ Promptbook [pipelines](https://github.com/webgptorg/promptbook/discussions/64) are written in markdown-like language called [Book](https://github.com/webgptorg/book). It is designed to be understandable by non-programmers and non-technical people.
299
77
 
300
- - [More template samples](./samples/pipelines/)
301
- - [Read more about `.ptbk.md` file format here](https://github.com/webgptorg/promptbook/discussions/categories/concepts?discussions_q=is%3Aopen+label%3A.ptbk.md+category%3AConcepts)
302
78
 
303
- _Note: We are using [postprocessing functions](#postprocessing-functions) like `unwrapResult` that can be used to postprocess the result._
304
79
 
305
- ## 📦 Packages
80
+ ```markdown
81
+ # 🌟 My first Book
82
+
83
+ - PERSONA Jane, marketing specialist with prior experience in writing articles about technology and artificial intelligence
84
+ - KNOWLEDGE https://ptbk.io
85
+ - KNOWLEDGE ./promptbook.pdf
86
+ - EXPECT MIN 1 Sentence
87
+ - EXPECT MAX 1 Paragraph
88
+
89
+ > Write an article about the future of artificial intelligence in the next 10 years and how metalanguages will change the way AI is used in the world.
90
+ > Look specifically at the impact of Promptbook on the AI industry.
91
+
92
+ -> {article}
93
+ ```
94
+
95
+ ## 📦 Packages _(for developers)_
306
96
 
307
97
  This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
308
98
  You can install all of them at once:
@@ -344,8 +134,6 @@ Or you can install them separately:
344
134
 
345
135
  The following glossary is used to clarify certain concepts:
346
136
 
347
-
348
-
349
137
  ### Core concepts
350
138
 
351
139
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
@@ -376,8 +164,8 @@ The following glossary is used to clarify certain concepts:
376
164
 
377
165
  ## 🔌 Usage in Typescript / Javascript
378
166
 
379
- - [Simple usage](./samples/usage/simple-script)
380
- - [Usage with client and remote server](./samples/usage/remote)
167
+ - [Simple usage](./examples/usage/simple-script)
168
+ - [Usage with client and remote server](./examples/usage/remote)
381
169
 
382
170
  ## ➕➖ When to use Promptbook?
383
171
 
package/esm/index.es.js CHANGED
@@ -15,7 +15,7 @@ import { unparse, parse } from 'papaparse';
15
15
  /**
16
16
  * The version of the Promptbook library
17
17
  */
18
- var PROMPTBOOK_VERSION = '0.72.0-34';
18
+ var PROMPTBOOK_VERSION = '0.72.0';
19
19
  // TODO: [main] !!!! List here all the versions and annotate + put into script
20
20
 
21
21
  /*! *****************************************************************************
@@ -405,10 +405,10 @@ var RESERVED_PARAMETER_NAMES = $asDeeplyFrozenSerializableJson('RESERVED_PARAMET
405
405
  'content',
406
406
  'context',
407
407
  'knowledge',
408
- 'samples',
408
+ 'examples',
409
409
  'modelName',
410
410
  'currentDate',
411
- // <- TODO: !!!!! list here all command names
411
+ // <- TODO: list here all command names
412
412
  // <- TODO: Add more like 'date', 'modelName',...
413
413
  // <- TODO: Add [emoji] + instructions ACRY when adding new reserved parameter
414
414
  ]);
@@ -1237,7 +1237,7 @@ function getScraperIntermediateSource(source, options) {
1237
1237
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
1238
1238
  */
1239
1239
 
1240
- 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"}];
1240
+ 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## Example\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"}];
1241
1241
 
1242
1242
  /**
1243
1243
  * Prettify the html code
@@ -1881,7 +1881,7 @@ function validatePipelineCore(pipeline) {
1881
1881
  }
1882
1882
  }
1883
1883
  /**
1884
- * TODO: !!!!! [🧞‍♀️] Do not allow joker + foreach
1884
+ * TODO: !! [🧞‍♀️] Do not allow joker + foreach
1885
1885
  * TODO: [🧠] Work with promptbookVersion
1886
1886
  * TODO: Use here some json-schema, Zod or something similar and change it to:
1887
1887
  * > /**
@@ -1893,7 +1893,7 @@ function validatePipelineCore(pipeline) {
1893
1893
  * > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
1894
1894
  */
1895
1895
  /**
1896
- * TODO: [🧳][main] !!!! Validate that all samples match expectations
1896
+ * TODO: [🧳][main] !!!! Validate that all examples match expectations
1897
1897
  * TODO: [🧳][🐝][main] !!!! Validate that knowledge is valid (non-void)
1898
1898
  * TODO: [🧳][main] !!!! Validate that persona can be used only with CHAT variant
1899
1899
  * TODO: [🧳][main] !!!! Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
@@ -2263,12 +2263,12 @@ function isPipelinePrepared(pipeline) {
2263
2263
  return true;
2264
2264
  }
2265
2265
  /**
2266
- * TODO: [🔃][main] !!!!! If the pipeline was prepared with different version or different set of models, prepare it once again
2266
+ * TODO: [🔃][main] !! If the pipeline was prepared with different version or different set of models, prepare it once again
2267
2267
  * TODO: [🐠] Maybe base this on `makeValidator`
2268
2268
  * TODO: [🧊] Pipeline can be partially prepared, this should return true ONLY if fully prepared
2269
2269
  * TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
2270
2270
  * - [🏍] ? Is context in each template
2271
- * - [♨] Are samples prepared
2271
+ * - [♨] Are examples prepared
2272
2272
  * - [♨] Are templates prepared
2273
2273
  */
2274
2274
 
@@ -2973,7 +2973,7 @@ function preparePersona(personaDescription, tools, options) {
2973
2973
  });
2974
2974
  }
2975
2975
  /**
2976
- * TODO: [🔃][main] !!!!! If the persona was prepared with different version or different set of models, prepare it once again
2976
+ * TODO: [🔃][main] !! If the persona was prepared with different version or different set of models, prepare it once again
2977
2977
  * TODO: [🏢] !! Check validity of `modelName` in pipeline
2978
2978
  * TODO: [🏢] !! Check validity of `systemMessage` in pipeline
2979
2979
  * TODO: [🏢] !! Check validity of `temperature` in pipeline
@@ -3577,7 +3577,7 @@ function prepareTemplates(pipeline, tools, options) {
3577
3577
  case 0:
3578
3578
  _a = options.maxParallelCount, maxParallelCount = _a === void 0 ? DEFAULT_MAX_PARALLEL_COUNT : _a;
3579
3579
  templates = pipeline.templates, parameters = pipeline.parameters, knowledgePiecesCount = pipeline.knowledgePiecesCount;
3580
- // TODO: [main] !!!!! Apply samples to each template (if missing and is for the template defined)
3580
+ // TODO: [main] !! Apply examples to each template (if missing and is for the template defined)
3581
3581
  TODO_USE(parameters);
3582
3582
  templatesPrepared = new Array(templates.length);
3583
3583
  return [4 /*yield*/, forEachAsync(templates, { maxParallelCount: maxParallelCount /* <- TODO: [🪂] When there are subtasks, this maximul limit can be broken */ }, function (template, index) { return __awaiter(_this, void 0, void 0, function () {
@@ -3607,7 +3607,7 @@ function prepareTemplates(pipeline, tools, options) {
3607
3607
  /**
3608
3608
  * TODO: [🧠] Add context to each template (if missing)
3609
3609
  * TODO: [🧠] What is better name `prepareTemplate` or `prepareTemplateAndParameters`
3610
- * TODO: [♨][main] !!! Prepare index the samples and maybe templates
3610
+ * TODO: [♨][main] !!! Prepare index the examples and maybe templates
3611
3611
  * TODO: Write tests for `preparePipeline`
3612
3612
  * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
3613
3613
  * TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
@@ -5137,7 +5137,7 @@ function getKnowledgeForTemplate(options) {
5137
5137
  var preparedPipeline, template;
5138
5138
  return __generator(this, function (_a) {
5139
5139
  preparedPipeline = options.preparedPipeline, template = options.template;
5140
- // TODO: [♨] Implement Better - use real index and keyword search from `template` and {samples}
5140
+ // TODO: [♨] Implement Better - use real index and keyword search from `template` and {examples}
5141
5141
  TODO_USE(template);
5142
5142
  return [2 /*return*/, preparedPipeline.knowledgePieces.map(function (_a) {
5143
5143
  var content = _a.content;
@@ -5152,7 +5152,7 @@ function getKnowledgeForTemplate(options) {
5152
5152
  *
5153
5153
  * @private internal utility of `createPipelineExecutor`
5154
5154
  */
5155
- function getSamplesForTemplate(template) {
5155
+ function getExamplesForTemplate(template) {
5156
5156
  return __awaiter(this, void 0, void 0, function () {
5157
5157
  return __generator(this, function (_a) {
5158
5158
  // TODO: [♨] Implement Better - use real index and keyword search
@@ -5169,7 +5169,7 @@ function getSamplesForTemplate(template) {
5169
5169
  */
5170
5170
  function getReservedParametersForTemplate(options) {
5171
5171
  return __awaiter(this, void 0, void 0, function () {
5172
- var preparedPipeline, template, pipelineIdentification, context, knowledge, samples, currentDate, modelName, reservedParameters, _loop_1, RESERVED_PARAMETER_NAMES_1, RESERVED_PARAMETER_NAMES_1_1, parameterName;
5172
+ var preparedPipeline, template, pipelineIdentification, context, knowledge, examples, currentDate, modelName, reservedParameters, _loop_1, RESERVED_PARAMETER_NAMES_1, RESERVED_PARAMETER_NAMES_1_1, parameterName;
5173
5173
  var e_1, _a;
5174
5174
  return __generator(this, function (_b) {
5175
5175
  switch (_b.label) {
@@ -5181,16 +5181,16 @@ function getReservedParametersForTemplate(options) {
5181
5181
  return [4 /*yield*/, getKnowledgeForTemplate({ preparedPipeline: preparedPipeline, template: template })];
5182
5182
  case 2:
5183
5183
  knowledge = _b.sent();
5184
- return [4 /*yield*/, getSamplesForTemplate(template)];
5184
+ return [4 /*yield*/, getExamplesForTemplate(template)];
5185
5185
  case 3:
5186
- samples = _b.sent();
5186
+ examples = _b.sent();
5187
5187
  currentDate = new Date().toISOString();
5188
5188
  modelName = RESERVED_PARAMETER_MISSING_VALUE;
5189
5189
  reservedParameters = {
5190
5190
  content: RESERVED_PARAMETER_RESTRICTED,
5191
5191
  context: context,
5192
5192
  knowledge: knowledge,
5193
- samples: samples,
5193
+ examples: examples,
5194
5194
  currentDate: currentDate,
5195
5195
  modelName: modelName,
5196
5196
  };
@@ -5849,7 +5849,7 @@ var MarkdownScraper = /** @class */ (function () {
5849
5849
  outputParameters = result.outputParameters;
5850
5850
  knowledgePiecesRaw = outputParameters.knowledgePieces;
5851
5851
  knowledgeTextPieces = (knowledgePiecesRaw || '').split('\n---\n');
5852
- // <- TODO: [main] !!!!! Smarter split and filter out empty pieces
5852
+ // <- TODO: [main] !! Smarter split and filter out empty pieces
5853
5853
  if (isVerbose) {
5854
5854
  console.info('knowledgeTextPieces:', knowledgeTextPieces);
5855
5855
  }