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