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