@promptbook/markdown-utils 0.73.0 → 0.74.0-11

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.
Files changed (40) hide show
  1. package/README.md +176 -3
  2. package/esm/index.es.js +226 -284
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/anthropic-claude.index.d.ts +2 -2
  5. package/esm/typings/src/_packages/azure-openai.index.d.ts +2 -2
  6. package/esm/typings/src/_packages/browser.index.d.ts +2 -2
  7. package/esm/typings/src/_packages/cli.index.d.ts +2 -2
  8. package/esm/typings/src/_packages/core.index.d.ts +7 -3
  9. package/esm/typings/src/_packages/documents.index.d.ts +2 -2
  10. package/esm/typings/src/_packages/execute-javascript.index.d.ts +2 -2
  11. package/esm/typings/src/_packages/fake-llm.index.d.ts +2 -2
  12. package/esm/typings/src/_packages/langtail.index.d.ts +2 -2
  13. package/esm/typings/src/_packages/legacy-documents.index.d.ts +2 -2
  14. package/esm/typings/src/_packages/markdown-utils.index.d.ts +2 -2
  15. package/esm/typings/src/_packages/node.index.d.ts +2 -2
  16. package/esm/typings/src/_packages/openai.index.d.ts +2 -2
  17. package/esm/typings/src/_packages/pdf.index.d.ts +2 -2
  18. package/esm/typings/src/_packages/remote-client.index.d.ts +2 -2
  19. package/esm/typings/src/_packages/remote-server.index.d.ts +2 -2
  20. package/esm/typings/src/_packages/utils.index.d.ts +2 -2
  21. package/esm/typings/src/_packages/website-crawler.index.d.ts +2 -2
  22. package/esm/typings/src/cli/cli-commands/make.d.ts +0 -1
  23. package/esm/typings/src/cli/cli-commands/run.d.ts +14 -0
  24. package/esm/typings/src/cli/promptbookCli.d.ts +1 -0
  25. package/esm/typings/src/cli/test/ptbk.d.ts +5 -2
  26. package/esm/typings/src/commands/{PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts → BOOK_VERSION/BookVersionCommand.d.ts} +4 -4
  27. package/esm/typings/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +9 -0
  28. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +1 -1
  29. package/esm/typings/src/commands/index.d.ts +1 -1
  30. package/esm/typings/src/config.d.ts +6 -0
  31. package/esm/typings/src/storage/blackhole/BlackholeStorage.d.ts +33 -0
  32. package/esm/typings/src/storage/memory/MemoryStorage.d.ts +1 -1
  33. package/esm/typings/src/storage/{memory/utils → utils}/PrefixStorage.d.ts +1 -1
  34. package/esm/typings/src/version.d.ts +13 -2
  35. package/package.json +1 -1
  36. package/umd/index.umd.js +227 -284
  37. package/umd/index.umd.js.map +1 -1
  38. package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +0 -9
  39. /package/esm/typings/src/commands/{PROMPTBOOK_VERSION/promptbookVersionCommand.test.d.ts → BOOK_VERSION/bookVersionCommand.test.d.ts} +0 -0
  40. /package/esm/typings/src/storage/{memory → local-storage}/utils/makePromptbookStorageFromWebStorage.d.ts +0 -0
package/README.md CHANGED
@@ -24,6 +24,10 @@ Build responsible, controlled and transparent applications on top of LLM models!
24
24
 
25
25
 
26
26
 
27
+ <blockquote style="color: #ff8811">
28
+ <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>.
29
+ </blockquote>
30
+
27
31
  ## 📦 Package `@promptbook/markdown-utils`
28
32
 
29
33
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
@@ -68,12 +72,63 @@ In all of these situations, but especially in 3., the **✨ Promptbook can make
68
72
 
69
73
 
70
74
 
75
+
76
+
77
+
78
+ ## 💜 The Promptbook Project
79
+
80
+ Promptbook project is ecosystem of multiple projects and tools, following is a list of most important pieces of the project:
81
+
82
+ <table>
83
+ <thead>
84
+ <tr>
85
+ <th>Project</th>
86
+ <th>Description</th>
87
+ <th>Link</th>
88
+ </tr>
89
+ </thead>
90
+ <tbody>
91
+ <tr>
92
+ <td>Core</td>
93
+ <td>Promptbook core is a description and documentation of basic innerworkings how should be Promptbook implemented and defines which fetures must be descriable by book language</td>
94
+ <td rowspan=2>https://ptbk.io<br/>https://github.com/webgptorg/book</td>
95
+ </tr>
96
+ <tr>
97
+ <td>Book language</td>
98
+ <td>
99
+ Book is a markdown-like language to define core entities like projects, pipelines, knowledge,.... It is designed to be understandable by non-programmers and non-technical people
100
+ </td>
101
+ </tr>
102
+ <tr>
103
+ <td>Promptbook typescript project</td>
104
+ <td>Implementation of Promptbook in TypeScript published into multiple packages to NPM</td>
105
+ <td>https://github.com/webgptorg/promptbook + Multiple packages on NPM</td>
106
+ </tr>
107
+ <tr>
108
+ <td>Promptbook studio</td>
109
+ <td>No-code studio to write book without need to write even the markdown</td>
110
+ <td rowspan=2>https://promptbook.studio<br/>https://github.com/hejny/promptbook-studio</td>
111
+ </tr>
112
+ <tr>
113
+ <td>Promptbook miniapps</td>
114
+ <td>Builder of LLM miniapps from book notation</td>
115
+ </tr>
116
+ </tbody>
117
+ </table>
118
+
119
+
120
+
71
121
  ## 💙 Book language _(for prompt-engineer)_
