@promptbook/node 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 +490 -186
  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 +6 -4
  139. package/umd/index.umd.js +491 -187
  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/node`
@@ -54,260 +52,48 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
54
52
 
55
53
  ## 🤍 The Promptbook Whitepaper
56
54
 
55
+ 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.
57
56
 
58
-
59
- 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.
60
-
61
- 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:
57
+ 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:
62
58
 
63
59
  1. **Fine-tune** the model to your specifications or even train your own.
64
60
  2. **Prompt-engineer** the prompt to the best shape you can achieve.
65
61
  3. Orchestrate **multiple prompts** in a [pipeline](https://github.com/webgptorg/promptbook/discussions/64) to get the best result.
66
62
 
67
- In all of these situations, but especially in 3., the Promptbook library can make your life easier.
63
+ In all of these situations, but especially in 3., the **✨ Promptbook can make your life waaaaaaaaaay easier**.
68
64
 
69
- - [**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.
70
- - 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.
71
- - **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.
72
- - 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.
65
+ - [**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).
66
+ - Book allows you to **focus on the business** logic without having to write code or deal with the technicalities of LLMs.
67
+ - **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.
68
+ - 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.
73
69
  - 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.
74
- - Promptbook has built in versioning. You can test multiple **A/B versions** of pipelines and see which one works best.
75
- - 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.
76
-
77
-
78
-
79
- ## 🧔 Pipeline _(for prompt-engeneers)_
80
-
81
- **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.
82
-
83
- - Multiple pipelines forms a **collection** which will handle core **know-how of your LLM application**.
84
- - Theese pipelines are designed such as they **can be written by non-programmers**.
85
-
86
-
87
-
88
- ### Sample:
89
-
90
- File `write-website-content.ptbk.md`:
91
-
92
-
93
-
94
-
95
-
96
- > # 🌍 Create website content
97
- >
98
- > Instructions for creating web page content.
99
- >
100
- > - PIPELINE URL https://promptbook.studio/webgpt/write-website-content.ptbk.md
101
- > - INPUT  PARAM `{rawTitle}` Automatically suggested a site name or empty text
102
- > - INPUT  PARAM `{rawAssigment}` Automatically generated site entry from image recognition
103
- > - OUTPUT PARAM `{websiteContent}` Web content
104
- > - OUTPUT PARAM `{keywords}` Keywords
105
- >
106
- > ## 👤 Specifying the assigment
107
- >
108
- > What is your web about?
109
- >
110
- > - DIALOG TEMPLATE
111
- >
112
- > ```
113
- > {rawAssigment}
114
- > ```
115
- >
116
- > `-> {assigment}` Website assignment and specification
117
- >
118
- > ## ✨ Improving the title
119
- >
120
- > - PERSONA Jane, Copywriter and Marketing Specialist.
121
- >
122
- > ```
123
- > As an experienced marketing specialist, you have been entrusted with improving the name of your client's business.
124
- >
125
- > A suggested name from a client:
126
- > "{rawTitle}"
127
- >
128
- > Assignment from customer:
129
- >
130
- > > {assigment}
131
- >
132
- > ## Instructions:
133
- >
134
- > - Write only one name suggestion
135
- > - The name will be used on the website, business cards, visuals, etc.
136
- > ```
137
- >
138
- > `-> {enhancedTitle}` Enhanced title
139
- >
140
- > ## 👤 Website title approval
141
- >
142
- > Is the title for your website okay?
143
- >
144
- > - DIALOG TEMPLATE
145
- >
146
- > ```
147
- > {enhancedTitle}
148
- > ```
149
- >
150
- > `-> {title}` Title for the website
151
- >
152
- > ## 🐰 Cunning subtitle
153
- >
154
- > - PERSONA Josh, a copywriter, tasked with creating a claim for the website.
155
- >
156
- > ```
157
- > As an experienced copywriter, you have been entrusted with creating a claim for the "{title}" web page.
158
- >
159
- > A website assignment from a customer:
160
- >
161
- > > {assigment}
162
- >
163
- > ## Instructions:
164
- >
165
- > - Write only one name suggestion
166
- > - Claim will be used on website, business cards, visuals, etc.
167
- > - Claim should be punchy, funny, original
168
- > ```
169
- >
170
- > `-> {claim}` Claim for the web
171
- >
172
- > ## 🚦 Keyword analysis
173
- >
174
- > - PERSONA Paul, extremely creative SEO specialist.
175
- >
176
- > ```
177
- > As an experienced SEO specialist, you have been entrusted with creating keywords for the website "{title}".
178
- >
179
- > Website assignment from the customer:
180
- >
181
- > > {assigment}
182
- >
183
- > ## Instructions:
184
- >
185
- > - Write a list of keywords
186
- > - Keywords are in basic form
187
- >
188
- > ## Example:
189
- >
190
- > - Ice cream
191
- > - Olomouc
192
- > - Quality
193
- > - Family
194
- > - Tradition
195
- > - Italy
196
- > - Craft
197
- >
198
- > ```
199
- >
200
- > `-> {keywords}` Keywords
201
- >
202
- > ## 🔗 Combine the beginning
203
- >
204
- > - SIMPLE TEMPLATE
205
- >
206
- > ```
207
- >
208
- > # {title}
209
- >
210
- > > {claim}
211
- >
212
- > ```
213
- >
214
- > `-> {contentBeginning}` Beginning of web content
215
- >
216
- > ## 🖋 Write the content
217
- >
218
- > - PERSONA Jane
219
- >
220
- > ```
221
- > As an experienced copywriter and web designer, you have been entrusted with creating text for a new website {title}.
222
- >
223
- > A website assignment from a customer:
224
- >
225
- > > {assigment}
226
- >
227
- > ## Instructions:
228
- >
229
- > - Text formatting is in Markdown
230
- > - Be concise and to the point
231
- > - Use keywords, but they should be naturally in the text
232
- > - This is the complete content of the page, so don't forget all the important information and elements the page should contain
233
- > - Use headings, bullets, text formatting
234
- >
235
- > ## Keywords:
236
- >
237
- > {keywords}
238
- >
239
- > ## Web Content:
240
- >
241
- > {contentBeginning}
242
- > ```
243
- >
244
- > `-> {contentBody}` Middle of the web content
245
- >
246
- > ## 🔗 Combine the content
247
- >
248
- > - SIMPLE TEMPLATE
249
- >
250
- > ```markdown
251
- > {contentBeginning}
252
- >
253
- > {contentBody}
254
- > ```
255
- >
256
- > `-> {websiteContent}`
257
-
258
-
259
-
260
- Following is the scheme how the promptbook above is executed:
261
-
262
- ```mermaid
263
- %% 🔮 Tip: Open this on GitHub or in the VSCode website to see the Mermaid graph visually
264
-
265
- flowchart LR
266
- subgraph "🌍 Create website content"
267
-
268
- direction TB
269
-
270
- input((Input)):::input
271
- templateSpecifyingTheAssigment(👤 Specifying the assigment)
272
- input--"{rawAssigment}"-->templateSpecifyingTheAssigment
273
- templateImprovingTheTitle(✨ Improving the title)
274
- input--"{rawTitle}"-->templateImprovingTheTitle
275
- templateSpecifyingTheAssigment--"{assigment}"-->templateImprovingTheTitle
276
- templateWebsiteTitleApproval(👤 Website title approval)
277
- templateImprovingTheTitle--"{enhancedTitle}"-->templateWebsiteTitleApproval
278
- templateCunningSubtitle(🐰 Cunning subtitle)
279
- templateWebsiteTitleApproval--"{title}"-->templateCunningSubtitle
280
- templateSpecifyingTheAssigment--"{assigment}"-->templateCunningSubtitle
281
- templateKeywordAnalysis(🚦 Keyword analysis)
282
- templateWebsiteTitleApproval--"{title}"-->templateKeywordAnalysis
283
- templateSpecifyingTheAssigment--"{assigment}"-->templateKeywordAnalysis
284
- templateCombineTheBeginning(🔗 Combine the beginning)
285
- templateWebsiteTitleApproval--"{title}"-->templateCombineTheBeginning
286
- templateCunningSubtitle--"{claim}"-->templateCombineTheBeginning
287
- templateWriteTheContent(🖋 Write the content)
288
- templateWebsiteTitleApproval--"{title}"-->templateWriteTheContent
289
- templateSpecifyingTheAssigment--"{assigment}"-->templateWriteTheContent
290
- templateKeywordAnalysis--"{keywords}"-->templateWriteTheContent
291
- templateCombineTheBeginning--"{contentBeginning}"-->templateWriteTheContent
292
- templateCombineTheContent(🔗 Combine the content)
293
- templateCombineTheBeginning--"{contentBeginning}"-->templateCombineTheContent
294
- templateWriteTheContent--"{contentBody}"-->templateCombineTheContent
295
-
296
- templateCombineTheContent--"{websiteContent}"-->output
297
- output((Output)):::output
298
-
299
- classDef input color: grey;
300
- classDef output color: grey;
301
-
302
- end;
303
- ```
70
+ - Versioning is build in. You can test multiple **A/B versions** of pipelines and see which one works best.
71
+ - 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.
72
+
73
+
74
+
75
+ ## 💙 Book language _(for prompt-engineer)_
76
+
77
+ 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.
304
78
 
305
- - [More template samples](./samples/pipelines/)
306
- - [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)
307
79
 
308
- _Note: We are using [postprocessing functions](#postprocessing-functions) like `unwrapResult` that can be used to postprocess the result._
309
80
 
310
- ## 📦 Packages
81
+ ```markdown
82
+ # 🌟 My first Book
83
+
84
+ - PERSONA Jane, marketing specialist with prior experience in writing articles about technology and artificial intelligence
85
+ - KNOWLEDGE https://ptbk.io
86
+ - KNOWLEDGE ./promptbook.pdf
87
+ - EXPECT MIN 1 Sentence
88
+ - EXPECT MAX 1 Paragraph
89
+
90
+ > 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.
91
+ > Look specifically at the impact of Promptbook on the AI industry.
92
+
93
+ -> {article}
94
+ ```
95
+
96
+ ## 📦 Packages _(for developers)_
311
97
 
312
98
  This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
313
99
  You can install all of them at once:
@@ -349,8 +135,6 @@ Or you can install them separately:
349
135
 
350
136
  The following glossary is used to clarify certain concepts:
351
137
 
352
-
353
-
354
138
  ### Core concepts
355
139
 
356
140
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
@@ -381,8 +165,8 @@ The following glossary is used to clarify certain concepts:
381
165
 
382
166
  ## 🔌 Usage in Typescript / Javascript
383
167
 
384
- - [Simple usage](./samples/usage/simple-script)
385
- - [Usage with client and remote server](./samples/usage/remote)
168
+ - [Simple usage](./examples/usage/simple-script)
169
+ - [Usage with client and remote server](./examples/usage/remote)
386
170
 
387
171
  ## ➕➖ When to use Promptbook?
388
172