@promptbook/node 0.92.0 → 0.94.0-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 +143 -83
- package/esm/index.es.js +6 -1
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +3 -3
- package/umd/index.umd.js +6 -1
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<!-- ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten -->
|
|
2
2
|
|
|
3
|
-
# ✨ Promptbook
|
|
3
|
+
# ✨ Promptbook: AI apps in plain Language
|
|
4
|
+
|
|
5
|
+
Write AI applications using plain human language across multiple models and platforms.
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
|
|
@@ -8,20 +10,24 @@
|
|
|
8
10
|
[ Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
|
|
9
11
|
[ Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
|
|
10
12
|
[](https://snyk.io/test/github/webgptorg/promptbook)
|
|
13
|
+
[](https://github.com/webgptorg/promptbook/actions)
|
|
14
|
+
[](https://coveralls.io/github/webgptorg/promptbook?branch=main)
|
|
11
15
|
[](https://github.com/webgptorg/promptbook/issues)
|
|
12
16
|
|
|
13
17
|
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
19
|
## 🌟 New Features
|
|
18
20
|
|
|
19
|
-
-
|
|
20
|
-
- 🐳
|
|
21
|
-
-
|
|
22
|
-
-
|
|
21
|
+
- 💡 VS Code support for `.book` files with syntax highlighting and IntelliSense
|
|
22
|
+
- 🐳 Official Docker image (`hejny/promptbook`) for seamless containerized usage
|
|
23
|
+
- 🔥 Native support for OpenAI `o3-mini`, GPT-4 and other leading LLMs
|
|
24
|
+
- 🔍 DeepSeek integration for advanced knowledge search
|
|
25
|
+
|
|
23
26
|
|
|
24
27
|
|
|
28
|
+
<blockquote style="color: #ff8811">
|
|
29
|
+
<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>.
|
|
30
|
+
</blockquote>
|
|
25
31
|
|
|
26
32
|
## 📦 Package `@promptbook/node`
|
|
27
33
|
|
|
@@ -127,65 +133,92 @@ Hello world examples:
|
|
|
127
133
|
- [Hello world in Node.js](https://github.com/webgptorg/hello-world-node-js)
|
|
128
134
|
- [Hello world in Next.js](https://github.com/webgptorg/hello-world-next-js)
|
|
129
135
|
|
|
136
|
+
### 🌐 Community & Social Media
|
|
130
137
|
|
|
138
|
+
Join our growing community of developers and users:
|
|
131
139
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
140
|
+
<table>
|
|
141
|
+
<thead>
|
|
142
|
+
<tr>
|
|
143
|
+
<th>Platform</th>
|
|
144
|
+
<th>Description</th>
|
|
145
|
+
</tr>
|
|
146
|
+
</thead>
|
|
147
|
+
<tbody>
|
|
148
|
+
<tr>
|
|
149
|
+
<td><a href="https://discord.gg/x3QWNaa89N">💬 Discord</a></td>
|
|
150
|
+
<td>Join our active developer community for discussions and support</td>
|
|
151
|
+
</tr>
|
|
152
|
+
<tr>
|
|
153
|
+
<td><a href="https://github.com/webgptorg/promptbook/discussions">🗣️ GitHub Discussions</a></td>
|
|
154
|
+
<td>Technical discussions, feature requests, and community Q&A</td>
|
|
155
|
+
</tr>
|
|
156
|
+
<tr>
|
|
157
|
+
<td><a href="https://linkedin.com/company/promptbook">👔 LinkedIn</a></td>
|
|
158
|
+
<td>Professional updates and industry insights</td>
|
|
159
|
+
</tr>
|
|
160
|
+
<tr>
|
|
161
|
+
<td><a href="https://www.facebook.com/61560776453536">📱 Facebook</a></td>
|
|
162
|
+
<td>General announcements and community engagement</td>
|
|
163
|
+
</tr>
|
|
164
|
+
<tr>
|
|
165
|
+
<td><a href="https://ptbk.io">🔗 ptbk.io</a></td>
|
|
166
|
+
<td>Official landing page with project information</td>
|
|
167
|
+
</tr>
|
|
168
|
+
</tbody>
|
|
169
|
+
</table>
|
|
151
170
|
|
|
171
|
+
### 🖼️ Product & Brand Channels
|
|
152
172
|
|
|
153
|
-
|
|
154
|
-
- [Facebook `Promptujeme`](https://www.facebook.com/promptujeme/)
|
|
173
|
+
#### Promptbook.studio
|
|
155
174
|
|
|
156
|
-
|
|
175
|
+
<table>
|
|
176
|
+
<tbody>
|
|
177
|
+
<tr>
|
|
178
|
+
<td><a href="https://www.instagram.com/promptbook.studio/">📸 Instagram @promptbook.studio</a></td>
|
|
179
|
+
<td>Visual updates, UI showcases, and design inspiration</td>
|
|
180
|
+
</tr>
|
|
181
|
+
|
|
182
|
+
</tbody>
|
|
183
|
+
</table>
|
|
157
184
|
|
|
158
|
-
_/Sub-brand for images and graphics generated via Promptbook prompting/_
|
|
159
185
|
|
|
160
|
-
- [Instagram `@promptbook.city`](https://www.instagram.com/promptbook.city/)
|
|
161
|
-
- [Facebook `Promptbook City`](https://www.facebook.com/61565718625569)
|
|
162
186
|
|
|
163
187
|
|
|
164
188
|
|
|
165
189
|
|
|
190
|
+
## 📘 Book Language Blueprint
|
|
166
191
|
|
|
192
|
+
_A concise, Markdown-based DSL for crafting AI workflows and automations._
|
|
167
193
|
|
|
168
|
-
|
|
194
|
+
---
|
|
169
195
|
|
|
196
|
+
### 📑 Table of Contents
|
|
170
197
|
|
|
198
|
+
- [Introduction](#introduction)
|
|
199
|
+
- [Example](#example)
|
|
200
|
+
- [1. What: Workflows, Tasks & Parameters](#1-what-workflows-tasks--parameters)
|
|
201
|
+
- [2. Who: Personas](#2-who-personas)
|
|
202
|
+
- [3. How: Knowledge, Instruments & Actions](#3-how-knowledge-instruments-and-actions)
|
|
203
|
+
- [General Principles](#general-principles)
|
|
171
204
|
|
|
172
|
-
|
|
205
|
+
### Introduction
|
|
173
206
|
|
|
174
|
-
Book is a language that
|
|
207
|
+
Book is a Markdown-based language that simplifies the creation of AI applications, workflows, and automations. With human-readable commands, you can define inputs, outputs, personas, knowledge sources, and actions—without needing model-specific details.
|
|
175
208
|
|
|
176
209
|
### Example
|
|
177
210
|
|
|
178
|
-
```
|
|
179
|
-
# 🌟 My
|
|
211
|
+
```book
|
|
212
|
+
# 🌟 My First Book
|
|
180
213
|
|
|
181
214
|
- BOOK VERSION 1.0.0
|
|
182
215
|
- URL https://promptbook.studio/hello.book
|
|
183
216
|
- INPUT PARAMETER {topic}
|
|
184
217
|
- OUTPUT PARAMETER {article}
|
|
185
218
|
|
|
186
|
-
# Write an
|
|
219
|
+
# Write an Article
|
|
187
220
|
|
|
188
|
-
- PERSONA Jane, marketing specialist with prior experience in
|
|
221
|
+
- PERSONA Jane, marketing specialist with prior experience in tech and AI writing
|
|
189
222
|
- KNOWLEDGE https://wikipedia.org/
|
|
190
223
|
- KNOWLEDGE ./journalist-ethics.pdf
|
|
191
224
|
- EXPECT MIN 1 Sentence
|
|
@@ -193,20 +226,20 @@ Book is a language that can be used to write AI applications, agents, workflows,
|
|
|
193
226
|
|
|
194
227
|
> Write an article about {topic}
|
|
195
228
|
|
|
196
|
-
|
|
229
|
+
→ {article}
|
|
197
230
|
```
|
|
198
231
|
|
|
199
232
|
Each part of the book defines one of 3 circles:
|
|
200
233
|
|
|
201
|
-
### **What:** Workflows, Tasks and Parameters
|
|
234
|
+
### **1. What:** Workflows, Tasks and Parameters
|
|
202
235
|
|
|
203
|
-
What work needs to be done. Each book defines a [workflow
|
|
236
|
+
What work needs to be done. Each book defines a [workflow _(scenario or pipeline)_](https://github.com/webgptorg/promptbook/discussions/88), which is one or more tasks. Each workflow has a fixed input and output. For example, you have a book that generates an article from a topic. Once it generates an article about AI, once about marketing, once about cooking. The workflow (= your AI program) is the same, only the input and output change.
|
|
204
237
|
|
|
205
238
|
**Related commands:**
|
|
206
239
|
|
|
207
240
|
- [PARAMETER](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PARAMETER.md)
|
|
208
241
|
|
|
209
|
-
### **Who:** Personas
|
|
242
|
+
### **2. Who:** Personas
|
|
210
243
|
|
|
211
244
|
Who does the work. Each task is performed by a persona. A persona is a description of your virtual employee. It is a higher abstraction than the model, tokens, temperature, top-k, top-p and other model parameters.
|
|
212
245
|
|
|
@@ -220,7 +253,7 @@ Personas can have access to different knowledge, tools and actions. They can als
|
|
|
220
253
|
|
|
221
254
|
|
|
222
255
|
|
|
223
|
-
### **How:** Knowledge, Instruments and Actions
|
|
256
|
+
### **3. How:** Knowledge, Instruments and Actions
|
|
224
257
|
|
|
225
258
|
The resources used by the personas are used to do the work.
|
|
226
259
|
|
|
@@ -230,7 +263,7 @@ The resources used by the personas are used to do the work.
|
|
|
230
263
|
- [INSTRUMENT](https://github.com/webgptorg/promptbook/blob/main/documents/commands/INSTRUMENT.md) for real-time data like time, location, weather, stock prices, searching the internet, calculations, etc.
|
|
231
264
|
- [ACTION](https://github.com/webgptorg/promptbook/blob/main/documents/commands/ACTION.md) for actions like sending emails, creating files, ending a workflow, etc.
|
|
232
265
|
|
|
233
|
-
### General
|
|
266
|
+
### General Principles
|
|
234
267
|
|
|
235
268
|
Book language is based on markdown. It is subset of markdown. It is designed to be easy to read and write. It is designed to be understandable by both humans and machines and without specific knowledge of the language.
|
|
236
269
|
|
|
@@ -244,6 +277,10 @@ But unlike programming languages, it is designed to be understandable by non-pro
|
|
|
244
277
|
|
|
245
278
|
|
|
246
279
|
|
|
280
|
+
## 📚 Documentation
|
|
281
|
+
|
|
282
|
+
See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
|
|
283
|
+
|
|
247
284
|
## 🔒 Security
|
|
248
285
|
|
|
249
286
|
For information on reporting security vulnerabilities, see our [Security Policy](./SECURITY.md).
|
|
@@ -324,25 +361,56 @@ _Note: This section is not complete dictionary, more list of general AI / LLM te
|
|
|
324
361
|
- [🤼 Personas](https://github.com/webgptorg/promptbook/discussions/22)
|
|
325
362
|
- [⭕ Parameters](https://github.com/webgptorg/promptbook/discussions/83)
|
|
326
363
|
- [🚀 Pipeline execution](https://github.com/webgptorg/promptbook/discussions/84)
|
|
327
|
-
- [🧪 Expectations](https://github.com/webgptorg/promptbook/discussions/30)
|
|
328
|
-
- [✂️ Postprocessing](https://github.com/webgptorg/promptbook/discussions/31)
|
|
329
|
-
- [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29)
|
|
330
|
-
- [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32)
|
|
364
|
+
- [🧪 Expectations](https://github.com/webgptorg/promptbook/discussions/30) - Define what outputs should look like and how they're validated
|
|
365
|
+
- [✂️ Postprocessing](https://github.com/webgptorg/promptbook/discussions/31) - How outputs are refined after generation
|
|
366
|
+
- [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29) - The human-friendly way to think about text generation
|
|
367
|
+
- [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32) - How Book language organizes different aspects of AI workflows
|
|
331
368
|
|
|
332
|
-
|
|
369
|
+
### Advanced concepts
|
|
370
|
+
|
|
371
|
+
<table>
|
|
372
|
+
<tr>
|
|
373
|
+
<th>Data & Knowledge Management</th>
|
|
374
|
+
<th>Pipeline Control</th>
|
|
375
|
+
</tr>
|
|
376
|
+
<tr>
|
|
377
|
+
<td>
|
|
378
|
+
<ul>
|
|
379
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/41">📚 Knowledge (RAG)</a> - Retrieve and use external information</li>
|
|
380
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/54">📽 Media handling</a> - Working with images, audio, video, spreadsheets</li>
|
|
381
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/40">🔴 Anomaly detection</a> - Identifying unusual patterns or outputs</li>
|
|
382
|
+
</ul>
|
|
383
|
+
</td>
|
|
384
|
+
<td>
|
|
385
|
+
<ul>
|
|
386
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/89">🌏 Remote server</a> - Executing workflows on remote infrastructure</li>
|
|
387
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/66">🃏 Jokers (conditions)</a> - Adding conditional logic to workflows</li>
|
|
388
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/35">🔳 Metaprompting</a> - Creating prompts that generate other prompts</li>
|
|
389
|
+
</ul>
|
|
390
|
+
</td>
|
|
391
|
+
</tr>
|
|
392
|
+
<tr>
|
|
393
|
+
<th>Language & Output Control</th>
|
|
394
|
+
<th>Advanced Generation</th>
|
|
395
|
+
</tr>
|
|
396
|
+
<tr>
|
|
397
|
+
<td>
|
|
398
|
+
<ul>
|
|
399
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/53">🌏 Linguistically typed languages</a> - Type systems for natural language</li>
|
|
400
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/42">🌍 Auto-Translations</a> - Automatic multilingual support</li>
|
|
401
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/39">👮 Agent adversary expectations</a> - Safety and control mechanisms</li>
|
|
402
|
+
</ul>
|
|
403
|
+
</td>
|
|
404
|
+
<td>
|
|
405
|
+
<ul>
|
|
406
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/37">🔙 Expectation-aware generation</a> - Outputs that meet defined criteria</li>
|
|
407
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/33">⏳ Just-in-time fine-tuning</a> - Dynamic model adaptation</li>
|
|
408
|
+
</ul>
|
|
409
|
+
</td>
|
|
410
|
+
</tr>
|
|
411
|
+
</table>
|
|
333
412
|
|
|
334
|
-
|
|
335
|
-
- [🌏 Remote server](https://github.com/webgptorg/promptbook/discussions/89)
|
|
336
|
-
- [🃏 Jokers (conditions)](https://github.com/webgptorg/promptbook/discussions/66)
|
|
337
|
-
- [🔳 Metaprompting](https://github.com/webgptorg/promptbook/discussions/35)
|
|
338
|
-
- [🌏 Linguistically typed languages](https://github.com/webgptorg/promptbook/discussions/53)
|
|
339
|
-
- [🌍 Auto-Translations](https://github.com/webgptorg/promptbook/discussions/42)
|
|
340
|
-
- [📽 Images, audio, video, spreadsheets](https://github.com/webgptorg/promptbook/discussions/54)
|
|
341
|
-
- [🔙 Expectation-aware generation](https://github.com/webgptorg/promptbook/discussions/37)
|
|
342
|
-
- [⏳ Just-in-time fine-tuning](https://github.com/webgptorg/promptbook/discussions/33)
|
|
343
|
-
- [🔴 Anomaly detection](https://github.com/webgptorg/promptbook/discussions/40)
|
|
344
|
-
- [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
|
|
345
|
-
- [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
|
|
413
|
+
<p align="center"><a href="https://github.com/webgptorg/promptbook/discussions/categories/concepts">🔍 View more concepts</a></p>
|
|
346
414
|
|
|
347
415
|
|
|
348
416
|
|
|
@@ -397,36 +465,28 @@ If you have a question [start a discussion](https://github.com/webgptorg/promptb
|
|
|
397
465
|
- [❔ Is Promptbook using RAG _(Retrieval-Augmented Generation)_?](https://github.com/webgptorg/promptbook/discussions/123)
|
|
398
466
|
- [❔ Is Promptbook using function calling?](https://github.com/webgptorg/promptbook/discussions/124)
|
|
399
467
|
|
|
400
|
-
##
|
|
468
|
+
## 📅 Changelog
|
|
401
469
|
|
|
402
470
|
See [CHANGELOG.md](./CHANGELOG.md)
|
|
403
471
|
|
|
404
472
|
## 📜 License
|
|
405
473
|
|
|
406
|
-
|
|
474
|
+
This project is licensed under [BUSL 1.1](./LICENSE.md).
|
|
407
475
|
|
|
408
|
-
##
|
|
476
|
+
## 🤝 Contributing
|
|
409
477
|
|
|
410
|
-
See [
|
|
478
|
+
We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
411
479
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
<div style="display: flex; align-items: center; gap: 20px;">
|
|
415
|
-
|
|
416
|
-
<a href="https://promptbook.studio/">
|
|
417
|
-
<img src="./design/promptbook-studio-logo.png" alt="Partner 3" height="70">
|
|
418
|
-
</a>
|
|
419
|
-
|
|
420
|
-
<a href="https://technologickainkubace.org/en/about-technology-incubation/about-the-project/">
|
|
421
|
-
<img src="./other/partners/CI-Technology-Incubation.png" alt="Technology Incubation" height="70">
|
|
422
|
-
</a>
|
|
423
|
-
|
|
424
|
-
</div>
|
|
480
|
+
You can also ⭐ star the project, [follow us on GitHub](https://github.com/hejny) or [various other social networks](https://www.pavolhejny.com/contact/).We are open to [pull requests, feedback, and suggestions](./CONTRIBUTING.md).
|
|
425
481
|
|
|
426
|
-
##
|
|
482
|
+
## 🆘 Support & Community
|
|
427
483
|
|
|
428
|
-
|
|
484
|
+
Need help with Book language? We're here for you!
|
|
429
485
|
|
|
430
|
-
|
|
486
|
+
- 💬 [Join our Discord community](https://discord.gg/x3QWNaa89N) for real-time support
|
|
487
|
+
- 📝 [Browse our GitHub discussions](https://github.com/webgptorg/promptbook/discussions) for FAQs and community knowledge
|
|
488
|
+
- 🐛 [Report issues](https://github.com/webgptorg/book/issues) for bugs or feature requests
|
|
489
|
+
- 📚 Visit [ptbk.io](https://ptbk.io) for more resources and documentation
|
|
490
|
+
- 📧 Contact us directly through the channels listed in our [signpost](./SIGNPOST.md)
|
|
431
491
|
|
|
432
|
-
|
|
492
|
+
We welcome contributions and feedback to make Book language better for everyone!
|
package/esm/index.es.js
CHANGED
|
@@ -30,7 +30,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
30
30
|
* @generated
|
|
31
31
|
* @see https://github.com/webgptorg/promptbook
|
|
32
32
|
*/
|
|
33
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.
|
|
33
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.94.0-0';
|
|
34
34
|
/**
|
|
35
35
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
36
36
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -4447,6 +4447,11 @@ async function executeTask(options) {
|
|
|
4447
4447
|
const jokerParameterNames = currentTask.jokerParameterNames || [];
|
|
4448
4448
|
const preparedContent = (currentTask.preparedContent || '{content}').split('{content}').join(currentTask.content);
|
|
4449
4449
|
// <- TODO: [🍵] Use here `templateParameters` to replace {websiteContent} with option to ignore missing parameters
|
|
4450
|
+
await onProgress({
|
|
4451
|
+
outputParameters: {
|
|
4452
|
+
[currentTask.resultingParameterName]: '',
|
|
4453
|
+
},
|
|
4454
|
+
});
|
|
4450
4455
|
const resultString = await executeFormatSubvalues({
|
|
4451
4456
|
jokerParameterNames,
|
|
4452
4457
|
priority,
|