@promptbook/documents 0.86.0-8 โ†’ 0.86.6

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
@@ -5,8 +5,8 @@
5
5
 
6
6
 
7
7
 
8
- [![NPM Version of ![Promptbook logo - cube with letters P and B](./other/design/logo-h1.png) Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
9
- [![Quality of package ![Promptbook logo - cube with letters P and B](./other/design/logo-h1.png) Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
8
+ [![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
+ [![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
10
  [![Known Vulnerabilities](https://snyk.io/test/github/webgptorg/promptbook/badge.svg)](https://snyk.io/test/github/webgptorg/promptbook)
11
11
  [![Issues](https://img.shields.io/github/issues/webgptorg/promptbook.svg?style=flat)](https://github.com/webgptorg/promptbook/issues)
12
12
 
@@ -17,18 +17,12 @@
17
17
  ## ๐ŸŒŸ New Features
18
18
 
19
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/)
20
21
  - ๐Ÿ’ซ Support of [`o3-mini` model by OpenAI](https://openai.com/index/openai-o3-mini/)
21
22
  - ๐Ÿ‹ **Support of [DeepSeek models](https://www.npmjs.com/package/@promptbook/deepseek)**
22
- - ๐Ÿ’™ Working [the **Book** language v1.0.0](https://github.com/webgptorg/book)
23
- - ๐Ÿ–ค Run books from CLI - `npx ptbk run path/to/your/book`
24
- - ๐Ÿ“š Support of `.docx`, `.doc` and `.pdf` documents as knowledge
25
23
 
26
24
 
27
25
 
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>
31
-
32
26
  ## ๐Ÿ“ฆ Package `@promptbook/documents`
33
27
 
34
28
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
@@ -63,6 +57,8 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
63
57
 
64
58
  During the computer revolution, we have seen [multiple generations of computer languages](https://github.com/webgptorg/promptbook/discussions/180), from the physical rewiring of the vacuum tubes through low-level machine code to the high-level languages like Python or JavaScript. And now, we're on the edge of the **next revolution**!
65
59
 
60
+
61
+
66
62
  It's a revolution of writing software in **plain human language** that is understandable and executable by both humans and machines โ€“ and it's going to change everything!
67
63
 
68
64
  The incredible growth in power of microprocessors and the Moore's Law have been the driving force behind the ever-more powerful languages, and it's been an amazing journey! Similarly, the large language models (like GPT or Claude) are the next big thing in language technology, and they're set to transform the way we interact with computers.
@@ -99,17 +95,22 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
99
95
  <tr>
100
96
  <td><a href="https://github.com/webgptorg/book">Book language</a></td>
101
97
  <td>
102
- Book is a markdown-like language to define core entities like personas, knowledge, tasks,.... It is designed to be understandable by non-programmers and non-technical people<hr>
98
+ Book is a human-understandable markup language for writing AI applications such as chatbots, knowledge bases, agents, avarars, translators, automations and more.
99
+ <hr>
103
100
  There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
104
101
  </td>
105
102
  </tr>
106
103
  <tr>
107
104
  <td><a href="https://github.com/webgptorg/promptbook">Promptbook Engine</a></td>
108
- <td>Promptbook implementation in TypeScript released as <a href="https://www.npmjs.com/package/@promptbook/core#-packages-for-developers">multiple NPM packages</a> and <a href="https://hub.docker.com/r/hejny/promptbook">Docker HUB</a></td>
105
+ <td>
106
+ Promptbook engine can run applications written in Book language. It is released as <a href="https://www.npmjs.com/package/@promptbook/core#-packages-for-developers">multiple NPM packages</a> and <a href="https://hub.docker.com/r/hejny/promptbook">Docker HUB</a>
107
+ </td>
109
108
  </tr>
110
109
  <tr>
111
110
  <td><a href="https://promptbook.studio">Promptbook Studio</a></td>
112
- <td>Studio to write Books and instantly publish them as miniapps</td>
111
+ <td>
112
+ Promptbook.studio is a web-based editor and runner for book applications. It is still in the experimental MVP stage.
113
+ </td>
113
114
  </tr>
114
115
  </tbody>
115
116
  </table>
@@ -120,16 +121,21 @@ We also have a community of developers and users of **Promptbook**:
120
121
  - [Landing page `ptbk.io`](https://ptbk.io)
121
122
  - [Github discussions](https://github.com/webgptorg/promptbook/discussions)
122
123
  - [LinkedIn `Promptbook`](https://linkedin.com/company/promptbook)
123
- - [Facebook `Promptbook`](https://www.facebook.com/61560776453536)
124
+ - [Facebook `Promptbook`](https://www.facebook.com/61560776453536)
124
125
 
125
126
  And **Promptbook.studio** branded socials:
126
127
 
128
+
129
+
127
130
  - [Instagram `@promptbook.studio`](https://www.instagram.com/promptbook.studio/)
128
131
 
129
132
  And **Promptujeme** sub-brand:
130
133
 
131
134
  _/Subbrand for Czech clients/_
132
135
 
136
+
137
+
138
+
133
139
  - [Promptujeme.cz](https://www.promptujeme.cz/)
134
140
  - [Facebook `Promptujeme`](https://www.facebook.com/promptujeme/)
135
141
 
@@ -138,16 +144,18 @@ And **Promptbook.city** branded socials:
138
144
  _/Sub-brand for images and graphics generated via Promptbook prompting/_
139
145
 
140
146
  - [Instagram `@promptbook.city`](https://www.instagram.com/promptbook.city/)
141
- - [Facebook `Promptbook City`](https://www.facebook.com/61565718625569)
147
+ - [Facebook `Promptbook City`](https://www.facebook.com/61565718625569)
148
+
149
+ ##
150
+
142
151
 
143
152
 
144
153
 
145
- ## ๐Ÿ’™ Book language _(for prompt-engineer)_
146
154
 
147
155
 
156
+ ## ๐Ÿ’™ The Book language
148
157
 
149
158
 
150
- ## ๐Ÿ’™ The blueprint of book language
151
159
 
152
160
  Following is the documentation and blueprint of the Book language.
153
161
 
@@ -156,6 +164,11 @@ Following is the documentation and blueprint of the Book language.
156
164
  ```markdown
157
165
  # ๐ŸŒŸ My first Book
158
166
 
167
+ - BOOK VERSION 1.0.0
168
+ - URL https://promptbook.studio/my-first-book/
169
+
170
+ # Write an article
171
+
159
172
  - PERSONA Jane, marketing specialist with prior experience in writing articles about technology and artificial intelligence
160
173
  - KNOWLEDGE https://ptbk.io
161
174
  - KNOWLEDGE ./promptbook.pdf
@@ -168,59 +181,31 @@ Following is the documentation and blueprint of the Book language.
168
181
  -> {article}
169
182
  ```
170
183
 
171
- ### Goals and principles of book language
184
+ ### **What:** Workflows, Tasks and Parameters
172
185
 
173
- File is designed to be easy to read and write. It is strict subset of markdown. It is designed to be understandable by both humans and machines and without specific knowledge of the language.
174
-
175
- It has file with `.book.md` or `.book` extension with `UTF-8` non BOM encoding.
176
-
177
- As it is source code, it can leverage all the features of version control systems like git and does not suffer from the problems of binary formats, proprietary formats, or no-code solutions.
178
-
179
- But unlike programming languages, it is designed to be understandable by non-programmers and non-technical people.
186
+ - [PARAMETER](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PARAMETER.md)
180
187
 
181
- ### Structure
188
+ ### **Who:** Personas
182
189
 
183
- Book is divided into sections. Each section starts with heading. The language itself is not sensitive to the type of heading _(`h1`, `h2`, `h3`, ...)_ but it is recommended to use `h1` for header section and `h2` for other sections.
190
+ - [PERSONA](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PERSONA.md)
184
191
 
185
- ### Header
192
+ ### **How:** Knowledge, Instruments and Actions
186
193
 
187
- Header is the first section of the book. It contains metadata about the pipeline. It is recommended to use `h1` heading for header section but it is not required.
194
+ - [KNOWLEDGE](https://github.com/webgptorg/promptbook/blob/main/documents/commands/KNOWLEDGE.md)
195
+ - [INSTRUMENT](https://github.com/webgptorg/promptbook/blob/main/documents/commands/INSTRUMENT.md)
196
+ - [ACTION](https://github.com/webgptorg/promptbook/blob/main/documents/commands/ACTION.md)
188
197
 
189
- ### Parameter
198
+ ### General principles of book language
190
199
 
191
- Foo bar
200
+ 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.
192
201
 
193
- #### Parameter names
202
+ The file has `.book` extension. It uses `UTF-8` non BOM encoding.
194
203
 
195
- Reserved words:
204
+ Book has two variants: flat - which is just a prompt with no structure, and full - which has a structure with tasks, commands and prompts.
196
205
 
197
- - _each command_ like `PERSONA`, `EXPECT`, `KNOWLEDGE`, etc.
198
- - `content`
199
- - `context`
200
- - `knowledge`
201
- - `examples`
202
- - `modelName`
203
- - `currentDate`
204
-
205
- #### Parameter notation
206
-
207
- ### Task
208
-
209
- ### Task type
210
-
211
- Todo todo
212
-
213
- ### Command
214
-
215
- Todo todo
216
-
217
- ### Block
218
-
219
- Todo todo
220
-
221
- ### Return parameter
206
+ As it is source code, it can leverage all the features of version control systems like git and does not suffer from the problems of binary formats, proprietary formats, or no-code solutions.
222
207
 
223
- ### Examples
208
+ But unlike programming languages, it is designed to be understandable by non-programmers and non-technical people.
224
209
 
225
210
 
226
211
 
@@ -266,6 +251,7 @@ Or you can install them separately:
266
251
  - **[@promptbook/templates](https://www.npmjs.com/package/@promptbook/templates)** - Usefull templates and examples of books which can be used as a starting point
267
252
  - **[@promptbook/types](https://www.npmjs.com/package/@promptbook/types)** - Just typescript types used in the library
268
253
  - โญ **[@promptbook/cli](https://www.npmjs.com/package/@promptbook/cli)** - Command line interface utilities for promptbooks
254
+ - ๐Ÿ‹ **[Docker image](https://hub.docker.com/r/hejny/promptbook/)** - Promptbook server
269
255
 
270
256
 
271
257
 
@@ -274,6 +260,11 @@ Or you can install them separately:
274
260
 
275
261
  ## ๐Ÿ“š Dictionary
276
262
 
263
+
264
+
265
+
266
+
267
+
277
268
  ### ๐Ÿ“š Dictionary
278
269
 
279
270
  The following glossary is used to clarify certain concepts:
@@ -289,6 +280,8 @@ The following glossary is used to clarify certain concepts:
289
280
  - **Retrieval-augmented generation** is a machine learning paradigm where a model generates text by retrieving relevant information from a large database of text. This approach combines the benefits of generative models and retrieval models.
290
281
  - **Longtail** refers to non-common or rare events, items, or entities that are not well-represented in the training data of machine learning models. Longtail items are often challenging for models to predict accurately.
291
282
 
283
+
284
+
292
285
  _Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
293
286
 
294
287
  #### Promptbook core
@@ -349,6 +342,8 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
349
342
  - [๐Ÿ‘ฎ Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
350
343
  - [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
351
344
 
345
+
346
+
352
347
  ### Terms specific to Promptbook TypeScript implementation
353
348
 
354
349
  - Anonymous mode
@@ -428,7 +423,7 @@ See [TODO.md](./TODO.md)
428
423
  <div style="display: flex; align-items: center; gap: 20px;">
429
424
 
430
425
  <a href="https://promptbook.studio/">
431
- <img src="./other/design/promptbook-studio-logo.png" alt="Partner 3" height="100">
426
+ <img src="./design/promptbook-studio-logo.png" alt="Partner 3" height="100">
432
427
  </a>
433
428
 
434
429
  <a href="https://technologickainkubace.org/en/about-technology-incubation/about-the-project/">
package/esm/index.es.js CHANGED
@@ -28,7 +28,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
28
28
  * @generated
29
29
  * @see https://github.com/webgptorg/promptbook
30
30
  */
31
- var PROMPTBOOK_ENGINE_VERSION = '0.86.0-7';
31
+ var PROMPTBOOK_ENGINE_VERSION = '0.86.6';
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
@@ -1274,7 +1274,7 @@ function capitalize(word) {
1274
1274
  * Converts promptbook in JSON format to string format
1275
1275
  *
1276
1276
  * @deprecated TODO: [๐Ÿฅ][๐Ÿง ] Backup original files in `PipelineJson` same as in Promptbook.studio
1277
- * @param pipelineJson Promptbook in JSON format (.book.json)
1277
+ * @param pipelineJson Promptbook in JSON format (.bookc)
1278
1278
  * @returns Promptbook in string format (.book.md)
1279
1279
  * @public exported from `@promptbook/core`
1280
1280
  */
@@ -4058,7 +4058,9 @@ function prepareTasks(pipeline, tools, options) {
4058
4058
  return __generator(this, function (_a) {
4059
4059
  dependentParameterNames = task.dependentParameterNames;
4060
4060
  preparedContent = undefined;
4061
- if (knowledgePiecesCount > 0 && !dependentParameterNames.includes('knowledge')) {
4061
+ if (task.taskType === 'PROMPT_TASK' &&
4062
+ knowledgePiecesCount > 0 &&
4063
+ !dependentParameterNames.includes('knowledge')) {
4062
4064
  preparedContent = spaceTrim("\n {content}\n\n ## Knowledge\n\n {knowledge}\n ");
4063
4065
  // <- TODO: [๐Ÿง ][๐Ÿงป] Cutomize shape/language/formatting of the addition to the prompt
4064
4066
  dependentParameterNames = __spreadArray(__spreadArray([], __read(dependentParameterNames), false), [