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