72
122
 
73
- Promptbook [pipelines](https://github.com/webgptorg/promptbook/discussions/64) are written in markdown-like language called [Book](https://github.com/webgptorg/book). It is designed to be understandable by non-programmers and non-technical people.
74
123
 
75
124
 
76
125
 
126
+ ## 💙 The blueprint of book language
127
+
128
+ Following is the documentation and blueprint of the Book language.
129
+
130
+ ### Example
131
+
77
132
  ```markdown
78
133
  # 🌟 My first Book
79
134
 
@@ -89,6 +144,60 @@ Promptbook [pipelines](https://github.com/webgptorg/promptbook/discussions/64) a
89
144
  -> {article}
90
145
  ```
91
146
 
147
+ ### Goals and principles of book language
148
+
149
+ 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.
150
+
151
+ It has file with `.ptbk.md` or `.book` extension with `UTF-8` non BOM encoding.
152
+
153
+ 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.
154
+
155
+ But unlike programming languages, it is designed to be understandable by non-programmers and non-technical people.
156
+
157
+ ### Structure
158
+
159
+ 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.
160
+
161
+ ### Header
162
+
163
+ 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.
164
+
165
+ ### Parameter
166
+
167
+ Foo bar
168
+
169
+ #### Parameter names
170
+
171
+ Reserved words:
172
+
173
+ - _each command_ like `PERSONA`, `EXPECT`, `KNOWLEDGE`, etc.
174
+ - `content`
175
+ - `context`
176
+ - `knowledge`
177
+ - `examples`
178
+ - `modelName`
179
+ - `currentDate`
180
+
181
+ #### Parameter notation
182
+
183
+ ### Template
184
+
185
+ Todo todo
186
+
187
+ ### Command
188
+
189
+ Todo todo
190
+
191
+ ### Block
192
+
193
+ Todo todo
194
+
195
+ ### Return parameter
196
+
197
+ ### Examples
198
+
199
+
200
+
92
201
  ## 📦 Packages _(for developers)_
93
202
 
94
203
  This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
@@ -127,11 +236,66 @@ Or you can install them separately:
127
236
 
128
237
 
129
238
 
239
+
240
+
241
+
130
242
  ## 📚 Dictionary
131
243
 
244
+
245
+
246
+
247
+
248
+
249
+ ### 📚 Dictionary
250
+
132
251
  The following glossary is used to clarify certain concepts:
133
252
 
134
- ### Core concepts
253
+ #### General LLM / AI terms
254
+
255
+ - **Prompt drift** is a phenomenon where the AI model starts to generate outputs that are not aligned with the original prompt. This can happen due to the model's training data, the prompt's wording, or the model's architecture.
256
+ - **Pipeline, workflow or chain** is a sequence of tasks that are executed in a specific order. In the context of AI, a pipeline can refer to a sequence of AI models that are used to process data.
257
+ - **Fine-tuning** is a process where a pre-trained AI model is further trained on a specific dataset to improve its performance on a specific task.
258
+ - **Zero-shot learning** is a machine learning paradigm where a model is trained to perform a task without any labeled examples. Instead, the model is provided with a description of the task and is expected to generate the correct output.
259
+ - **Few-shot learning** is a machine learning paradigm where a model is trained to perform a task with only a few labeled examples. This is in contrast to traditional machine learning, where models are trained on large datasets.
260
+ - **Meta-learning** is a machine learning paradigm where a model is trained on a variety of tasks and is able to learn new tasks with minimal additional training. This is achieved by learning a set of meta-parameters that can be quickly adapted to new tasks.
261
+ - **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.
262
+ - **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.
263
+
264
+
265
+
266
+ _Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
267
+
268
+ #### Promptbook core
269
+
270
+ - **Organization** _(legacy name collection)_ group jobs, workforce, knowledge, instruments, and actions into one package. Entities in one organization can share resources (= import resources from each other).
271
+ - **Jobs**
272
+ - **Task**
273
+ - **Subtask**
274
+ - **Workforce**
275
+ - **Persona**
276
+ - **Team**
277
+ - **Role**
278
+ - **Knowledge**
279
+ - **Public**
280
+ - **Private**
281
+ - **Protected**
282
+ - **Instruments**
283
+ - **Actions**
284
+
285
+ #### Book language
286
+
287
+ - **Book file**
288
+ - **Section**
289
+ - **Heading**
290
+ - **Description**
291
+ - **Command**
292
+ - **Block**
293
+ - **Return statement**
294
+ - **Comment**
295
+ - **Import**
296
+ - **Scope**
297
+
298
+ #### 💯 Core concepts
135
299
 
136
300
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
137
301
  - [📯 Pipeline](https://github.com/webgptorg/promptbook/discussions/64)
@@ -144,7 +308,7 @@ The following glossary is used to clarify certain concepts:
144
308
  - [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29)
145
309
  - [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32)
146
310
 
147
- ### Advanced concepts
311
+ ##### Advanced concepts
148
312
 
149
313
  - [📚 Knowledge (Retrieval-augmented generation)](https://github.com/webgptorg/promptbook/discussions/41)
150
314
  - [🌏 Remote server](https://github.com/webgptorg/promptbook/discussions/89)
@@ -159,6 +323,15 @@ The following glossary is used to clarify certain concepts:
159
323
  - [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
160
324
  - [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
161
325
 
326
+
327
+
328
+ ### Terms specific to Promptbook TypeScript implementation
329
+
330
+ - Anonymous mode
331
+ - Application mode
332
+
333
+
334
+
162
335
  ## 🔌 Usage in Typescript / Javascript
163
336
 
164
337
  - [Simple usage](./examples/usage/simple-script)