@promptbook/core 0.86.0-9 โ†’ 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/core`
33
27
 
34
28
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
@@ -64,6 +58,8 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
64
58
 
65
59
  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**!
66
60
 
61
+
62
+
67
63
  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!
68
64
 
69
65
  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.
@@ -100,17 +96,22 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
100
96
  <tr>
101
97
  <td><a href="https://github.com/webgptorg/book">Book language</a></td>
102
98
  <td>
103
- 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>
99
+ Book is a human-understandable markup language for writing AI applications such as chatbots, knowledge bases, agents, avarars, translators, automations and more.
100
+ <hr>
104
101
  There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
105
102
  </td>
106
103
  </tr>
107
104
  <tr>
108
105
  <td><a href="https://github.com/webgptorg/promptbook">Promptbook Engine</a></td>
109
- <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>
106
+ <td>
107
+ 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>
108
+ </td>
110
109
  </tr>
111
110
  <tr>
112
111
  <td><a href="https://promptbook.studio">Promptbook Studio</a></td>
113
- <td>Studio to write Books and instantly publish them as miniapps</td>
112
+ <td>
113
+ Promptbook.studio is a web-based editor and runner for book applications. It is still in the experimental MVP stage.
114
+ </td>
114
115
  </tr>
115
116
  </tbody>
116
117
  </table>
@@ -121,16 +122,21 @@ We also have a community of developers and users of **Promptbook**:
121
122
  - [Landing page `ptbk.io`](https://ptbk.io)
122
123
  - [Github discussions](https://github.com/webgptorg/promptbook/discussions)
123
124
  - [LinkedIn `Promptbook`](https://linkedin.com/company/promptbook)
124
- - [Facebook `Promptbook`](https://www.facebook.com/61560776453536)
125
+ - [Facebook `Promptbook`](https://www.facebook.com/61560776453536)
125
126
 
126
127
  And **Promptbook.studio** branded socials:
127
128
 
129
+
130
+
128
131
  - [Instagram `@promptbook.studio`](https://www.instagram.com/promptbook.studio/)
129
132
 
130
133
  And **Promptujeme** sub-brand:
131
134
 
132
135
  _/Subbrand for Czech clients/_
133
136
 
137
+
138
+
139
+
134
140
  - [Promptujeme.cz](https://www.promptujeme.cz/)
135
141
  - [Facebook `Promptujeme`](https://www.facebook.com/promptujeme/)
136
142
 
@@ -139,16 +145,18 @@ And **Promptbook.city** branded socials:
139
145
  _/Sub-brand for images and graphics generated via Promptbook prompting/_
140
146
 
141
147
  - [Instagram `@promptbook.city`](https://www.instagram.com/promptbook.city/)
142
- - [Facebook `Promptbook City`](https://www.facebook.com/61565718625569)
148
+ - [Facebook `Promptbook City`](https://www.facebook.com/61565718625569)
149
+
150
+ ##
151
+
143
152
 
144
153
 
145
154
 
146
- ## ๐Ÿ’™ Book language _(for prompt-engineer)_
147
155
 
148
156
 
157
+ ## ๐Ÿ’™ The Book language
149
158
 
150
159
 
151
- ## ๐Ÿ’™ The blueprint of book language
152
160
 
153
161
  Following is the documentation and blueprint of the Book language.
154
162
 
@@ -157,6 +165,11 @@ Following is the documentation and blueprint of the Book language.
157
165
  ```markdown
158
166
  # ๐ŸŒŸ My first Book
159
167
 
168
+ - BOOK VERSION 1.0.0
169
+ - URL https://promptbook.studio/my-first-book/
170
+
171
+ # Write an article
172
+
160
173
  - PERSONA Jane, marketing specialist with prior experience in writing articles about technology and artificial intelligence
161
174
  - KNOWLEDGE https://ptbk.io
162
175
  - KNOWLEDGE ./promptbook.pdf
@@ -169,59 +182,31 @@ Following is the documentation and blueprint of the Book language.
169
182
  -> {article}
