@promptbook/markdown-utils 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 +2 -2
- 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/markdown-utils`
|
|
27
33
|
|
|
@@ -123,65 +129,92 @@ Hello world examples:
|
|
|
123
129
|
- [Hello world in Node.js](https://github.com/webgptorg/hello-world-node-js)
|
|
124
130
|
- [Hello world in Next.js](https://github.com/webgptorg/hello-world-next-js)
|
|
125
131
|
|
|
132
|
+
### 🌐 Community & Social Media
|
|
126
133
|
|
|
134
|
+
Join our growing community of developers and users:
|
|
127
135
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
136
|
+
<table>
|
|
137
|
+
<thead>
|
|
138
|
+
<tr>
|
|
139
|
+
<th>Platform</th>
|
|
140
|
+
<th>Description</th>
|
|
141
|
+
</tr>
|
|
142
|
+
</thead>
|
|
143
|
+
<tbody>
|
|
144
|
+
<tr>
|
|
145
|
+
<td><a href="https://discord.gg/x3QWNaa89N">💬 Discord</a></td>
|
|
146
|
+
<td>Join our active developer community for discussions and support</td>
|
|
147
|
+
</tr>
|
|
148
|
+
<tr>
|
|
149
|
+
<td><a href="https://github.com/webgptorg/promptbook/discussions">🗣️ GitHub Discussions</a></td>
|
|
150
|
+
<td>Technical discussions, feature requests, and community Q&A</td>
|
|
151
|
+
</tr>
|
|
152
|
+
<tr>
|
|
153
|
+
<td><a href="https://linkedin.com/company/promptbook">👔 LinkedIn</a></td>
|
|
154
|
+
<td>Professional updates and industry insights</td>
|
|
155
|
+
</tr>
|
|
156
|
+
<tr>
|
|
157
|
+
<td><a href="https://www.facebook.com/61560776453536">📱 Facebook</a></td>
|
|
158
|
+
<td>General announcements and community engagement</td>
|
|
159
|
+
</tr>
|
|
160
|
+
<tr>
|
|
161
|
+
<td><a href="https://ptbk.io">🔗 ptbk.io</a></td>
|
|
162
|
+
<td>Official landing page with project information</td>
|
|
163
|
+
</tr>
|
|
164
|
+
</tbody>
|
|
165
|
+
</table>
|
|
147
166
|
|
|
167
|
+
### 🖼️ Product & Brand Channels
|
|
148
168
|
|
|
149
|
-
|
|
150
|
-
- [Facebook `Promptujeme`](https://www.facebook.com/promptujeme/)
|
|
169
|
+
#### Promptbook.studio
|
|
151
170
|
|
|
152
|
-
|
|
171
|
+
<table>
|
|
172
|
+
<tbody>
|
|
173
|
+
<tr>
|
|
174
|
+
<td><a href="https://www.instagram.com/promptbook.studio/">📸 Instagram @promptbook.studio</a></td>
|
|
175
|
+
<td>Visual updates, UI showcases, and design inspiration</td>
|
|
176
|
+
</tr>
|
|
177
|
+
|
|
178
|
+
</tbody>
|
|
179
|
+
</table>
|
|
153
180
|
|
|
154
|
-
_/Sub-brand for images and graphics generated via Promptbook prompting/_
|
|
155
181
|
|
|
156
|
-
- [Instagram `@promptbook.city`](https://www.instagram.com/promptbook.city/)
|
|
157
|
-
- [Facebook `Promptbook City`](https://www.facebook.com/61565718625569)
|
|
158
182
|
|
|
159
183
|
|
|
160
184
|
|
|
161
185
|
|
|
186
|
+
## 📘 Book Language Blueprint
|
|
162
187
|
|
|
188
|
+
_A concise, Markdown-based DSL for crafting AI workflows and automations._
|
|
163
189
|
|
|
164
|
-
|
|
190
|
+
---
|
|
165
191
|
|
|
192
|
+
### 📑 Table of Contents
|
|
166
193
|
|
|
194
|
+
- [Introduction](#introduction)
|
|
195
|
+
- [Example](#example)
|
|
196
|
+
- [1. What: Workflows, Tasks & Parameters](#1-what-workflows-tasks--parameters)
|
|
197
|
+
- [2. Who: Personas](#2-who-personas)
|
|
198
|
+
- [3. How: Knowledge, Instruments & Actions](#3-how-knowledge-instruments-and-actions)
|
|
199
|
+
- [General Principles](#general-principles)
|
|
167
200
|
|
|
168
|
-
|
|
201
|
+
### Introduction
|
|
169
202
|
|
|
170
|
-
Book is a language that
|
|
203
|
+
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.
|
|
171
204
|
|
|
172
205
|
### Example
|
|
173
206
|
|
|
174
|
-
```
|
|
175
|
-
# 🌟 My
|
|
207
|
+
```book
|
|
208
|
+
# 🌟 My First Book
|
|
176
209
|
|
|
177
210
|
- BOOK VERSION 1.0.0
|
|
178
211
|
- URL https://promptbook.studio/hello.book
|
|
179
212
|
- INPUT PARAMETER {topic}
|
|
180
213
|
- OUTPUT PARAMETER {article}
|
|
181
214
|
|
|
182
|
-
# Write an
|
|
215
|
+
# Write an Article
|
|
183
216
|
|
|
184
|
-
- PERSONA Jane, marketing specialist with prior experience in
|
|
217
|
+
- PERSONA Jane, marketing specialist with prior experience in tech and AI writing
|
|
185
218
|
- KNOWLEDGE https://wikipedia.org/
|
|
186
219
|
- KNOWLEDGE ./journalist-ethics.pdf
|
|
187
220
|
- EXPECT MIN 1 Sentence
|
|
@@ -189,20 +222,20 @@ Book is a language that can be used to write AI applications, agents, workflows,
|
|
|
189
222
|
|
|
190
223
|
> Write an article about {topic}
|
|
191
224
|
|
|
192
|
-
|
|
225
|
+
→ {article}
|
|
193
226
|
```
|
|
194
227
|
|
|
195
228
|
Each part of the book defines one of 3 circles:
|
|
196
229
|
|
|
197
|
-
### **What:** Workflows, Tasks and Parameters
|
|
230
|
+
### **1. What:** Workflows, Tasks and Parameters
|
|
198
231
|
|
|
199
|
-
What work needs to be done. Each book defines a [workflow
|
|
232
|
+
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.
|
|
200
233
|
|
|
201
234
|
**Related commands:**
|
|
202
235
|
|
|
203
236
|
- [PARAMETER](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PARAMETER.md)
|
|
204
237
|
|
|
205
|
-
### **Who:** Personas
|
|
238
|
+
### **2. Who:** Personas
|
|
206
239
|
|
|
207
240
|
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.
|
|
208
241
|
|
|
@@ -216,7 +249,7 @@ Personas can have access to different knowledge, tools and actions. They can als
|
|
|
216
249
|
|
|
217
250
|
|
|
218
251
|
|
|
219
|
-
### **How:** Knowledge, Instruments and Actions
|
|
252
|
+
### **3. How:** Knowledge, Instruments and Actions
|
|
220
253
|
|
|
221
254
|
The resources used by the personas are used to do the work.
|
|
222
255
|
|
|
@@ -226,7 +259,7 @@ The resources used by the personas are used to do the work.
|
|
|
226
259
|
- [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.
|
|
227
260
|
- [ACTION](https://github.com/webgptorg/promptbook/blob/main/documents/commands/ACTION.md) for actions like sending emails, creating files, ending a workflow, etc.
|
|
228
261
|
|
|
229
|
-
### General
|
|
262
|
+
### General Principles
|
|
230
263
|
|
|
231
264
|
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.
|
|
232
265
|
|
|
@@ -240,6 +273,10 @@ But unlike programming languages, it is designed to be understandable by non-pro
|
|
|
240
273
|
|
|
241
274
|
|
|
242
275
|
|
|
276
|
+
## 📚 Documentation
|
|
277
|
+
|
|
278
|
+
See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
|
|
279
|
+
|
|
243
280
|
## 🔒 Security
|
|
244
281
|
|
|
245
282
|
For information on reporting security vulnerabilities, see our [Security Policy](./SECURITY.md).
|
|
@@ -320,25 +357,56 @@ _Note: This section is not complete dictionary, more list of general AI / LLM te
|
|
|
320
357
|
- [🤼 Personas](https://github.com/webgptorg/promptbook/discussions/22)
|
|
321
358
|
- [⭕ Parameters](https://github.com/webgptorg/promptbook/discussions/83)
|
|
322
359
|
- [🚀 Pipeline execution](https://github.com/webgptorg/promptbook/discussions/84)
|
|
323
|
-
- [🧪 Expectations](https://github.com/webgptorg/promptbook/discussions/30)
|
|
324
|
-
- [✂️ Postprocessing](https://github.com/webgptorg/promptbook/discussions/31)
|
|
325
|
-
- [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29)
|
|
326
|
-
- [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32)
|
|
360
|
+
- [🧪 Expectations](https://github.com/webgptorg/promptbook/discussions/30) - Define what outputs should look like and how they're validated
|
|
361
|
+
- [✂️ Postprocessing](https://github.com/webgptorg/promptbook/discussions/31) - How outputs are refined after generation
|
|
362
|
+
- [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29) - The human-friendly way to think about text generation
|
|
363
|
+
- [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32) - How Book language organizes different aspects of AI workflows
|
|
327
364
|
|
|
328
|
-
|
|
365
|
+
### Advanced concepts
|
|
366
|
+
|
|
367
|
+
<table>
|
|
368
|
+
<tr>
|
|
369
|
+
<th>Data & Knowledge Management</th>
|
|
370
|
+
<th>Pipeline Control</th>
|
|
371
|
+
</tr>
|
|
372
|
+
<tr>
|
|
373
|
+
<td>
|
|
374
|
+
<ul>
|
|
375
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/41">📚 Knowledge (RAG)</a> - Retrieve and use external information</li>
|
|
376
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/54">📽 Media handling</a> - Working with images, audio, video, spreadsheets</li>
|
|
377
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/40">🔴 Anomaly detection</a> - Identifying unusual patterns or outputs</li>
|
|
378
|
+
</ul>
|
|
379
|
+
</td>
|
|
380
|
+
<td>
|
|
381
|
+
<ul>
|
|
382
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/89">🌏 Remote server</a> - Executing workflows on remote infrastructure</li>
|
|
383
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/66">🃏 Jokers (conditions)</a> - Adding conditional logic to workflows</li>
|
|
384
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/35">🔳 Metaprompting</a> - Creating prompts that generate other prompts</li>
|
|
385
|
+
</ul>
|
|
386
|
+
</td>
|
|
387
|
+
</tr>
|
|
388
|
+
<tr>
|
|
389
|
+
<th>Language & Output Control</th>
|
|
390
|
+
<th>Advanced Generation</th>
|
|
391
|
+
</tr>
|
|
392
|
+
<tr>
|
|
393
|
+
<td>
|
|
394
|
+
<ul>
|
|
395
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/53">🌏 Linguistically typed languages</a> - Type systems for natural language</li>
|
|
396
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/42">🌍 Auto-Translations</a> - Automatic multilingual support</li>
|
|
397
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/39">👮 Agent adversary expectations</a> - Safety and control mechanisms</li>
|
|
398
|
+
</ul>
|
|
399
|
+
</td>
|
|
400
|
+
<td>
|
|
401
|
+
<ul>
|
|
402
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/37">🔙 Expectation-aware generation</a> - Outputs that meet defined criteria</li>
|
|
403
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/33">⏳ Just-in-time fine-tuning</a> - Dynamic model adaptation</li>
|
|
404
|
+
</ul>
|
|
405
|
+
</td>
|
|
406
|
+
</tr>
|
|
407
|
+
</table>
|
|
329
408
|
|
|
330
|
-
|
|
331
|
-
- [🌏 Remote server](https://github.com/webgptorg/promptbook/discussions/89)
|
|
332
|
-
- [🃏 Jokers (conditions)](https://github.com/webgptorg/promptbook/discussions/66)
|
|
333
|
-
- [🔳 Metaprompting](https://github.com/webgptorg/promptbook/discussions/35)
|
|
334
|
-
- [🌏 Linguistically typed languages](https://github.com/webgptorg/promptbook/discussions/53)
|
|
335
|
-
- [🌍 Auto-Translations](https://github.com/webgptorg/promptbook/discussions/42)
|
|
336
|
-
- [📽 Images, audio, video, spreadsheets](https://github.com/webgptorg/promptbook/discussions/54)
|
|
337
|
-
- [🔙 Expectation-aware generation](https://github.com/webgptorg/promptbook/discussions/37)
|
|
338
|
-
- [⏳ Just-in-time fine-tuning](https://github.com/webgptorg/promptbook/discussions/33)
|
|
339
|
-
- [🔴 Anomaly detection](https://github.com/webgptorg/promptbook/discussions/40)
|
|
340
|
-
- [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
|
|
341
|
-
- [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
|
|
409
|
+
<p align="center"><a href="https://github.com/webgptorg/promptbook/discussions/categories/concepts">🔍 View more concepts</a></p>
|
|
342
410
|
|
|
343
411
|
|
|
344
412
|
|
|
@@ -393,36 +461,28 @@ If you have a question [start a discussion](https://github.com/webgptorg/promptb
|
|
|
393
461
|
- [❔ Is Promptbook using RAG _(Retrieval-Augmented Generation)_?](https://github.com/webgptorg/promptbook/discussions/123)
|
|
394
462
|
- [❔ Is Promptbook using function calling?](https://github.com/webgptorg/promptbook/discussions/124)
|
|
395
463
|
|
|
396
|
-
##
|
|
464
|
+
## 📅 Changelog
|
|
397
465
|
|
|
398
466
|
See [CHANGELOG.md](./CHANGELOG.md)
|
|
399
467
|
|
|
400
468
|
## 📜 License
|
|
401
469
|
|
|
402
|
-
|
|
470
|
+
This project is licensed under [BUSL 1.1](./LICENSE.md).
|
|
403
471
|
|
|
404
|
-
##
|
|
472
|
+
## 🤝 Contributing
|
|
405
473
|
|
|
406
|
-
See [
|
|
474
|
+
We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
407
475
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
<div style="display: flex; align-items: center; gap: 20px;">
|
|
411
|
-
|
|
412
|
-
<a href="https://promptbook.studio/">
|
|
413
|
-
<img src="./design/promptbook-studio-logo.png" alt="Partner 3" height="70">
|
|
414
|
-
</a>
|
|
415
|
-
|
|
416
|
-
<a href="https://technologickainkubace.org/en/about-technology-incubation/about-the-project/">
|
|
417
|
-
<img src="./other/partners/CI-Technology-Incubation.png" alt="Technology Incubation" height="70">
|
|
418
|
-
</a>
|
|
419
|
-
|
|
420
|
-
</div>
|
|
476
|
+
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).
|
|
421
477
|
|
|
422
|
-
##
|
|
478
|
+
## 🆘 Support & Community
|
|
423
479
|
|
|
424
|
-
|
|
480
|
+
Need help with Book language? We're here for you!
|
|
425
481
|
|
|
426
|
-
|
|
482
|
+
- 💬 [Join our Discord community](https://discord.gg/x3QWNaa89N) for real-time support
|
|
483
|
+
- 📝 [Browse our GitHub discussions](https://github.com/webgptorg/promptbook/discussions) for FAQs and community knowledge
|
|
484
|
+
- 🐛 [Report issues](https://github.com/webgptorg/book/issues) for bugs or feature requests
|
|
485
|
+
- 📚 Visit [ptbk.io](https://ptbk.io) for more resources and documentation
|
|
486
|
+
- 📧 Contact us directly through the channels listed in our [signpost](./SIGNPOST.md)
|
|
427
487
|
|
|
428
|
-
|
|
488
|
+
We welcome contributions and feedback to make Book language better for everyone!
|
package/esm/index.es.js
CHANGED
|
@@ -25,7 +25,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
25
25
|
* @generated
|
|
26
26
|
* @see https://github.com/webgptorg/promptbook
|
|
27
27
|
*/
|
|
28
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.
|
|
28
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.94.0-0';
|
|
29
29
|
/**
|
|
30
30
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
31
31
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -5504,6 +5504,11 @@ async function executeTask(options) {
|
|
|
5504
5504
|
const jokerParameterNames = currentTask.jokerParameterNames || [];
|
|
5505
5505
|
const preparedContent = (currentTask.preparedContent || '{content}').split('{content}').join(currentTask.content);
|
|
5506
5506
|
// <- TODO: [🍵] Use here `templateParameters` to replace {websiteContent} with option to ignore missing parameters
|
|
5507
|
+
await onProgress({
|
|
5508
|
+
outputParameters: {
|
|
5509
|
+
[currentTask.resultingParameterName]: '',
|
|
5510
|
+
},
|
|
5511
|
+
});
|
|
5507
5512
|
const resultString = await executeFormatSubvalues({
|
|
5508
5513
|
jokerParameterNames,
|
|
5509
5514
|
priority,
|