@promptbook/cli 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.
- package/README.md +176 -3
- package/bin/promptbook-cli.js +6 -1
- package/esm/index.es.js +1025 -449
- 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 +8 -4
- package/umd/index.umd.js +1030 -453
- 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
|
@@ -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/cli`
|
|
28
32
|
|
|
29
33
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -125,12 +129,63 @@ In all of these situations, but especially in 3., the **✨ Promptbook can make
|
|
|
125
129
|
|
|
126
130
|
|
|
127
131
|
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
## 💜 The Promptbook Project
|
|
136
|
+
|
|
137
|
+
Promptbook project is ecosystem of multiple projects and tools, following is a list of most important pieces of the project:
|
|
138
|
+
|
|
139
|
+
<table>
|
|
140
|
+
<thead>
|
|
141
|
+
<tr>
|
|
142
|
+
<th>Project</th>
|
|
143
|
+
<th>Description</th>
|
|
144
|
+
<th>Link</th>
|
|
145
|
+
</tr>
|
|
146
|
+
</thead>
|
|
147
|
+
<tbody>
|
|
148
|
+
<tr>
|
|
149
|
+
<td>Core</td>
|
|
150
|
+
<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>
|
|
151
|
+
<td rowspan=2>https://ptbk.io<br/>https://github.com/webgptorg/book</td>
|
|
152
|
+
</tr>
|
|
153
|
+
<tr>
|
|
154
|
+
<td>Book language</td>
|
|
155
|
+
<td>
|
|
156
|
+
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
|
|
157
|
+
</td>
|
|
158
|
+
</tr>
|
|
159
|
+
<tr>
|
|
160
|
+
<td>Promptbook typescript project</td>
|
|
161
|
+
<td>Implementation of Promptbook in TypeScript published into multiple packages to NPM</td>
|
|
162
|
+
<td>https://github.com/webgptorg/promptbook + Multiple packages on NPM</td>
|
|
163
|
+
</tr>
|
|
164
|
+
<tr>
|
|
165
|
+
<td>Promptbook studio</td>
|
|
166
|
+
<td>No-code studio to write book without need to write even the markdown</td>
|
|
167
|
+
<td rowspan=2>https://promptbook.studio<br/>https://github.com/hejny/promptbook-studio</td>
|
|
168
|
+
</tr>
|
|
169
|
+
<tr>
|
|
170
|
+
<td>Promptbook miniapps</td>
|
|
171
|
+
<td>Builder of LLM miniapps from book notation</td>
|
|
172
|
+
</tr>
|
|
173
|
+
</tbody>
|
|
174
|
+
</table>
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
128
178
|
## 💙 Book language _(for prompt-engineer)_
|
|
129
179
|
|
|
130
|
-
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.
|
|
131
180
|
|
|
132
181
|
|
|
133
182
|
|
|
183
|
+
## 💙 The blueprint of book language
|
|
184
|
+
|
|
185
|
+
Following is the documentation and blueprint of the Book language.
|
|
186
|
+
|
|
187
|
+
### Example
|
|
188
|
+
|
|
134
189
|
```markdown
|
|
135
190
|
# 🌟 My first Book
|
|
136
191
|
|
|
@@ -146,6 +201,60 @@ Promptbook [pipelines](https://github.com/webgptorg/promptbook/discussions/64) a
|
|
|
146
201
|
-> {article}
|
|
147
202
|
```
|
|
148
203
|
|
|
204
|
+
### Goals and principles of book language
|
|
205
|
+
|
|
206
|
+
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.
|
|
207
|
+
|
|
208
|
+
It has file with `.ptbk.md` or `.book` extension with `UTF-8` non BOM encoding.
|
|
209
|
+
|
|
210
|
+
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.
|
|
211
|
+
|
|
212
|
+
But unlike programming languages, it is designed to be understandable by non-programmers and non-technical people.
|
|
213
|
+
|
|
214
|
+
### Structure
|
|
215
|
+
|
|
216
|
+
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.
|
|
217
|
+
|
|
218
|
+
### Header
|
|
219
|
+
|
|
220
|
+
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.
|
|
221
|
+
|
|
222
|
+
### Parameter
|
|
223
|
+
|
|
224
|
+
Foo bar
|
|
225
|
+
|
|
226
|
+
#### Parameter names
|
|
227
|
+
|
|
228
|
+
Reserved words:
|
|
229
|
+
|
|
230
|
+
- _each command_ like `PERSONA`, `EXPECT`, `KNOWLEDGE`, etc.
|
|
231
|
+
- `content`
|
|
232
|
+
- `context`
|
|
233
|
+
- `knowledge`
|
|
234
|
+
- `examples`
|
|
235
|
+
- `modelName`
|
|
236
|
+
- `currentDate`
|
|
237
|
+
|
|
238
|
+
#### Parameter notation
|
|
239
|
+
|
|
240
|
+
### Template
|
|
241
|
+
|
|
242
|
+
Todo todo
|
|
243
|
+
|
|
244
|
+
### Command
|
|
245
|
+
|
|
246
|
+
Todo todo
|
|
247
|
+
|
|
248
|
+
### Block
|
|
249
|
+
|
|
250
|
+
Todo todo
|
|
251
|
+
|
|
252
|
+
### Return parameter
|
|
253
|
+
|
|
254
|
+
### Examples
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
149
258
|
## 📦 Packages _(for developers)_
|
|
150
259
|
|
|
151
260
|
This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -184,11 +293,66 @@ Or you can install them separately:
|
|
|
184
293
|
|
|
185
294
|
|
|
186
295
|
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
187
299
|
## 📚 Dictionary
|
|
188
300
|
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
### 📚 Dictionary
|
|
307
|
+
|
|
189
308
|
The following glossary is used to clarify certain concepts:
|
|
190
309
|
|
|
191
|
-
|
|
310
|
+
#### General LLM / AI terms
|
|
311
|
+
|
|
312
|
+
- **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.
|
|
313
|
+
- **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.
|
|
314
|
+
- **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.
|
|
315
|
+
- **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.
|
|
316
|
+
- **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.
|
|
317
|
+
- **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.
|
|
318
|
+
- **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.
|
|
319
|
+
- **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.
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
_Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
324
|
+
|
|
325
|
+
#### Promptbook core
|
|
326
|
+
|
|
327
|
+
- **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).
|
|
328
|
+
- **Jobs**
|
|
329
|
+
- **Task**
|
|
330
|
+
- **Subtask**
|
|
331
|
+
- **Workforce**
|
|
332
|
+
- **Persona**
|
|
333
|
+
- **Team**
|
|
334
|
+
- **Role**
|
|
335
|
+
- **Knowledge**
|
|
336
|
+
- **Public**
|
|
337
|
+
- **Private**
|
|
338
|
+
- **Protected**
|
|
339
|
+
- **Instruments**
|
|
340
|
+
- **Actions**
|
|
341
|
+
|
|
342
|
+
#### Book language
|
|
343
|
+
|
|
344
|
+
- **Book file**
|
|
345
|
+
- **Section**
|
|
346
|
+
- **Heading**
|
|
347
|
+
- **Description**
|
|
348
|
+
- **Command**
|
|
349
|
+
- **Block**
|
|
350
|
+
- **Return statement**
|
|
351
|
+
- **Comment**
|
|
352
|
+
- **Import**
|
|
353
|
+
- **Scope**
|
|
354
|
+
|
|
355
|
+
#### 💯 Core concepts
|
|
192
356
|
|
|
193
357
|
- [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|
|
194
358
|
- [📯 Pipeline](https://github.com/webgptorg/promptbook/discussions/64)
|
|
@@ -201,7 +365,7 @@ The following glossary is used to clarify certain concepts:
|
|
|
201
365
|
- [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29)
|
|
202
366
|
- [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32)
|
|
203
367
|
|
|
204
|
-
|
|
368
|
+
##### Advanced concepts
|
|
205
369
|
|
|
206
370
|
- [📚 Knowledge (Retrieval-augmented generation)](https://github.com/webgptorg/promptbook/discussions/41)
|
|
207
371
|
- [🌏 Remote server](https://github.com/webgptorg/promptbook/discussions/89)
|
|
@@ -216,6 +380,15 @@ The following glossary is used to clarify certain concepts:
|
|
|
216
380
|
- [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
|
|
217
381
|
- [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
|
|
218
382
|
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
### Terms specific to Promptbook TypeScript implementation
|
|
386
|
+
|
|
387
|
+
- Anonymous mode
|
|
388
|
+
- Application mode
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
219
392
|
## 🔌 Usage in Typescript / Javascript
|
|
220
393
|
|
|
221
394
|
- [Simple usage](./examples/usage/simple-script)
|
package/bin/promptbook-cli.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// Disable deprecation warnings programmatically
|
|
4
|
+
process.noDeprecation = true;
|
|
5
|
+
// <- TODO: !!!!!! Is this try to get rid of deprecation warnings in node v23.2.0 working?
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
8
|
+
const { _CLI } = require('../umd/index.umd.js');
|
|
4
9
|
|
|
5
10
|
_CLI._initialize();
|
|
6
11
|
|