170
183
  ```
171
184
 
172
- ### Goals and principles of book language
185
+ ### **What:** Workflows, Tasks and Parameters
173
186
 
174
- 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.
175
-
176
- It has file with `.book.md` or `.book` extension with `UTF-8` non BOM encoding.
177
-
178
- 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.
179
-
180
- But unlike programming languages, it is designed to be understandable by non-programmers and non-technical people.
187
+ - [PARAMETER](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PARAMETER.md)
181
188
 
182
- ### Structure
189
+ ### **Who:** Personas
183
190
 
184
- 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.
191
+ - [PERSONA](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PERSONA.md)
185
192
 
186
- ### Header
193
+ ### **How:** Knowledge, Instruments and Actions
187
194
 
188
- 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.
195
+ - [KNOWLEDGE](https://github.com/webgptorg/promptbook/blob/main/documents/commands/KNOWLEDGE.md)
196
+ - [INSTRUMENT](https://github.com/webgptorg/promptbook/blob/main/documents/commands/INSTRUMENT.md)
197
+ - [ACTION](https://github.com/webgptorg/promptbook/blob/main/documents/commands/ACTION.md)
189
198
 
190
- ### Parameter
199
+ ### General principles of book language
191
200
 
192
- Foo bar
201
+ 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.
193
202
 
194
- #### Parameter names
203
+ The file has `.book` extension. It uses `UTF-8` non BOM encoding.
195
204
 
196
- Reserved words:
205
+ Book has two variants: flat - which is just a prompt with no structure, and full - which has a structure with tasks, commands and prompts.
197
206
 
198
- - _each command_ like `PERSONA`, `EXPECT`, `KNOWLEDGE`, etc.
199
- - `content`
200
- - `context`
201
- - `knowledge`
202
- - `examples`
203
- - `modelName`
204
- - `currentDate`
205
-
206
- #### Parameter notation
207
-
208
- ### Task
209
-
210
- ### Task type
211
-
212
- Todo todo
213
-
214
- ### Command
215
-
216
- Todo todo
217
-
218
- ### Block
219
-
220
- Todo todo
221
-
222
- ### Return parameter
207
+ 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.
223
208
 
224
- ### Examples
209
+ But unlike programming languages, it is designed to be understandable by non-programmers and non-technical people.
225
210
 
226
211
 
227
212
 
@@ -267,6 +252,7 @@ Or you can install them separately:
267
252
  - **[@promptbook/templates](https://www.npmjs.com/package/@promptbook/templates)** - Usefull templates and examples of books which can be used as a starting point
268
253
  - **[@promptbook/types](https://www.npmjs.com/package/@promptbook/types)** - Just typescript types used in the library
269
254
  - โญ **[@promptbook/cli](https://www.npmjs.com/package/@promptbook/cli)** - Command line interface utilities for promptbooks
255
+ - ๐Ÿ‹ **[Docker image](https://hub.docker.com/r/hejny/promptbook/)** - Promptbook server
270
256
 
271
257
 
272
258
 
@@ -275,6 +261,11 @@ Or you can install them separately:
275
261
 
276
262
  ## ๐Ÿ“š Dictionary
277
263
 
264
+
265
+
266
+
267
+
268
+
278
269
  ### ๐Ÿ“š Dictionary
279
270
 
280
271
  The following glossary is used to clarify certain concepts:
@@ -290,6 +281,8 @@ The following glossary is used to clarify certain concepts:
290
281
  - **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.
291
282
  - **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.
292
283
 
284
+
285
+
293
286
  _Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
294
287
 
295
288
  #### Promptbook core
@@ -350,6 +343,8 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
350
343
  - [๐Ÿ‘ฎ Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
351
344
  - [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
352
345
 
346
+
347
+
353
348
  ### Terms specific to Promptbook TypeScript implementation
354
349
 
355
350
  - Anonymous mode
@@ -429,7 +424,7 @@ See [TODO.md](./TODO.md)
429
424
  <div style="display: flex; align-items: center; gap: 20px;">
430
425
 
431
426
  <a href="https://promptbook.studio/">
432
- <img src="./other/design/promptbook-studio-logo.png" alt="Partner 3" height="100">
427
+ <img src="./design/promptbook-studio-logo.png" alt="Partner 3" height="100">
433
428
  </a>
434
429
 
435
430
  <a href="https://technologickainkubace.org/en/about-technology-incubation/about-the-project/">
package/esm/index.es.js CHANGED
@@ -27,7 +27,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
27
27
  * @generated
28
28
  * @see https://github.com/webgptorg/promptbook
29
29
  */
30
- var PROMPTBOOK_ENGINE_VERSION = '0.86.0-8';
30
+ var PROMPTBOOK_ENGINE_VERSION = '0.86.6';
31
31
  /**
32
32
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
33
33
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
@@ -388,7 +388,7 @@ function capitalize(word) {
388
388
  * Converts promptbook in JSON format to string format
389
389
  *
390
390
  * @deprecated TODO: [๐Ÿฅ][๐Ÿง ] Backup original files in `PipelineJson` same as in Promptbook.studio
391
- * @param pipelineJson Promptbook in JSON format (.book.json)
391
+ * @param pipelineJson Promptbook in JSON format (.bookc)
392
392
  * @returns Promptbook in string format (.book.md)
393
393
  * @public exported from `@promptbook/core`
394
394
  */
@@ -6266,7 +6266,9 @@ function prepareTasks(pipeline, tools, options) {
6266
6266
  return __generator(this, function (_a) {
6267
6267
  dependentParameterNames = task.dependentParameterNames;
6268
6268
  preparedContent = undefined;
6269
- if (knowledgePiecesCount > 0 && !dependentParameterNames.includes('knowledge')) {
6269
+ if (task.taskType === 'PROMPT_TASK' &&
6270
+ knowledgePiecesCount > 0 &&
6271
+ !dependentParameterNames.includes('knowledge')) {
6270
6272
  preparedContent = spaceTrim$1("\n {content}\n\n ## Knowledge\n\n {knowledge}\n ");
6271
6273
  // <- TODO: [๐Ÿง ][๐Ÿงป] Cutomize shape/language/formatting of the addition to the prompt
6272
6274
  dependentParameterNames = __spreadArray(__spreadArray([], __read(dependentParameterNames), false), [
@@ -9428,7 +9430,7 @@ function flattenMarkdown(markdown) {
9428
9430
  * Note: This function acts as compilation process
9429
9431
  *
9430
9432
  * @param pipelineString {Promptbook} in string markdown format (.book.md)
9431
- * @returns {Promptbook} compiled in JSON format (.book.json)
9433
+ * @returns {Promptbook} compiled in JSON format (.bookc)
9432
9434
  * @throws {ParseError} if the promptbook string is not valid
9433
9435
  * @public exported from `@promptbook/core`
9434
9436
  */
@@ -9896,7 +9898,7 @@ function parsePipeline(pipelineString) {
9896
9898
  * @param pipelineString {Promptbook} in string markdown format (.book.md)
9897
9899
  * @param tools - Tools for the preparation and scraping - if not provided together with `llm`, the preparation will be skipped
9898
9900
  * @param options - Options and tools for the compilation
9899
- * @returns {Promptbook} compiled in JSON format (.book.json)
9901
+ * @returns {Promptbook} compiled in JSON format (.bookc)
9900
9902
  * @throws {ParseError} if the promptbook string is not valid
9901
9903
  * @public exported from `@promptbook/core`
9902
9904
  */