@promptbook/cli 0.75.0-2 → 0.75.1
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 +49 -33
- package/esm/index.es.js +207 -127
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +16 -4
- package/esm/typings/src/_packages/types.index.d.ts +8 -6
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/commands/EXPECT/ExpectCommand.d.ts +1 -1
- package/esm/typings/src/commands/SECTION/SectionCommand.d.ts +1 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +0 -2
- package/esm/typings/src/config.d.ts +34 -2
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +1 -1
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +2 -2
- package/esm/typings/src/conversion/utils/extractParameterNamesFromTask.d.ts +3 -3
- package/esm/typings/src/conversion/utils/renameParameter.d.ts +2 -2
- package/esm/typings/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -1
- package/esm/typings/src/execution/ScriptExecutionTools.d.ts +1 -1
- package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +3 -0
- package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +32 -2
- package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +14 -0
- package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/index.d.ts +72 -10
- package/esm/typings/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +12 -2
- package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +12 -2
- package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +5 -4
- package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineJson/{TaskJsonCommon.d.ts → CommonTaskJson.d.ts} +13 -13
- package/esm/typings/src/pipeline/PipelineJson/DialogTaskJson.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineJson/ParameterJson.d.ts +2 -0
- package/esm/typings/src/pipeline/PipelineJson/PersonaJson.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineJson/PromptTaskJson.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineJson/ScriptTaskJson.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineJson/SimpleTaskJson.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineJson/TaskJson.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineString.d.ts +1 -1
- package/esm/typings/src/prepare/isPipelinePrepared.d.ts +1 -1
- package/esm/typings/src/prepare/prepareTasks.d.ts +5 -5
- package/esm/typings/src/types/Prompt.d.ts +3 -3
- package/esm/typings/src/types/SectionType.d.ts +21 -0
- package/esm/typings/src/types/TaskProgress.d.ts +1 -1
- package/esm/typings/src/types/TaskType.d.ts +15 -0
- package/esm/typings/src/types/typeAliases.d.ts +1 -1
- package/esm/typings/src/utils/organization/TODO_remove_as.d.ts +6 -0
- package/esm/typings/src/utils/organization/spaceTrim.d.ts +11 -0
- package/esm/typings/src/utils/parameters/extractParameterNames.d.ts +1 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +207 -127
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/commands/SECTION/SectionType.d.ts +0 -13
- /package/esm/typings/{promptbook-collection → books}/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
#  Promptbook
|
|
4
4
|
|
|
5
|
-
Build responsible, controlled and transparent applications on top of LLM models!
|
|
6
|
-
|
|
7
5
|
|
|
8
6
|
|
|
9
7
|
|
|
@@ -25,10 +23,6 @@ Build responsible, controlled and transparent applications on top of LLM models!
|
|
|
25
23
|
|
|
26
24
|
|
|
27
25
|
|
|
28
|
-
<blockquote style="color: #ff8811">
|
|
29
|
-
<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>.
|
|
30
|
-
</blockquote>
|
|
31
|
-
|
|
32
26
|
## 📦 Package `@promptbook/cli`
|
|
33
27
|
|
|
34
28
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -54,10 +48,10 @@ CLI utils for Promptbook. After install you can use `promptbook` command in term
|
|
|
54
48
|
You can prebuild your own Promptbook library with `ptbk make` command:
|
|
55
49
|
|
|
56
50
|
```bash
|
|
57
|
-
npx ptbk make ./
|
|
51
|
+
npx ptbk make ./books --format typescript --verbose
|
|
58
52
|
```
|
|
59
53
|
|
|
60
|
-
This will emit `index.ts` with `getPipelineCollection` function file in `
|
|
54
|
+
This will emit `index.ts` with `getPipelineCollection` function file in `books` directory.
|
|
61
55
|
|
|
62
56
|
Then just use it:
|
|
63
57
|
|
|
@@ -65,7 +59,7 @@ Then just use it:
|
|
|
65
59
|
import { createPipelineExecutor, assertsExecutionSuccessful } from '@promptbook/core';
|
|
66
60
|
import { $provideExecutionToolsForNode } from '@promptbook/node';
|
|
67
61
|
import { $provideFilesystemForNode } from '@promptbook/node';
|
|
68
|
-
import { getPipelineCollection } from './
|
|
62
|
+
import { getPipelineCollection } from './books'; // <- Importing from pre-built library
|
|
69
63
|
import { JavascriptExecutionTools } from '@promptbook/execute-javascript';
|
|
70
64
|
import { OpenAiExecutionTools } from '@promptbook/openai';
|
|
71
65
|
|
|
@@ -108,28 +102,33 @@ This will prettify all promptbooks in `promptbook` directory and adds Mermaid gr
|
|
|
108
102
|
|
|
109
103
|
Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
110
104
|
|
|
111
|
-
## 🤍 The Promptbook Whitepaper
|
|
112
105
|
|
|
113
|
-
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.
|
|
114
106
|
|
|
115
|
-
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:
|
|
116
107
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
108
|
+
## 🤍 The Book Abstract
|
|
109
|
+
|
|
110
|
+
**It's time for a paradigm shift! The future of software is in plain English, French or Latin.**
|
|
111
|
+
|
|
112
|
+
During the computer revolution, we have seen [multiple generations of computer languages](https://github.com/webgptorg/promptbook/discussions/180), from the physical rewiring of the vacuum tubes through low-level machine code to the high-level languages like Python or JavaScript. And now, we're on the edge of the **next revolution**!
|
|
113
|
+
|
|
114
|
+
It's a revolution of writing software in plain human language that is understandable and executable by both humans and machines – and it's going to change everything!
|
|
115
|
+
|
|
116
|
+
The incredible growth in power of microprocessors and the Moore's Law have been the driving force behind the ever-more powerful languages, and it's been an amazing journey! Similarly, the large language models (like GPT or Claude) are the next big thing in language technology, and they're set to transform the way we interact with computers.
|
|
120
117
|
|
|
121
|
-
|
|
118
|
+
This shift is going to happen, whether we are ready for it or not. Our mission is to make it excellently, not just good.
|
|
122
119
|
|
|
123
|
-
|
|
124
|
-
- Book allows you to **focus on the business** logic without having to write code or deal with the technicalities of LLMs.
|
|
125
|
-
- **Forget** about **low-level details** like choosing the right model, tokens, context size, `temperature`, `top-k`, `top-p`, or kernel sampling. **Just write your intent** and [**persona**](https://github.com/webgptorg/promptbook/discussions/22) who should be responsible for the task and let the library do the rest.
|
|
126
|
-
- We have built-in **orchestration** of [pipeline](https://github.com/webgptorg/promptbook/discussions/64) execution and many tools to make the process easier, more reliable, and more efficient, such as caching, [compilation+preparation](https://github.com/webgptorg/promptbook/discussions/78), [just-in-time fine-tuning](https://github.com/webgptorg/promptbook/discussions/33), [expectation-aware generation](https://github.com/webgptorg/promptbook/discussions/37), [agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39), and more.
|
|
127
|
-
- Sometimes even the best prompts with the best framework like Promptbook `:)` can't avoid the problems. In this case, the library has built-in **[anomaly detection](https://github.com/webgptorg/promptbook/discussions/40) and logging** to help you find and fix the problems.
|
|
128
|
-
- Versioning is build in. You can test multiple **A/B versions** of pipelines and see which one works best.
|
|
129
|
-
- Promptbook is designed to use [**RAG** (Retrieval-Augmented Generation)](https://github.com/webgptorg/promptbook/discussions/41) and other advanced techniques to bring the context of your business to generic LLM. You can use **knowledge** to improve the quality of the output.
|
|
120
|
+
**Join us in this journey!**
|
|
130
121
|
|
|
131
122
|
|
|
132
123
|
|
|
124
|
+
## 🚀 Get started
|
|
125
|
+
|
|
126
|
+
Take a look at the simple starter kit with books integrated into the **Hello World** sample applications:
|
|
127
|
+
|
|
128
|
+
- [Hello Book](https://github.com/webgptorg/hello-world)
|
|
129
|
+
- [Hello Book in Node.js](https://github.com/webgptorg/hello-world-node-js)
|
|
130
|
+
- [Hello Book in Next.js](https://github.com/webgptorg/hello-world-next-js)
|
|
131
|
+
|
|
133
132
|
|
|
134
133
|
|
|
135
134
|
|
|
@@ -148,7 +147,7 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
|
|
|
148
147
|
<tbody>
|
|
149
148
|
<tr>
|
|
150
149
|
<td>Core</td>
|
|
151
|
-
<td>Promptbook
|
|
150
|
+
<td>Promptbook Core is a description and documentation of the basic concepts, ideas and inner workings of how Promptbook should be implemented, and defines what features must be describable by book language.</td>
|
|
152
151
|
<td rowspan=2>https://ptbk.io<br/>https://github.com/webgptorg/book</td>
|
|
153
152
|
</tr>
|
|
154
153
|
<tr>
|
|
@@ -159,17 +158,23 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
|
|
|
159
158
|
</tr>
|
|
160
159
|
<tr>
|
|
161
160
|
<td>Promptbook typescript project</td>
|
|
162
|
-
<td>
|
|
161
|
+
<td>Promptbook implementation in TypeScript released as multiple NPM packages</td>
|
|
163
162
|
<td>https://github.com/webgptorg/promptbook + Multiple packages on NPM</td>
|
|
164
163
|
</tr>
|
|
165
164
|
<tr>
|
|
166
165
|
<td>Promptbook studio</td>
|
|
167
|
-
<td>
|
|
168
|
-
<td
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
<td>
|
|
166
|
+
<td>Studio to write Books and instantly publish them as miniapps</td>
|
|
167
|
+
<td>
|
|
168
|
+
https://promptbook.studio<br/>
|
|
169
|
+
https://github.com/hejny/promptbook-studio</td>
|
|
170
|
+
</tr><tr>
|
|
171
|
+
<td>Hello World</td>
|
|
172
|
+
<td>Simple starter kit with Books integrated into the sample applications</td>
|
|
173
|
+
<td>
|
|
174
|
+
https://github.com/webgptorg/hello-world<br/>
|
|
175
|
+
https://github.com/webgptorg/hello-world-node-js<br/>
|
|
176
|
+
https://github.com/webgptorg/hello-world-next-js
|
|
177
|
+
</td>
|
|
173
178
|
</tr>
|
|
174
179
|
</tbody>
|
|
175
180
|
</table>
|
|
@@ -238,7 +243,9 @@ Reserved words:
|
|
|
238
243
|
|
|
239
244
|
#### Parameter notation
|
|
240
245
|
|
|
241
|
-
###
|
|
246
|
+
### Task
|
|
247
|
+
|
|
248
|
+
### Task type
|
|
242
249
|
|
|
243
250
|
Todo todo
|
|
244
251
|
|
|
@@ -299,6 +306,11 @@ Or you can install them separately:
|
|
|
299
306
|
|
|
300
307
|
## 📚 Dictionary
|
|
301
308
|
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
302
314
|
### 📚 Dictionary
|
|
303
315
|
|
|
304
316
|
The following glossary is used to clarify certain concepts:
|
|
@@ -314,6 +326,8 @@ The following glossary is used to clarify certain concepts:
|
|
|
314
326
|
- **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.
|
|
315
327
|
- **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.
|
|
316
328
|
|
|
329
|
+
|
|
330
|
+
|
|
317
331
|
_Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
318
332
|
|
|
319
333
|
#### Promptbook core
|
|
@@ -350,7 +364,7 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
|
|
|
350
364
|
|
|
351
365
|
- [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|
|
352
366
|
- [📯 Pipeline](https://github.com/webgptorg/promptbook/discussions/64)
|
|
353
|
-
- [
|
|
367
|
+
- [🙇♂️ Tasks and pipeline sections](https://github.com/webgptorg/promptbook/discussions/88)
|
|
354
368
|
- [🤼 Personas](https://github.com/webgptorg/promptbook/discussions/22)
|
|
355
369
|
- [⭕ Parameters](https://github.com/webgptorg/promptbook/discussions/83)
|
|
356
370
|
- [🚀 Pipeline execution](https://github.com/webgptorg/promptbook/discussions/84)
|
|
@@ -374,6 +388,8 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
|
|
|
374
388
|
- [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
|
|
375
389
|
- [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
|
|
376
390
|
|
|
391
|
+
|
|
392
|
+
|
|
377
393
|
### Terms specific to Promptbook TypeScript implementation
|
|
378
394
|
|
|
379
395
|
- Anonymous mode
|