@promptbook/markdown-utils 0.74.0-0 → 0.74.0-12
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 +135 -30
- package/esm/index.es.js +245 -301
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/anthropic-claude.index.d.ts +2 -2
- package/esm/typings/src/_packages/azure-openai.index.d.ts +2 -2
- package/esm/typings/src/_packages/browser.index.d.ts +2 -2
- package/esm/typings/src/_packages/cli.index.d.ts +2 -2
- package/esm/typings/src/_packages/core.index.d.ts +7 -3
- package/esm/typings/src/_packages/documents.index.d.ts +2 -2
- package/esm/typings/src/_packages/execute-javascript.index.d.ts +2 -2
- package/esm/typings/src/_packages/fake-llm.index.d.ts +2 -2
- package/esm/typings/src/_packages/langtail.index.d.ts +2 -2
- package/esm/typings/src/_packages/legacy-documents.index.d.ts +2 -2
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +2 -2
- package/esm/typings/src/_packages/node.index.d.ts +2 -2
- package/esm/typings/src/_packages/openai.index.d.ts +2 -2
- package/esm/typings/src/_packages/pdf.index.d.ts +2 -2
- package/esm/typings/src/_packages/remote-client.index.d.ts +2 -2
- package/esm/typings/src/_packages/remote-server.index.d.ts +2 -2
- package/esm/typings/src/_packages/utils.index.d.ts +2 -2
- package/esm/typings/src/_packages/website-crawler.index.d.ts +2 -2
- package/esm/typings/src/cli/cli-commands/make.d.ts +0 -1
- package/esm/typings/src/cli/cli-commands/run.d.ts +14 -0
- package/esm/typings/src/cli/promptbookCli.d.ts +1 -0
- package/esm/typings/src/cli/test/ptbk.d.ts +5 -2
- package/esm/typings/src/collection/collectionToJson.test.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
- package/esm/typings/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +11 -0
- package/esm/typings/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +2 -2
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +1 -1
- package/esm/typings/src/commands/index.d.ts +1 -1
- package/esm/typings/src/config.d.ts +6 -0
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +3 -3
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +2 -2
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +2 -2
- package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +1 -1
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +7 -7
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +1 -1
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +1 -1
- package/esm/typings/src/storage/blackhole/BlackholeStorage.d.ts +33 -0
- package/esm/typings/src/storage/memory/MemoryStorage.d.ts +1 -1
- package/esm/typings/src/storage/{memory/utils → utils}/PrefixStorage.d.ts +1 -1
- package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +6 -4
- package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +1 -1
- package/esm/typings/src/types/Prompt.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +2 -2
- package/esm/typings/src/version.d.ts +13 -2
- package/package.json +1 -1
- package/umd/index.umd.js +246 -301
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/commands/PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts +0 -11
- package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +0 -9
- /package/esm/typings/src/commands/{PROMPTBOOK_VERSION/promptbookVersionCommand.test.d.ts → BOOK_VERSION/bookVersionCommand.test.d.ts} +0 -0
- /package/esm/typings/src/storage/{memory → local-storage}/utils/makePromptbookStorageFromWebStorage.d.ts +0 -0
package/README.md
CHANGED
|
@@ -52,8 +52,6 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
52
52
|
|
|
53
53
|
## 🤍 The Promptbook Whitepaper
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
55
|
If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 3, or whatever, it doesn't matter how you integrate it. Whether it's calling a REST API directly, using the SDK, hardcoding the prompt into the source code, or importing a text file, the process remains the same.
|
|
58
56
|
|
|
59
57
|
But often you will struggle with the **limitations of LLMs**, such as **hallucinations, off-topic responses, poor quality output, language and prompt drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w𝒆𝐢rd resp0nses**. When this happens, you generally have three options:
|
|
@@ -74,63 +72,65 @@ In all of these situations, but especially in 3., the **✨ Promptbook can make
|
|
|
74
72
|
|
|
75
73
|
|
|
76
74
|
|
|
77
|
-
## 💜 The Promptbook Project
|
|
78
75
|
|
|
79
76
|
|
|
80
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
|
+
|
|
81
82
|
<table>
|
|
82
|
-
<
|
|
83
|
+
<thead>
|
|
83
84
|
<tr>
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
<
|
|
85
|
+
<th>Project</th>
|
|
86
|
+
<th>Description</th>
|
|
87
|
+
<th>Link</th>
|
|
87
88
|
</tr>
|
|
89
|
+
</thead>
|
|
90
|
+
<tbody>
|
|
88
91
|
<tr>
|
|
89
|
-
<td>
|
|
90
|
-
<td>Promptbook
|
|
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>
|
|
91
95
|
</tr>
|
|
92
96
|
<tr>
|
|
93
97
|
<td>Book language</td>
|
|
94
98
|
<td>
|
|
95
|
-
Book is a markdown-like language to define projects, pipelines, knowledge
|
|
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
|
|
96
100
|
</td>
|
|
97
101
|
</tr>
|
|
98
102
|
<tr>
|
|
99
103
|
<td>Promptbook typescript project</td>
|
|
100
104
|
<td>Implementation of Promptbook in TypeScript published into multiple packages to NPM</td>
|
|
101
|
-
<td>https://github.com/webgptorg/promptbook</td>
|
|
105
|
+
<td>https://github.com/webgptorg/promptbook + Multiple packages on NPM</td>
|
|
102
106
|
</tr>
|
|
103
107
|
<tr>
|
|
104
108
|
<td>Promptbook studio</td>
|
|
105
|
-
<td>
|
|
106
|
-
<td rowspan=2>https://github.com/hejny/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>
|
|
107
111
|
</tr>
|
|
108
112
|
<tr>
|
|
109
113
|
<td>Promptbook miniapps</td>
|
|
110
|
-
<td>
|
|
114
|
+
<td>Builder of LLM miniapps from book notation</td>
|
|
111
115
|
</tr>
|
|
112
116
|
</tbody>
|
|
113
117
|
</table>
|
|
114
118
|
|
|
115
|
-
## 💙 Book language _(for prompt-engineer)_
|
|
116
119
|
|
|
117
|
-
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.
|
|
118
120
|
|
|
121
|
+
## 💙 Book language _(for prompt-engineer)_
|
|
119
122
|
|
|
120
123
|
|
|
121
|
-
```markdown
|
|
122
|
-
# 🌟 My first Book
|
|
123
124
|
|
|
124
|
-
- INPUT PARAMETER {subject}
|
|
125
|
-
- OUTPUT PARAMETER {article}
|
|
126
125
|
|
|
127
|
-
##
|
|
126
|
+
## 💙 The blueprint of book language
|
|
128
127
|
|
|
129
|
-
|
|
128
|
+
Following is the documentation and blueprint of the Book language.
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
### Example
|
|
132
131
|
|
|
133
|
-
|
|
132
|
+
```markdown
|
|
133
|
+
# 🌟 My first Book
|
|
134
134
|
|
|
135
135
|
- PERSONA Jane, marketing specialist with prior experience in writing articles about technology and artificial intelligence
|
|
136
136
|
- KNOWLEDGE https://ptbk.io
|
|
@@ -139,11 +139,65 @@ Promptbook [pipelines](https://github.com/webgptorg/promptbook/discussions/64) a
|
|
|
139
139
|
- EXPECT MAX 1 Paragraph
|
|
140
140
|
|
|
141
141
|
> Write an article about the future of artificial intelligence in the next 10 years and how metalanguages will change the way AI is used in the world.
|
|
142
|
-
> Look specifically at the impact of
|
|
142
|
+
> Look specifically at the impact of Promptbook on the AI industry.
|
|
143
143
|
|
|
144
144
|
-> {article}
|
|
145
145
|
```
|
|
146
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 `.book.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
|
+
|
|
147
201
|
## 📦 Packages _(for developers)_
|
|
148
202
|
|
|
149
203
|
This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -182,15 +236,59 @@ Or you can install them separately:
|
|
|
182
236
|
|
|
183
237
|
|
|
184
238
|
|
|
185
|
-
## 📚 Dictionary
|
|
186
239
|
|
|
187
|
-
The following glossary is used to clarify certain concepts:
|
|
188
240
|
|
|
189
|
-
### Basic terms
|
|
190
241
|
|
|
242
|
+
## 📚 Dictionary
|
|
243
|
+
|
|
244
|
+
### 📚 Dictionary
|
|
191
245
|
|
|
246
|
+
The following glossary is used to clarify certain concepts:
|
|
192
247
|
|
|
193
|
-
|
|
248
|
+
#### General LLM / AI terms
|
|
249
|
+
|
|
250
|
+
- **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.
|
|
251
|
+
- **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.
|
|
252
|
+
- **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.
|
|
253
|
+
- **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.
|
|
254
|
+
- **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.
|
|
255
|
+
- **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.
|
|
256
|
+
- **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.
|
|
257
|
+
- **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.
|
|
258
|
+
|
|
259
|
+
_Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
260
|
+
|
|
261
|
+
#### Promptbook core
|
|
262
|
+
|
|
263
|
+
- **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).
|
|
264
|
+
- **Jobs**
|
|
265
|
+
- **Task**
|
|
266
|
+
- **Subtask**
|
|
267
|
+
- **Workforce**
|
|
268
|
+
- **Persona**
|
|
269
|
+
- **Team**
|
|
270
|
+
- **Role**
|
|
271
|
+
- **Knowledge**
|
|
272
|
+
- **Public**
|
|
273
|
+
- **Private**
|
|
274
|
+
- **Protected**
|
|
275
|
+
- **Instruments**
|
|
276
|
+
- **Actions**
|
|
277
|
+
|
|
278
|
+
#### Book language
|
|
279
|
+
|
|
280
|
+
- **Book file**
|
|
281
|
+
- **Section**
|
|
282
|
+
- **Heading**
|
|
283
|
+
- **Description**
|
|
284
|
+
- **Command**
|
|
285
|
+
- **Block**
|
|
286
|
+
- **Return statement**
|
|
287
|
+
- **Comment**
|
|
288
|
+
- **Import**
|
|
289
|
+
- **Scope**
|
|
290
|
+
|
|
291
|
+
#### 💯 Core concepts
|
|
194
292
|
|
|
195
293
|
- [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|
|
196
294
|
- [📯 Pipeline](https://github.com/webgptorg/promptbook/discussions/64)
|
|
@@ -203,7 +301,7 @@ The following glossary is used to clarify certain concepts:
|
|
|
203
301
|
- [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29)
|
|
204
302
|
- [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32)
|
|
205
303
|
|
|
206
|
-
|
|
304
|
+
##### Advanced concepts
|
|
207
305
|
|
|
208
306
|
- [📚 Knowledge (Retrieval-augmented generation)](https://github.com/webgptorg/promptbook/discussions/41)
|
|
209
307
|
- [🌏 Remote server](https://github.com/webgptorg/promptbook/discussions/89)
|
|
@@ -218,6 +316,13 @@ The following glossary is used to clarify certain concepts:
|
|
|
218
316
|
- [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
|
|
219
317
|
- [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
|
|
220
318
|
|
|
319
|
+
### Terms specific to Promptbook TypeScript implementation
|
|
320
|
+
|
|
321
|
+
- Anonymous mode
|
|
322
|
+
- Application mode
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
221
326
|
## 🔌 Usage in Typescript / Javascript
|
|
222
327
|
|
|
223
328
|
- [Simple usage](./examples/usage/simple-script)
|