@promptbook/markdown-utils 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 +54 -59
- package/esm/index.es.js +5 -3
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/cli/test/ptbk2.d.ts +5 -0
- package/esm/typings/src/conversion/compilePipeline.d.ts +1 -1
- package/esm/typings/src/conversion/compilePipelineOnRemoteServer.d.ts +1 -1
- package/esm/typings/src/conversion/parsePipeline.d.ts +1 -1
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +1 -1
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +6 -6
- package/esm/typings/src/pipeline/PipelineJson/PreparationJson.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +5 -3
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
[ Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
|
|
9
|
+
[ Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
|
|
10
10
|
[](https://snyk.io/test/github/webgptorg/promptbook)
|
|
11
11
|
[](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/markdown-utils`
|
|
33
27
|
|
|
34
28
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -60,6 +54,8 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
60
54
|
|
|
61
55
|
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**!
|
|
62
56
|
|
|
57
|
+
|
|
58
|
+
|
|
63
59
|
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!
|
|
64
60
|
|
|
65
61
|
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.
|
|
@@ -96,17 +92,22 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
|
|
|
96
92
|
<tr>
|
|
97
93
|
<td><a href="https://github.com/webgptorg/book">Book language</a></td>
|
|
98
94
|
<td>
|
|
99
|
-
Book is a
|
|
95
|
+
Book is a human-understandable markup language for writing AI applications such as chatbots, knowledge bases, agents, avarars, translators, automations and more.
|
|
96
|
+
<hr>
|
|
100
97
|
There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
|
|
101
98
|
</td>
|
|
102
99
|
</tr>
|
|
103
100
|
<tr>
|
|
104
101
|
<td><a href="https://github.com/webgptorg/promptbook">Promptbook Engine</a></td>
|
|
105
|
-
<td>
|
|
102
|
+
<td>
|
|
103
|
+
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>
|
|
104
|
+
</td>
|
|
106
105
|
</tr>
|
|
107
106
|
<tr>
|
|
108
107
|
<td><a href="https://promptbook.studio">Promptbook Studio</a></td>
|
|
109
|
-
<td>
|
|
108
|
+
<td>
|
|
109
|
+
Promptbook.studio is a web-based editor and runner for book applications. It is still in the experimental MVP stage.
|
|
110
|
+
</td>
|
|
110
111
|
</tr>
|
|
111
112
|
</tbody>
|
|
112
113
|
</table>
|
|
@@ -117,16 +118,21 @@ We also have a community of developers and users of **Promptbook**:
|
|
|
117
118
|
- [Landing page `ptbk.io`](https://ptbk.io)
|
|
118
119
|
- [Github discussions](https://github.com/webgptorg/promptbook/discussions)
|
|
119
120
|
- [LinkedIn `Promptbook`](https://linkedin.com/company/promptbook)
|
|
120
|
-
- [Facebook `Promptbook`](https://www.facebook.com/61560776453536)
|
|
121
|
+
- [Facebook `Promptbook`](https://www.facebook.com/61560776453536)
|
|
121
122
|
|
|
122
123
|
And **Promptbook.studio** branded socials:
|
|
123
124
|
|
|
125
|
+
|
|
126
|
+
|
|
124
127
|
- [Instagram `@promptbook.studio`](https://www.instagram.com/promptbook.studio/)
|
|
125
128
|
|
|
126
129
|
And **Promptujeme** sub-brand:
|
|
127
130
|
|
|
128
131
|
_/Subbrand for Czech clients/_
|
|
129
132
|
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
130
136
|
- [Promptujeme.cz](https://www.promptujeme.cz/)
|
|
131
137
|
- [Facebook `Promptujeme`](https://www.facebook.com/promptujeme/)
|
|
132
138
|
|
|
@@ -135,16 +141,18 @@ And **Promptbook.city** branded socials:
|
|
|
135
141
|
_/Sub-brand for images and graphics generated via Promptbook prompting/_
|
|
136
142
|
|
|
137
143
|
- [Instagram `@promptbook.city`](https://www.instagram.com/promptbook.city/)
|
|
138
|
-
- [Facebook `Promptbook City`](https://www.facebook.com/61565718625569)
|
|
144
|
+
- [Facebook `Promptbook City`](https://www.facebook.com/61565718625569)
|
|
145
|
+
|
|
146
|
+
##
|
|
147
|
+
|
|
139
148
|
|
|
140
149
|
|
|
141
150
|
|
|
142
|
-
## ๐ Book language _(for prompt-engineer)_
|
|
143
151
|
|
|
144
152
|
|
|
153
|
+
## ๐ The Book language
|
|
145
154
|
|
|
146
155
|
|
|
147
|
-
## ๐ The blueprint of book language
|
|
148
156
|
|
|
149
157
|
Following is the documentation and blueprint of the Book language.
|
|
150
158
|
|
|
@@ -153,6 +161,11 @@ Following is the documentation and blueprint of the Book language.
|
|
|
153
161
|
```markdown
|
|
154
162
|
# ๐ My first Book
|
|
155
163
|
|
|
164
|
+
- BOOK VERSION 1.0.0
|
|
165
|
+
- URL https://promptbook.studio/my-first-book/
|
|
166
|
+
|
|
167
|
+
# Write an article
|
|
168
|
+
|
|
156
169
|
- PERSONA Jane, marketing specialist with prior experience in writing articles about technology and artificial intelligence
|
|
157
170
|
- KNOWLEDGE https://ptbk.io
|
|
158
171
|
- KNOWLEDGE ./promptbook.pdf
|
|
@@ -165,59 +178,31 @@ Following is the documentation and blueprint of the Book language.
|
|
|
165
178
|
-> {article}
|
|
166
179
|
```
|
|
167
180
|
|
|
168
|
-
###
|
|
181
|
+
### **What:** Workflows, Tasks and Parameters
|
|
169
182
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
It has file with `.book.md` or `.book` extension with `UTF-8` non BOM encoding.
|
|
173
|
-
|
|
174
|
-
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.
|
|
175
|
-
|
|
176
|
-
But unlike programming languages, it is designed to be understandable by non-programmers and non-technical people.
|
|
183
|
+
- [PARAMETER](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PARAMETER.md)
|
|
177
184
|
|
|
178
|
-
###
|
|
185
|
+
### **Who:** Personas
|
|
179
186
|
|
|
180
|
-
|
|
187
|
+
- [PERSONA](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PERSONA.md)
|
|
181
188
|
|
|
182
|
-
###
|
|
189
|
+
### **How:** Knowledge, Instruments and Actions
|
|
183
190
|
|
|
184
|
-
|
|
191
|
+
- [KNOWLEDGE](https://github.com/webgptorg/promptbook/blob/main/documents/commands/KNOWLEDGE.md)
|
|
192
|
+
- [INSTRUMENT](https://github.com/webgptorg/promptbook/blob/main/documents/commands/INSTRUMENT.md)
|
|
193
|
+
- [ACTION](https://github.com/webgptorg/promptbook/blob/main/documents/commands/ACTION.md)
|
|
185
194
|
|
|
186
|
-
###
|
|
195
|
+
### General principles of book language
|
|
187
196
|
|
|
188
|
-
|
|
197
|
+
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.
|
|
189
198
|
|
|
190
|
-
|
|
199
|
+
The file has `.book` extension. It uses `UTF-8` non BOM encoding.
|
|
191
200
|
|
|
192
|
-
|
|
201
|
+
Book has two variants: flat - which is just a prompt with no structure, and full - which has a structure with tasks, commands and prompts.
|
|
193
202
|
|
|
194
|
-
|
|
195
|
-
- `content`
|
|
196
|
-
- `context`
|
|
197
|
-
- `knowledge`
|
|
198
|
-
- `examples`
|
|
199
|
-
- `modelName`
|
|
200
|
-
- `currentDate`
|
|
201
|
-
|
|
202
|
-
#### Parameter notation
|
|
203
|
-
|
|
204
|
-
### Task
|
|
205
|
-
|
|
206
|
-
### Task type
|
|
207
|
-
|
|
208
|
-
Todo todo
|
|
209
|
-
|
|
210
|
-
### Command
|
|
211
|
-
|
|
212
|
-
Todo todo
|
|
213
|
-
|
|
214
|
-
### Block
|
|
215
|
-
|
|
216
|
-
Todo todo
|
|
217
|
-
|
|
218
|
-
### Return parameter
|
|
203
|
+
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.
|
|
219
204
|
|
|
220
|
-
|
|
205
|
+
But unlike programming languages, it is designed to be understandable by non-programmers and non-technical people.
|
|
221
206
|
|
|
222
207
|
|
|
223
208
|
|
|
@@ -263,6 +248,7 @@ Or you can install them separately:
|
|
|
263
248
|
- **[@promptbook/templates](https://www.npmjs.com/package/@promptbook/templates)** - Usefull templates and examples of books which can be used as a starting point
|
|
264
249
|
- **[@promptbook/types](https://www.npmjs.com/package/@promptbook/types)** - Just typescript types used in the library
|
|
265
250
|
- โญ **[@promptbook/cli](https://www.npmjs.com/package/@promptbook/cli)** - Command line interface utilities for promptbooks
|
|
251
|
+
- ๐ **[Docker image](https://hub.docker.com/r/hejny/promptbook/)** - Promptbook server
|
|
266
252
|
|
|
267
253
|
|
|
268
254
|
|
|
@@ -271,6 +257,11 @@ Or you can install them separately:
|
|
|
271
257
|
|
|
272
258
|
## ๐ Dictionary
|
|
273
259
|
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
274
265
|
### ๐ Dictionary
|
|
275
266
|
|
|
276
267
|
The following glossary is used to clarify certain concepts:
|
|
@@ -286,6 +277,8 @@ The following glossary is used to clarify certain concepts:
|
|
|
286
277
|
- **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.
|
|
287
278
|
- **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.
|
|
288
279
|
|
|
280
|
+
|
|
281
|
+
|
|
289
282
|
_Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
290
283
|
|
|
291
284
|
#### Promptbook core
|
|
@@ -346,6 +339,8 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
|
|
|
346
339
|
- [๐ฎ Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
|
|
347
340
|
- [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
|
|
348
341
|
|
|
342
|
+
|
|
343
|
+
|
|
349
344
|
### Terms specific to Promptbook TypeScript implementation
|
|
350
345
|
|
|
351
346
|
- Anonymous mode
|
|
@@ -425,7 +420,7 @@ See [TODO.md](./TODO.md)
|
|
|
425
420
|
<div style="display: flex; align-items: center; gap: 20px;">
|
|
426
421
|
|
|
427
422
|
<a href="https://promptbook.studio/">
|
|
428
|
-
<img src="./
|
|
423
|
+
<img src="./design/promptbook-studio-logo.png" alt="Partner 3" height="100">
|
|
429
424
|
</a>
|
|
430
425
|
|
|
431
426
|
<a href="https://technologickainkubace.org/en/about-technology-incubation/about-the-project/">
|
package/esm/index.es.js
CHANGED
|
@@ -25,7 +25,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
25
25
|
* @generated
|
|
26
26
|
* @see https://github.com/webgptorg/promptbook
|
|
27
27
|
*/
|
|
28
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.86.
|
|
28
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.86.6';
|
|
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
|
|
@@ -523,7 +523,7 @@ function prettifyMarkdown(content) {
|
|
|
523
523
|
* Converts promptbook in JSON format to string format
|
|
524
524
|
*
|
|
525
525
|
* @deprecated TODO: [๐ฅ][๐ง ] Backup original files in `PipelineJson` same as in Promptbook.studio
|
|
526
|
-
* @param pipelineJson Promptbook in JSON format (.
|
|
526
|
+
* @param pipelineJson Promptbook in JSON format (.bookc)
|
|
527
527
|
* @returns Promptbook in string format (.book.md)
|
|
528
528
|
* @public exported from `@promptbook/core`
|
|
529
529
|
*/
|
|
@@ -3978,7 +3978,9 @@ function prepareTasks(pipeline, tools, options) {
|
|
|
3978
3978
|
return __generator(this, function (_a) {
|
|
3979
3979
|
dependentParameterNames = task.dependentParameterNames;
|
|
3980
3980
|
preparedContent = undefined;
|
|
3981
|
-
if (
|
|
3981
|
+
if (task.taskType === 'PROMPT_TASK' &&
|
|
3982
|
+
knowledgePiecesCount > 0 &&
|
|
3983
|
+
!dependentParameterNames.includes('knowledge')) {
|
|
3982
3984
|
preparedContent = spaceTrim$1("\n {content}\n\n ## Knowledge\n\n {knowledge}\n ");
|
|
3983
3985
|
// <- TODO: [๐ง ][๐งป] Cutomize shape/language/formatting of the addition to the prompt
|
|
3984
3986
|
dependentParameterNames = __spreadArray(__spreadArray([], __read(dependentParameterNames), false), [
|