@promptbook/cli 0.72.0-9 → 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.
Files changed (146) hide show
  1. package/README.md +36 -252
  2. package/esm/index.es.js +1015 -677
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/core.index.d.ts +24 -18
  5. package/esm/typings/src/_packages/node.index.d.ts +2 -0
  6. package/esm/typings/src/_packages/types.index.d.ts +18 -12
  7. package/esm/typings/src/_packages/utils.index.d.ts +2 -2
  8. package/esm/typings/src/collection/PipelineCollection.d.ts +1 -1
  9. package/esm/typings/src/collection/SimplePipelineCollection.d.ts +2 -2
  10. package/esm/typings/src/collection/collectionToJson.d.ts +1 -1
  11. package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +1 -1
  12. package/esm/typings/src/collection/constructors/createCollectionFromPromise.d.ts +1 -1
  13. package/esm/typings/src/commands/TEMPLATE/TemplateTypes.d.ts +1 -1
  14. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +5 -5
  15. package/esm/typings/src/config.d.ts +22 -15
  16. package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +3 -3
  17. package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +1 -1
  18. package/esm/typings/src/conversion/validation/_importPipeline.d.ts +1 -1
  19. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +2 -2
  20. package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +12 -0
  21. package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +11 -0
  22. package/esm/typings/src/executables/apps/locatePandoc.d.ts +11 -0
  23. package/esm/typings/src/executables/locateApp.d.ts +33 -0
  24. package/esm/typings/src/executables/locateApp.test.d.ts +1 -0
  25. package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +12 -0
  26. package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +12 -0
  27. package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +12 -0
  28. package/esm/typings/src/execution/EmbeddingVector.d.ts +1 -1
  29. package/esm/typings/src/execution/Executables.d.ts +18 -0
  30. package/esm/typings/src/execution/ExecutionTools.d.ts +9 -3
  31. package/esm/typings/src/execution/FilesystemTools.d.ts +1 -1
  32. package/esm/typings/src/execution/LlmExecutionTools.d.ts +2 -2
  33. package/esm/typings/src/execution/PipelineExecutorResult.d.ts +2 -2
  34. package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +3 -2
  35. package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts +29 -6
  36. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +2 -11
  37. package/esm/typings/src/execution/createPipelineExecutor/20-executeTemplate.d.ts +4 -13
  38. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +9 -14
  39. package/esm/typings/src/execution/createPipelineExecutor/{getSamplesForTemplate.d.ts → getExamplesForTemplate.d.ts} +1 -1
  40. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -3
  41. package/esm/typings/src/execution/utils/addUsage.d.ts +1 -1
  42. package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -1
  43. package/esm/typings/src/formats/_common/FormatDefinition.d.ts +4 -4
  44. package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +3 -3
  45. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForCli.d.ts +2 -2
  46. package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +1 -1
  47. package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +7 -0
  48. package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +4 -1
  49. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
  50. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +2 -2
  51. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  52. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
  53. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +2 -1
  54. package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +1 -1
  55. package/esm/typings/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -1
  56. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +1 -1
  57. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +1 -1
  58. package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +4 -5
  59. package/esm/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +1 -1
  60. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +0 -1
  61. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +2 -2
  62. package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +2 -2
  63. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  64. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +4 -4
  65. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Request.d.ts +15 -6
  66. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Response.d.ts +4 -4
  67. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Request.d.ts +6 -12
  68. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Response.d.ts +3 -3
  69. package/esm/typings/src/llm-providers/remote/interfaces/RemoteLlmExecutionToolsOptions.d.ts +9 -14
  70. package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +23 -8
  71. package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -1
  72. package/esm/typings/src/personas/preparePersona.d.ts +1 -1
  73. package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +4 -23
  74. package/esm/typings/src/prepare/isPipelinePrepared.d.ts +2 -2
  75. package/esm/typings/src/prepare/prepareTemplates.d.ts +2 -2
  76. package/esm/typings/src/scrapers/_common/Scraper.d.ts +2 -9
  77. package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +1 -1
  78. package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +2 -2
  79. package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +2 -2
  80. package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +2 -2
  81. package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +2 -2
  82. package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +1 -1
  83. package/esm/typings/src/scrapers/document/DocumentScraper.d.ts +2 -2
  84. package/esm/typings/src/scrapers/document/DocumentScraper.test.d.ts +1 -1
  85. package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
  86. package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -1
  87. package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +3 -3
  88. package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.test.d.ts +1 -1
  89. package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +1 -1
  90. package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -1
  91. package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +1 -1
  92. package/esm/typings/src/scrapers/markdown/MarkdownScraper.test.d.ts +1 -1
  93. package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +1 -1
  94. package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -1
  95. package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +2 -2
  96. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -1
  97. package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -1
  98. package/esm/typings/src/scrapers/website/WebsiteScraper.d.ts +6 -3
  99. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +1 -1
  100. package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -1
  101. package/esm/typings/src/scrapers/website/utils/createShowdownConverter.d.ts +7 -0
  102. package/esm/typings/src/scrapers/website/utils/createShowdownConverter.test.d.ts +1 -0
  103. package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
  104. package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +1 -1
  105. package/esm/typings/src/types/Arrayable.d.ts +1 -1
  106. package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +7 -0
  107. package/esm/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +4 -4
  108. package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +1 -1
  109. package/esm/typings/src/types/PipelineJson/ParameterJson.d.ts +2 -2
  110. package/esm/typings/src/types/PipelineJson/PersonaJson.d.ts +1 -1
  111. package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +1 -1
  112. package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +2 -2
  113. package/esm/typings/src/types/Prompt.d.ts +2 -1
  114. package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +1 -1
  115. package/esm/typings/src/types/typeAliases.d.ts +11 -8
  116. package/esm/typings/src/utils/$Register.d.ts +1 -1
  117. package/esm/typings/src/utils/FromtoItems.d.ts +1 -1
  118. package/esm/typings/src/utils/arrayableToArray.d.ts +1 -1
  119. package/esm/typings/src/utils/emojis.d.ts +1 -1
  120. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +4 -2
  121. package/esm/typings/src/utils/execCommand/$execCommandNormalizeOptions.d.ts +12 -0
  122. package/esm/typings/src/utils/execCommand/$execCommands.d.ts +1 -0
  123. package/esm/typings/src/utils/execCommand/ExecCommandOptions.d.ts +45 -0
  124. package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
  125. package/esm/typings/src/utils/files/isExecutable.d.ts +11 -0
  126. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -1
  127. package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +1 -1
  128. package/esm/typings/src/utils/normalization/IKeywords.d.ts +2 -2
  129. package/esm/typings/src/utils/normalization/parseKeywords.d.ts +2 -2
  130. package/esm/typings/src/utils/normalization/parseKeywordsFromString.d.ts +2 -2
  131. package/esm/typings/src/utils/normalization/searchKeywords.d.ts +2 -2
  132. package/esm/typings/src/utils/organization/TODO_USE.d.ts +1 -1
  133. package/esm/typings/src/utils/organization/keepUnused.d.ts +1 -1
  134. package/esm/typings/src/utils/random/$randomSeed.d.ts +1 -1
  135. package/esm/typings/src/utils/sets/intersection.d.ts +1 -1
  136. package/esm/typings/src/utils/sets/union.d.ts +1 -1
  137. package/esm/typings/src/utils/unwrapResult.d.ts +4 -4
  138. package/package.json +5 -3
  139. package/umd/index.umd.js +1016 -679
  140. package/umd/index.umd.js.map +1 -1
  141. package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorSettings.d.ts +0 -29
  142. package/esm/typings/src/scrapers/website/utils/markdownConverter.d.ts +0 -12
  143. package/esm/typings/src/utils/execCommand/IExecCommandOptions.d.ts +0 -23
  144. package/esm/typings/src/utils/execCommand/execCommandNormalizeOptions.d.ts +0 -10
  145. /package/esm/typings/src/{scrapers/website/WebsiteScraper.test.d.ts → executables/apps/locateLibreoffice.test.d.ts} +0 -0
  146. /package/esm/typings/src/{scrapers/website/utils/markdownConverter.test.d.ts → executables/apps/locatePandoc.test.d.ts} +0 -0
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Promptbook logo - cube with letters P and B](./other/design/logo-h1.png) Promptbook
4
4
 
