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