@promptbook/node 0.73.0 → 0.74.0-2
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 +130 -3
- package/esm/index.es.js +230 -353
- 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 +2 -2
- 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 +13 -0
- package/esm/typings/src/cli/promptbookCli.d.ts +1 -0
- package/esm/typings/src/cli/test/ptbk.d.ts +4 -1
- 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/version.d.ts +13 -2
- package/package.json +2 -2
- package/umd/index.umd.js +231 -353
- 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/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/node`
|
|
28
32
|
|
|
29
33
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -52,6 +56,8 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
52
56
|
|
|
53
57
|
## 🤍 The Promptbook Whitepaper
|
|
54
58
|
|
|
59
|
+
|
|
60
|
+
|
|
55
61
|
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.
|
|
56
62
|
|
|
57
63
|
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:
|
|
@@ -72,6 +78,52 @@ In all of these situations, but especially in 3., the **✨ Promptbook can make
|
|
|
72
78
|
|
|
73
79
|
|
|
74
80
|
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## 💜 The Promptbook Project
|
|
85
|
+
|
|
86
|
+
Promptbook project is ecosystem of multiple projects and tools, following is a list of most important pieces of the project:
|
|
87
|
+
|
|
88
|
+
<table>
|
|
89
|
+
<thead>
|
|
90
|
+
<tr>
|
|
91
|
+
<th>Project</th>
|
|
92
|
+
<th>Description</th>
|
|
93
|
+
<th>Link</th>
|
|
94
|
+
</tr>
|
|
95
|
+
</thead>
|
|
96
|
+
<tbody>
|
|
97
|
+
<tr>
|
|
98
|
+
<td>Core</td>
|
|
99
|
+
<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>
|
|
100
|
+
<td rowspan=2>https://ptbk.io<br/>https://github.com/webgptorg/book</td>
|
|
101
|
+
</tr>
|
|
102
|
+
<tr>
|
|
103
|
+
<td>Book language</td>
|
|
104
|
+
<td>
|
|
105
|
+
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
|
|
106
|
+
</td>
|
|
107
|
+
</tr>
|
|
108
|
+
<tr>
|
|
109
|
+
<td>Promptbook typescript project</td>
|
|
110
|
+
<td>Implementation of Promptbook in TypeScript published into multiple packages to NPM</td>
|
|
111
|
+
<td>https://github.com/webgptorg/promptbook + Multiple packages on NPM</td>
|
|
112
|
+
</tr>
|
|
113
|
+
<tr>
|
|
114
|
+
<td>Promptbook studio</td>
|
|
115
|
+
<td>No-code studio to write book without need to write even the markdown</td>
|
|
116
|
+
<td rowspan=2>https://promptbook.studio<br/>https://github.com/hejny/promptbook-studio</td>
|
|
117
|
+
</tr>
|
|
118
|
+
<tr>
|
|
119
|
+
<td>Promptbook miniapps</td>
|
|
120
|
+
<td>Builder of LLM miniapps from book notation</td>
|
|
121
|
+
</tr>
|
|
122
|
+
</tbody>
|
|
123
|
+
</table>
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
75
127
|
## 💙 Book language _(for prompt-engineer)_
|
|
76
128
|
|
|
77
129
|
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.
|
|
@@ -81,6 +133,17 @@ Promptbook [pipelines](https://github.com/webgptorg/promptbook/discussions/64) a
|
|
|
81
133
|
```markdown
|
|
82
134
|
# 🌟 My first Book
|
|
83
135
|
|
|
136
|
+
- INPUT PARAMETER {subject}
|
|
137
|
+
- OUTPUT PARAMETER {article}
|
|
138
|
+
|
|
139
|
+
## Sample subject
|
|
140
|
+
|
|
141
|
+
> Promptbook
|
|
142
|
+
|
|
143
|
+
-> {subject}
|
|
144
|
+
|
|
145
|
+
## Write an article
|
|
146
|
+
|
|
84
147
|
- PERSONA Jane, marketing specialist with prior experience in writing articles about technology and artificial intelligence
|
|
85
148
|
- KNOWLEDGE https://ptbk.io
|
|
86
149
|
- KNOWLEDGE ./promptbook.pdf
|
|
@@ -88,7 +151,7 @@ Promptbook [pipelines](https://github.com/webgptorg/promptbook/discussions/64) a
|
|
|
88
151
|
- EXPECT MAX 1 Paragraph
|
|
89
152
|
|
|
90
153
|
> 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.
|
|
91
|
-
> Look specifically at the impact of
|
|
154
|
+
> Look specifically at the impact of {subject} on the AI industry.
|
|
92
155
|
|
|
93
156
|
-> {article}
|
|
94
157
|
```
|
|
@@ -131,11 +194,66 @@ Or you can install them separately:
|
|
|
131
194
|
|
|
132
195
|
|
|
133
196
|
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
134
200
|
## 📚 Dictionary
|
|
135
201
|
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
### 📚 Dictionary
|
|
208
|
+
|
|
136
209
|
The following glossary is used to clarify certain concepts:
|
|
137
210
|
|
|
138
|
-
|
|
211
|
+
#### General LLM / AI terms
|
|
212
|
+
|
|
213
|
+
- **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.
|
|
214
|
+
- **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.
|
|
215
|
+
- **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.
|
|
216
|
+
- **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.
|
|
217
|
+
- **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.
|
|
218
|
+
- **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.
|
|
219
|
+
- **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.
|
|
220
|
+
- **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.
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
_Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
225
|
+
|
|
226
|
+
#### Promptbook core
|
|
227
|
+
|
|
228
|
+
- **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).
|
|
229
|
+
- **Jobs**
|
|
230
|
+
- **Task**
|
|
231
|
+
- **Subtask**
|
|
232
|
+
- **Workforce**
|
|
233
|
+
- **Persona**
|
|
234
|
+
- **Team**
|
|
235
|
+
- **Role**
|
|
236
|
+
- **Knowledge**
|
|
237
|
+
- **Public**
|
|
238
|
+
- **Private**
|
|
239
|
+
- **Protected**
|
|
240
|
+
- **Instruments**
|
|
241
|
+
- **Actions**
|
|
242
|
+
|
|
243
|
+
#### Book language
|
|
244
|
+
|
|
245
|
+
- **Book file**
|
|
246
|
+
- **Section**
|
|
247
|
+
- **Heading**
|
|
248
|
+
- **Description**
|
|
249
|
+
- **Command**
|
|
250
|
+
- **Block**
|
|
251
|
+
- **Return statement**
|
|
252
|
+
- **Comment**
|
|
253
|
+
- **Import**
|
|
254
|
+
- **Scope**
|
|
255
|
+
|
|
256
|
+
#### 💯 Core concepts
|
|
139
257
|
|
|
140
258
|
- [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|
|
141
259
|
- [📯 Pipeline](https://github.com/webgptorg/promptbook/discussions/64)
|
|
@@ -148,7 +266,7 @@ The following glossary is used to clarify certain concepts:
|
|
|
148
266
|
- [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29)
|
|
149
267
|
- [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32)
|
|
150
268
|
|
|
151
|
-
|
|
269
|
+
##### Advanced concepts
|
|
152
270
|
|
|
153
271
|
- [📚 Knowledge (Retrieval-augmented generation)](https://github.com/webgptorg/promptbook/discussions/41)
|
|
154
272
|
- [🌏 Remote server](https://github.com/webgptorg/promptbook/discussions/89)
|
|
@@ -163,6 +281,15 @@ The following glossary is used to clarify certain concepts:
|
|
|
163
281
|
- [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
|
|
164
282
|
- [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
|
|
165
283
|
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
### Terms specific to Promptbook TypeScript implementation
|
|
287
|
+
|
|
288
|
+
- Anonymous mode
|
|
289
|
+
- Application mode
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
166
293
|
## 🔌 Usage in Typescript / Javascript
|
|
167
294
|
|
|
168
295
|
- [Simple usage](./examples/usage/simple-script)
|