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