5
- Supercharge your use of large language models
5
+ Build responsible, controlled and transparent applications on top of LLM models!
6
6
 
7
7
 
8
8
 
@@ -18,12 +18,10 @@ Supercharge your use of large language 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
- <blockquote style="color: #ff8811">
24
- <b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
25
- </blockquote>
26
-
27
25
 
28
26
 
29
27
  ## 📦 Package `@promptbook/cli`
@@ -107,260 +105,48 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
107
105
 
108
106
  ## 🤍 The Promptbook Whitepaper
109
107
 
108
+ 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.
110
109
 
111
-
112
- If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 2, 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.
113
-
114
- But often you will struggle with the limitations of LLMs, such as hallucinations, off-topic responses, poor quality output, language 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:
110
+ 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:
115
111
 
116
112
  1. **Fine-tune** the model to your specifications or even train your own.
117
113
  2. **Prompt-engineer** the prompt to the best shape you can achieve.
118
114
  3. Orchestrate **multiple prompts** in a [pipeline](https://github.com/webgptorg/promptbook/discussions/64) to get the best result.
119
115
 
120
- In all of these situations, but especially in 3., the Promptbook library can make your life easier.
116
+ In all of these situations, but especially in 3., the **✨ Promptbook can make your life waaaaaaaaaay easier**.
121
117
 
122
- - [**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.
123
- - 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.
124
- - **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.
125
- - 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.
118
+ - [**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).
119
+ - Book allows you to **focus on the business** logic without having to write code or deal with the technicalities of LLMs.
120
+ - **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.
121
+ - 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.
126
122
  - 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.
127
- - Promptbook has built in versioning. You can test multiple **A/B versions** of pipelines and see which one works best.
128
- - 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.
129
-
130
-
131
-
132
- ## 🧔 Pipeline _(for prompt-engeneers)_
133
-
134
- **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.
135
-
136
- - Multiple pipelines forms a **collection** which will handle core **know-how of your LLM application**.
137
- - Theese pipelines are designed such as they **can be written by non-programmers**.
138
-
139
-
140
-
141
- ### Sample:
142
-
143
- File `write-website-content.ptbk.md`:
144
-
145
-
146
-
147
-
148
-
149
- > # 🌍 Create website content
150
- >
151
- > Instructions for creating web page content.
152
- >
153
- > - PIPELINE URL https://promptbook.studio/webgpt/write-website-content.ptbk.md
154
- > - INPUT  PARAM `{rawTitle}` Automatically suggested a site name or empty text
155
- > - INPUT  PARAM `{rawAssigment}` Automatically generated site entry from image recognition
156
- > - OUTPUT PARAM `{websiteContent}` Web content
157
- > - OUTPUT PARAM `{keywords}` Keywords
158
- >
159
- > ## 👤 Specifying the assigment
160
- >
161
- > What is your web about?
162
- >
163
- > - DIALOG TEMPLATE
164
- >
165
- > ```
166
- > {rawAssigment}
167
- > ```
168
- >
169
- > `-> {assigment}` Website assignment and specification
170
- >
171
- > ## ✨ Improving the title
172
- >
173
- > - PERSONA Jane, Copywriter and Marketing Specialist.
174
- >
175
- > ```
176
- > As an experienced marketing specialist, you have been entrusted with improving the name of your client's business.
177
- >
178
- > A suggested name from a client:
179
- > "{rawTitle}"
180
- >
181
- > Assignment from customer:
182
- >
183
- > > {assigment}
184
- >
185
- > ## Instructions:
186
- >
187
- > - Write only one name suggestion
188
- > - The name will be used on the website, business cards, visuals, etc.
189
- > ```
190
- >
191
- > `-> {enhancedTitle}` Enhanced title
192
- >
193
- > ## 👤 Website title approval
194
- >
195
- > Is the title for your website okay?
196
- >
197
- > - DIALOG TEMPLATE
198
- >
199
- > ```
200
- > {enhancedTitle}
201
- > ```
202
- >
203
- > `-> {title}` Title for the website
204
- >
205
- > ## 🐰 Cunning subtitle
206
- >
207
- > - PERSONA Josh, a copywriter, tasked with creating a claim for the website.
208
- >
209
- > ```
210
- > As an experienced copywriter, you have been entrusted with creating a claim for the "{title}" web page.
211
- >
212
- > A website assignment from a customer:
213
- >
214
- > > {assigment}
215
- >
216
- > ## Instructions:
217
- >
218
- > - Write only one name suggestion
219
- > - Claim will be used on website, business cards, visuals, etc.
220
- > - Claim should be punchy, funny, original
221
- > ```
222
- >
223
- > `-> {claim}` Claim for the web
224
- >
225
- > ## 🚦 Keyword analysis
226
- >
227
- > - PERSONA Paul, extremely creative SEO specialist.
228
- >
229
- > ```
230
- > As an experienced SEO specialist, you have been entrusted with creating keywords for the website "{title}".
231
- >
232
- > Website assignment from the customer:
233
- >
234
- > > {assigment}
235
- >
236
- > ## Instructions:
237
- >
238
- > - Write a list of keywords
239
- > - Keywords are in basic form
240
- >
241
- > ## Example:
242
- >
243
- > - Ice cream
244
- > - Olomouc
245
- > - Quality
246
- > - Family
247
- > - Tradition
248
- > - Italy
249
- > - Craft
250
- >
251
- > ```
252
- >
253
- > `-> {keywords}` Keywords
254
- >
255
- > ## 🔗 Combine the beginning
256
- >
257
- > - SIMPLE TEMPLATE
258
- >
259
- > ```
260
- >
261
- > # {title}
262
- >
263
- > > {claim}
264
- >
265
- > ```
266
- >
267
- > `-> {contentBeginning}` Beginning of web content
268
- >
269
- > ## 🖋 Write the content
270
- >
271
- > - PERSONA Jane
272
- >
273
- > ```
274
- > As an experienced copywriter and web designer, you have been entrusted with creating text for a new website {title}.
275
- >
276
- > A website assignment from a customer:
277
- >
278
- > > {assigment}
279
- >
280
- > ## Instructions:
281
- >
282
- > - Text formatting is in Markdown
283
- > - Be concise and to the point
284
- > - Use keywords, but they should be naturally in the text
285
- > - This is the complete content of the page, so don't forget all the important information and elements the page should contain
286
- > - Use headings, bullets, text formatting
287
- >
288
- > ## Keywords:
289
- >
290
- > {keywords}
291
- >
292
- > ## Web Content:
293
- >
294
- > {contentBeginning}
295
- > ```
296
- >
297
- > `-> {contentBody}` Middle of the web content
298
- >
299
- > ## 🔗 Combine the content
300
- >
301
- > - SIMPLE TEMPLATE
302
- >
303
- > ```markdown
304
- > {contentBeginning}
305
- >
306
- > {contentBody}
307
- > ```
308
- >
309
- > `-> {websiteContent}`
310
-
311
-
312
-
313
- Following is the scheme how the promptbook above is executed:
314
-
315
- ```mermaid
316
- %% 🔮 Tip: Open this on GitHub or in the VSCode website to see the Mermaid graph visually
317
-
318
- flowchart LR
319
- subgraph "🌍 Create website content"
320
-
321
- direction TB
322
-
323
- input((Input)):::input
324
- templateSpecifyingTheAssigment(👤 Specifying the assigment)
325
- input--"{rawAssigment}"-->templateSpecifyingTheAssigment
326
- templateImprovingTheTitle(✨ Improving the title)
327
- input--"{rawTitle}"-->templateImprovingTheTitle
328
- templateSpecifyingTheAssigment--"{assigment}"-->templateImprovingTheTitle
329
- templateWebsiteTitleApproval(👤 Website title approval)
330
- templateImprovingTheTitle--"{enhancedTitle}"-->templateWebsiteTitleApproval
331
- templateCunningSubtitle(🐰 Cunning subtitle)
332
- templateWebsiteTitleApproval--"{title}"-->templateCunningSubtitle
333
- templateSpecifyingTheAssigment--"{assigment}"-->templateCunningSubtitle
334
- templateKeywordAnalysis(🚦 Keyword analysis)
335
- templateWebsiteTitleApproval--"{title}"-->templateKeywordAnalysis
336
- templateSpecifyingTheAssigment--"{assigment}"-->templateKeywordAnalysis
337
- templateCombineTheBeginning(🔗 Combine the beginning)
338
- templateWebsiteTitleApproval--"{title}"-->templateCombineTheBeginning
339
- templateCunningSubtitle--"{claim}"-->templateCombineTheBeginning
340
- templateWriteTheContent(🖋 Write the content)
341
- templateWebsiteTitleApproval--"{title}"-->templateWriteTheContent
342
- templateSpecifyingTheAssigment--"{assigment}"-->templateWriteTheContent
343
- templateKeywordAnalysis--"{keywords}"-->templateWriteTheContent
344
- templateCombineTheBeginning--"{contentBeginning}"-->templateWriteTheContent
345
- templateCombineTheContent(🔗 Combine the content)
346
- templateCombineTheBeginning--"{contentBeginning}"-->templateCombineTheContent
347
- templateWriteTheContent--"{contentBody}"-->templateCombineTheContent
348
-
349
- templateCombineTheContent--"{websiteContent}"-->output
350
- output((Output)):::output
351
-
352
- classDef input color: grey;
353
- classDef output color: grey;
354
-
355
- end;
356
- ```
123
+ - Versioning is build in. You can test multiple **A/B versions** of pipelines and see which one works best.
124
+ - 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.
125
+
126
+
127
+
128
+ ## 💙 Book language _(for prompt-engineer)_
129
+
130
+ 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.
357
131
 
358
- - [More template samples](./samples/pipelines/)
359
- - [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)
360
132
 
361
- _Note: We are using [postprocessing functions](#postprocessing-functions) like `unwrapResult` that can be used to postprocess the result._
362
133
 
363
- ## 📦 Packages
134
+ ```markdown
135
+ # 🌟 My first Book
136
+
137
+ - PERSONA Jane, marketing specialist with prior experience in writing articles about technology and artificial intelligence
138
+ - KNOWLEDGE https://ptbk.io
139
+ - KNOWLEDGE ./promptbook.pdf
140
+ - EXPECT MIN 1 Sentence
141
+ - EXPECT MAX 1 Paragraph
142
+
143
+ > 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.
144
+ > Look specifically at the impact of Promptbook on the AI industry.
145
+
146
+ -> {article}
147
+ ```
148
+
149
+ ## 📦 Packages _(for developers)_
364
150
 
365
151
  This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
366
152
  You can install all of them at once:
@@ -402,8 +188,6 @@ Or you can install them separately:
402
188
 
403
189
  The following glossary is used to clarify certain concepts:
404
190
 
405
-
406
-
407
191
  ### Core concepts
408
192
 
409
193
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
@@ -434,8 +218,8 @@ The following glossary is used to clarify certain concepts:
434
218
 
435
219
  ## 🔌 Usage in Typescript / Javascript
436
220
 
437
- - [Simple usage](./samples/usage/simple-script)
438
- - [Usage with client and remote server](./samples/usage/remote)
221
+ - [Simple usage](./examples/usage/simple-script)
222
+ - [Usage with client and remote server](./examples/usage/remote)
439
223
 
440
224
  ## ➕➖ When to use Promptbook?
441
225