@promptbook/cli 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/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
|
@@ -109,8 +109,6 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
109
109
|
|
|
110
110
|
## 🤍 The Promptbook Whitepaper
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
112
|
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.
|
|
115
113
|
|
|
116
114
|
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:
|
|
@@ -131,63 +129,65 @@ In all of these situations, but especially in 3., the **✨ Promptbook can make
|
|
|
131
129
|
|
|
132
130
|
|
|
133
131
|
|
|
134
|
-
## 💜 The Promptbook Project
|
|
135
132
|
|
|
136
133
|
|
|
137
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
|
+
|
|
138
139
|
<table>
|
|
139
|
-
<
|
|
140
|
+
<thead>
|
|
140
141
|
<tr>
|
|
141
|
-
<
|
|
142
|
-
<
|
|
143
|
-
<
|
|
142
|
+
<th>Project</th>
|
|
143
|
+
<th>Description</th>
|
|
144
|
+
<th>Link</th>
|
|
144
145
|
</tr>
|
|
146
|
+
</thead>
|
|
147
|
+
<tbody>
|
|
145
148
|
<tr>
|
|
146
|
-
<td>
|
|
147
|
-
<td>Promptbook
|
|
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>
|
|
148
152
|
</tr>
|
|
149
153
|
<tr>
|
|
150
154
|
<td>Book language</td>
|
|
151
155
|
<td>
|
|
152
|
-
Book is a markdown-like language to define projects, pipelines, knowledge
|
|
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
|
|
153
157
|
</td>
|
|
154
158
|
</tr>
|
|
155
159
|
<tr>
|
|
156
160
|
<td>Promptbook typescript project</td>
|
|
157
161
|
<td>Implementation of Promptbook in TypeScript published into multiple packages to NPM</td>
|
|
158
|
-
<td>https://github.com/webgptorg/promptbook</td>
|
|
162
|
+
<td>https://github.com/webgptorg/promptbook + Multiple packages on NPM</td>
|
|
159
163
|
</tr>
|
|
160
164
|
<tr>
|
|
161
165
|
<td>Promptbook studio</td>
|
|
162
|
-
<td>
|
|
163
|
-
<td rowspan=2>https://github.com/hejny/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>
|
|
164
168
|
</tr>
|
|
165
169
|
<tr>
|
|
166
170
|
<td>Promptbook miniapps</td>
|
|
167
|
-
<td>
|
|
171
|
+
<td>Builder of LLM miniapps from book notation</td>
|
|
168
172
|
</tr>
|
|
169
173
|
</tbody>
|
|
170
174
|
</table>
|
|
171
175
|
|
|
172
|
-
## 💙 Book language _(for prompt-engineer)_
|
|
173
176
|
|
|
174
|
-
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.
|
|
175
177
|
|
|
178
|
+
## 💙 Book language _(for prompt-engineer)_
|
|
176
179
|
|
|
177
180
|
|
|
178
|
-
```markdown
|
|
179
|
-
# 🌟 My first Book
|
|
180
181
|
|
|
181
|
-
- INPUT PARAMETER {subject}
|
|
182
|
-
- OUTPUT PARAMETER {article}
|
|
183
182
|
|
|
184
|
-
##
|
|
183
|
+
## 💙 The blueprint of book language
|
|
185
184
|
|
|
186
|
-
|
|
185
|
+
Following is the documentation and blueprint of the Book language.
|
|
187
186
|
|
|
188
|
-
|
|
187
|
+
### Example
|
|
189
188
|
|
|
190
|
-
|
|
189
|
+
```markdown
|
|
190
|
+
# 🌟 My first Book
|
|
191
191
|
|
|
192
192
|
- PERSONA Jane, marketing specialist with prior experience in writing articles about technology and artificial intelligence
|
|
193
193
|
- KNOWLEDGE https://ptbk.io
|
|
@@ -196,11 +196,65 @@ Promptbook [pipelines](https://github.com/webgptorg/promptbook/discussions/64) a
|
|
|
196
196
|
- EXPECT MAX 1 Paragraph
|
|
197
197
|
|
|
198
198
|
> 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.
|
|
199
|
-
> Look specifically at the impact of
|
|
199
|
+
> Look specifically at the impact of Promptbook on the AI industry.
|
|
200
200
|
|
|
201
201
|
-> {article}
|
|
202
202
|
```
|
|
203
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
|
+
|
|
204
258
|
## 📦 Packages _(for developers)_
|
|
205
259
|
|
|
206
260
|
This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -239,15 +293,66 @@ Or you can install them separately:
|
|
|
239
293
|
|
|
240
294
|
|
|
241
295
|
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
242
299
|
## 📚 Dictionary
|
|
243
300
|
|
|
244
|
-
The following glossary is used to clarify certain concepts:
|
|
245
301
|
|
|
246
|
-
### Basic terms
|
|
247
302
|
|
|
248
303
|
|
|
249
304
|
|
|
250
|
-
|
|
305
|
+
|
|
306
|
+
### 📚 Dictionary
|
|
307
|
+
|
|
308
|
+
The following glossary is used to clarify certain concepts:
|
|
309
|
+
|
|
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
|
|
251
356
|
|
|
252
357
|
- [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|
|
253
358
|
- [📯 Pipeline](https://github.com/webgptorg/promptbook/discussions/64)
|
|
@@ -260,7 +365,7 @@ The following glossary is used to clarify certain concepts:
|
|
|
260
365
|
- [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29)
|
|
261
366
|
- [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32)
|
|
262
367
|
|
|
263
|
-
|
|
368
|
+
##### Advanced concepts
|
|
264
369
|
|
|
265
370
|
- [📚 Knowledge (Retrieval-augmented generation)](https://github.com/webgptorg/promptbook/discussions/41)
|
|
266
371
|
- [🌏 Remote server](https://github.com/webgptorg/promptbook/discussions/89)
|
|
@@ -275,6 +380,15 @@ The following glossary is used to clarify certain concepts:
|
|
|
275
380
|
- [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
|
|
276
381
|
- [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
|
|
277
382
|
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
### Terms specific to Promptbook TypeScript implementation
|
|
386
|
+
|
|
387
|
+
- Anonymous mode
|
|
388
|
+
- Application mode
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
278
392
|
## 🔌 Usage in Typescript / Javascript
|
|
279
393
|
|
|
280
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
|
|