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