@promptbook/legacy-documents 0.74.0-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.
- package/README.md +143 -29
- package/esm/index.es.js +218 -288
- 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/commands/{PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts → BOOK_VERSION/BookVersionCommand.d.ts} +4 -4
- package/esm/typings/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +9 -0
- 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/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/version.d.ts +13 -2
- package/package.json +2 -2
- package/umd/index.umd.js +219 -288
- package/umd/index.umd.js.map +1 -1
- 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
|
@@ -54,8 +54,6 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
54
54
|
|
|
55
55
|
## 🤍 The Promptbook Whitepaper
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
57
|
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.
|
|
60
58
|
|
|
61
59
|
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:
|
|
@@ -76,63 +74,65 @@ In all of these situations, but especially in 3., the **✨ Promptbook can make
|
|
|
76
74
|
|
|
77
75
|
|
|
78
76
|
|
|
79
|
-
## 💜 The Promptbook Project
|
|
80
77
|
|
|
81
78
|
|
|
82
79
|
|
|
80
|
+
## 💜 The Promptbook Project
|
|
81
|
+
|
|
82
|
+
Promptbook project is ecosystem of multiple projects and tools, following is a list of most important pieces of the project:
|
|
83
|
+
|
|
83
84
|
<table>
|
|
84
|
-
<
|
|
85
|
+
<thead>
|
|
85
86
|
<tr>
|
|
86
|
-
<
|
|
87
|
-
<
|
|
88
|
-
<
|
|
87
|
+
<th>Project</th>
|
|
88
|
+
<th>Description</th>
|
|
89
|
+
<th>Link</th>
|
|
89
90
|
</tr>
|
|
91
|
+
</thead>
|
|
92
|
+
<tbody>
|
|
90
93
|
<tr>
|
|
91
|
-
<td>
|
|
92
|
-
<td>Promptbook
|
|
94
|
+
<td>Core</td>
|
|
95
|
+
<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>
|
|
96
|
+
<td rowspan=2>https://ptbk.io<br/>https://github.com/webgptorg/book</td>
|
|
93
97
|
</tr>
|
|
94
98
|
<tr>
|
|
95
99
|
<td>Book language</td>
|
|
96
100
|
<td>
|
|
97
|
-
Book is a markdown-like language to define projects, pipelines, knowledge
|
|
101
|
+
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
|
|
98
102
|
</td>
|
|
99
103
|
</tr>
|
|
100
104
|
<tr>
|
|
101
105
|
<td>Promptbook typescript project</td>
|
|
102
106
|
<td>Implementation of Promptbook in TypeScript published into multiple packages to NPM</td>
|
|
103
|
-
<td>https://github.com/webgptorg/promptbook</td>
|
|
107
|
+
<td>https://github.com/webgptorg/promptbook + Multiple packages on NPM</td>
|
|
104
108
|
</tr>
|
|
105
109
|
<tr>
|
|
106
110
|
<td>Promptbook studio</td>
|
|
107
|
-
<td>
|
|
108
|
-
<td rowspan=2>https://github.com/hejny/promptbook-studio</td>
|
|
111
|
+
<td>No-code studio to write book without need to write even the markdown</td>
|
|
112
|
+
<td rowspan=2>https://promptbook.studio<br/>https://github.com/hejny/promptbook-studio</td>
|
|
109
113
|
</tr>
|
|
110
114
|
<tr>
|
|
111
115
|
<td>Promptbook miniapps</td>
|
|
112
|
-
<td>
|
|
116
|
+
<td>Builder of LLM miniapps from book notation</td>
|
|
113
117
|
</tr>
|
|
114
118
|
</tbody>
|
|
115
119
|
</table>
|
|
116
120
|
|
|
117
|
-
## 💙 Book language _(for prompt-engineer)_
|
|
118
121
|
|
|
119
|
-
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.
|
|
120
122
|
|
|
123
|
+
## 💙 Book language _(for prompt-engineer)_
|
|
121
124
|
|
|
122
125
|
|
|
123
|
-
```markdown
|
|
124
|
-
# 🌟 My first Book
|
|
125
126
|
|
|
126
|
-
- INPUT PARAMETER {subject}
|
|
127
|
-
- OUTPUT PARAMETER {article}
|
|
128
127
|
|
|
129
|
-
##
|
|
128
|
+
## 💙 The blueprint of book language
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
Following is the documentation and blueprint of the Book language.
|
|
132
131
|
|
|
133
|
-
|
|
132
|
+
### Example
|
|
134
133
|
|
|
135
|
-
|
|
134
|
+
```markdown
|
|
135
|
+
# 🌟 My first Book
|
|
136
136
|
|
|
137
137
|
- PERSONA Jane, marketing specialist with prior experience in writing articles about technology and artificial intelligence
|
|
138
138
|
- KNOWLEDGE https://ptbk.io
|
|
@@ -141,11 +141,65 @@ Promptbook [pipelines](https://github.com/webgptorg/promptbook/discussions/64) a
|
|
|
141
141
|
- EXPECT MAX 1 Paragraph
|
|
142
142
|
|
|
143
143
|
> 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.
|
|
144
|
-
> Look specifically at the impact of
|
|
144
|
+
> Look specifically at the impact of Promptbook on the AI industry.
|
|
145
145
|
|
|
146
146
|
-> {article}
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
+
### Goals and principles of book language
|
|
150
|
+
|
|
151
|
+
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.
|
|
152
|
+
|
|
153
|
+
It has file with `.ptbk.md` or `.book` extension with `UTF-8` non BOM encoding.
|
|
154
|
+
|
|
155
|
+
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.
|
|
156
|
+
|
|
157
|
+
But unlike programming languages, it is designed to be understandable by non-programmers and non-technical people.
|
|
158
|
+
|
|
159
|
+
### Structure
|
|
160
|
+
|
|
161
|
+
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.
|
|
162
|
+
|
|
163
|
+
### Header
|
|
164
|
+
|
|
165
|
+
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.
|
|
166
|
+
|
|
167
|
+
### Parameter
|
|
168
|
+
|
|
169
|
+
Foo bar
|
|
170
|
+
|
|
171
|
+
#### Parameter names
|
|
172
|
+
|
|
173
|
+
Reserved words:
|
|
174
|
+
|
|
175
|
+
- _each command_ like `PERSONA`, `EXPECT`, `KNOWLEDGE`, etc.
|
|
176
|
+
- `content`
|
|
177
|
+
- `context`
|
|
178
|
+
- `knowledge`
|
|
179
|
+
- `examples`
|
|
180
|
+
- `modelName`
|
|
181
|
+
- `currentDate`
|
|
182
|
+
|
|
183
|
+
#### Parameter notation
|
|
184
|
+
|
|
185
|
+
### Template
|
|
186
|
+
|
|
187
|
+
Todo todo
|
|
188
|
+
|
|
189
|
+
### Command
|
|
190
|
+
|
|
191
|
+
Todo todo
|
|
192
|
+
|
|
193
|
+
### Block
|
|
194
|
+
|
|
195
|
+
Todo todo
|
|
196
|
+
|
|
197
|
+
### Return parameter
|
|
198
|
+
|
|
199
|
+
### Examples
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
149
203
|
## 📦 Packages _(for developers)_
|
|
150
204
|
|
|
151
205
|
This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -184,15 +238,66 @@ Or you can install them separately:
|
|
|
184
238
|
|
|
185
239
|
|
|
186
240
|
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
187
244
|
## 📚 Dictionary
|
|
188
245
|
|
|
189
|
-
The following glossary is used to clarify certain concepts:
|
|
190
246
|
|
|
191
|
-
### Basic terms
|
|
192
247
|
|
|
193
248
|
|
|
194
249
|
|
|
195
|
-
|
|
250
|
+
|
|
251
|
+
### 📚 Dictionary
|
|
252
|
+
|
|
253
|
+
The following glossary is used to clarify certain concepts:
|
|
254
|
+
|
|
255
|
+
#### General LLM / AI terms
|
|
256
|
+
|
|
257
|
+
- **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.
|
|
258
|
+
- **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.
|
|
259
|
+
- **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.
|
|
260
|
+
- **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.
|
|
261
|
+
- **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.
|
|
262
|
+
- **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.
|
|
263
|
+
- **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.
|
|
264
|
+
- **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.
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
_Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
269
|
+
|
|
270
|
+
#### Promptbook core
|
|
271
|
+
|
|
272
|
+
- **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).
|
|
273
|
+
- **Jobs**
|
|
274
|
+
- **Task**
|
|
275
|
+
- **Subtask**
|
|
276
|
+
- **Workforce**
|
|
277
|
+
- **Persona**
|
|
278
|
+
- **Team**
|
|
279
|
+
- **Role**
|
|
280
|
+
- **Knowledge**
|
|
281
|
+
- **Public**
|
|
282
|
+
- **Private**
|
|
283
|
+
- **Protected**
|
|
284
|
+
- **Instruments**
|
|
285
|
+
- **Actions**
|
|
286
|
+
|
|
287
|
+
#### Book language
|
|
288
|
+
|
|
289
|
+
- **Book file**
|
|
290
|
+
- **Section**
|
|
291
|
+
- **Heading**
|
|
292
|
+
- **Description**
|
|
293
|
+
- **Command**
|
|
294
|
+
- **Block**
|
|
295
|
+
- **Return statement**
|
|
296
|
+
- **Comment**
|
|
297
|
+
- **Import**
|
|
298
|
+
- **Scope**
|
|
299
|
+
|
|
300
|
+
#### 💯 Core concepts
|
|
196
301
|
|
|
197
302
|
- [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|
|
198
303
|
- [📯 Pipeline](https://github.com/webgptorg/promptbook/discussions/64)
|
|
@@ -205,7 +310,7 @@ The following glossary is used to clarify certain concepts:
|
|
|
205
310
|
- [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29)
|
|
206
311
|
- [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32)
|
|
207
312
|
|
|
208
|
-
|
|
313
|
+
##### Advanced concepts
|
|
209
314
|
|
|
210
315
|
- [📚 Knowledge (Retrieval-augmented generation)](https://github.com/webgptorg/promptbook/discussions/41)
|
|
211
316
|
- [🌏 Remote server](https://github.com/webgptorg/promptbook/discussions/89)
|
|
@@ -220,6 +325,15 @@ The following glossary is used to clarify certain concepts:
|
|
|
220
325
|
- [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
|
|
221
326
|
- [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
|
|
222
327
|
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
### Terms specific to Promptbook TypeScript implementation
|
|
331
|
+
|
|
332
|
+
- Anonymous mode
|
|
333
|
+
- Application mode
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
223
337
|
## 🔌 Usage in Typescript / Javascript
|
|
224
338
|
|
|
225
339
|
- [Simple usage](./examples/usage/simple-script)
|