@promptbook/node 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.
Files changed (53) hide show
  1. package/README.md +46 -30
  2. package/esm/index.es.js +178 -105
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/core.index.d.ts +16 -4
  5. package/esm/typings/src/_packages/types.index.d.ts +8 -6
  6. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  7. package/esm/typings/src/commands/EXPECT/ExpectCommand.d.ts +1 -1
  8. package/esm/typings/src/commands/SECTION/SectionCommand.d.ts +1 -1
  9. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +0 -2
  10. package/esm/typings/src/config.d.ts +34 -2
  11. package/esm/typings/src/conversion/pipelineJsonToString.d.ts +1 -1
  12. package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +2 -2
  13. package/esm/typings/src/conversion/utils/extractParameterNamesFromTask.d.ts +3 -3
  14. package/esm/typings/src/conversion/utils/renameParameter.d.ts +2 -2
  15. package/esm/typings/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -1
  16. package/esm/typings/src/execution/ScriptExecutionTools.d.ts +1 -1
  17. package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +2 -2
  18. package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +3 -0
  19. package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +32 -2
  20. package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +14 -0
  21. package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +2 -2
  22. package/esm/typings/src/formfactors/index.d.ts +72 -10
  23. package/esm/typings/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +2 -2
  24. package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +12 -2
  25. package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +12 -2
  26. package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +5 -4
  27. package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +2 -2
  28. package/esm/typings/src/pipeline/PipelineJson/{TaskJsonCommon.d.ts → CommonTaskJson.d.ts} +13 -13
  29. package/esm/typings/src/pipeline/PipelineJson/DialogTaskJson.d.ts +2 -2
  30. package/esm/typings/src/pipeline/PipelineJson/ParameterJson.d.ts +2 -0
  31. package/esm/typings/src/pipeline/PipelineJson/PersonaJson.d.ts +1 -1
  32. package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +2 -2
  33. package/esm/typings/src/pipeline/PipelineJson/PromptTaskJson.d.ts +2 -2
  34. package/esm/typings/src/pipeline/PipelineJson/ScriptTaskJson.d.ts +2 -2
  35. package/esm/typings/src/pipeline/PipelineJson/SimpleTaskJson.d.ts +2 -2
  36. package/esm/typings/src/pipeline/PipelineJson/TaskJson.d.ts +1 -1
  37. package/esm/typings/src/pipeline/PipelineString.d.ts +1 -1
  38. package/esm/typings/src/prepare/isPipelinePrepared.d.ts +1 -1
  39. package/esm/typings/src/prepare/prepareTasks.d.ts +5 -5
  40. package/esm/typings/src/types/Prompt.d.ts +3 -3
  41. package/esm/typings/src/types/SectionType.d.ts +21 -0
  42. package/esm/typings/src/types/TaskProgress.d.ts +1 -1
  43. package/esm/typings/src/types/TaskType.d.ts +15 -0
  44. package/esm/typings/src/types/typeAliases.d.ts +1 -1
  45. package/esm/typings/src/utils/organization/TODO_remove_as.d.ts +6 -0
  46. package/esm/typings/src/utils/organization/spaceTrim.d.ts +11 -0
  47. package/esm/typings/src/utils/parameters/extractParameterNames.d.ts +1 -1
  48. package/esm/typings/src/version.d.ts +1 -1
  49. package/package.json +2 -2
  50. package/umd/index.umd.js +178 -105
  51. package/umd/index.umd.js.map +1 -1
  52. package/esm/typings/src/commands/SECTION/SectionType.d.ts +0 -13
  53. /package/esm/typings/{promptbook-collection → books}/index.d.ts +0 -0
package/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  # ![Promptbook logo - cube with letters P and B](./other/design/logo-h1.png) 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/node`
33
27
 
34
28
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
@@ -55,28 +49,33 @@ Core of the library for Node.js runtime, it contains the main logic for promptbo
55
49
 
56
50
  Rest of the documentation is common for **entire promptbook ecosystem**:
57
51
 
58
- ## 🤍 The Promptbook Whitepaper
59
52
 
60
- 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.
61
53
 
62
- 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:
63
54
 
64
- 1. **Fine-tune** the model to your specifications or even train your own.
65
- 2. **Prompt-engineer** the prompt to the best shape you can achieve.
66
- 3. Orchestrate **multiple prompts** in a [pipeline](https://github.com/webgptorg/promptbook/discussions/64) to get the best result.
55
+ ## 🤍 The Book Abstract
56
+
57
+ **It's time for a paradigm shift! The future of software is in plain English, French or Latin.**
58
+
59
+ 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**!
60
+
61
+ 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!
62
+
63
+ 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.
67
64
 
68
- In all of these situations, but especially in 3., the **✨ Promptbook can make your life waaaaaaaaaay easier**.
65
+ This shift is going to happen, whether we are ready for it or not. Our mission is to make it excellently, not just good.
69
66
 
70
- - [**Separates concerns**](https://github.com/webgptorg/promptbook/discussions/32) between prompt-engineer and programmer, between code files and prompt files, and between prompts and their execution logic. For this purpose, it introduces a new language called [the **💙 Book**](https://github.com/webgptorg/book).
71
- - Book allows you to **focus on the business** logic without having to write code or deal with the technicalities of LLMs.
72
- - **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.
73
- - 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.
74
- - 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.
75
- - Versioning is build in. You can test multiple **A/B versions** of pipelines and see which one works best.
76
- - 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.
67
+ **Join us in this journey!**
77
68
 
78
69
 
79
70
 
71
+ ## 🚀 Get started
72
+
73
+ Take a look at the simple starter kit with books integrated into the **Hello World** sample applications:
74
+
75
+ - [Hello Book](https://github.com/webgptorg/hello-world)
76
+ - [Hello Book in Node.js](https://github.com/webgptorg/hello-world-node-js)
77
+ - [Hello Book in Next.js](https://github.com/webgptorg/hello-world-next-js)
78
+
80
79
 
81
80
 
82
81
 
@@ -95,7 +94,7 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
95
94
  <tbody>
96
95
  <tr>
97
96
  <td>Core</td>
98
- <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>
97
+ <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>
99
98
  <td rowspan=2>https://ptbk.io<br/>https://github.com/webgptorg/book</td>
100
99
  </tr>
101
100
  <tr>
@@ -106,17 +105,23 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
106
105
  </tr>
107
106
  <tr>
108
107
  <td>Promptbook typescript project</td>
109
- <td>Implementation of Promptbook in TypeScript published into multiple packages to NPM</td>
108
+ <td>Promptbook implementation in TypeScript released as multiple NPM packages</td>
110
109
  <td>https://github.com/webgptorg/promptbook + Multiple packages on NPM</td>
111
110
  </tr>
112
111
  <tr>
113
112
  <td>Promptbook studio</td>
114
- <td>No-code studio to write book without need to write even the markdown</td>
115
- <td rowspan=2>https://promptbook.studio<br/>https://github.com/hejny/promptbook-studio</td>
116
- </tr>
117
- <tr>
118
- <td>Promptbook miniapps</td>
119
- <td>Builder of LLM miniapps from book notation</td>
113
+ <td>Studio to write Books and instantly publish them as miniapps</td>
114
+ <td>
115
+ https://promptbook.studio<br/>
116
+ https://github.com/hejny/promptbook-studio</td>
117
+ </tr><tr>
118
+ <td>Hello World</td>
119
+ <td>Simple starter kit with Books integrated into the sample applications</td>
120
+ <td>
121
+ https://github.com/webgptorg/hello-world<br/>
122
+ https://github.com/webgptorg/hello-world-node-js<br/>
123
+ https://github.com/webgptorg/hello-world-next-js
124
+ </td>
120
125
  </tr>
121
126
  </tbody>
122
127
  </table>
@@ -185,7 +190,9 @@ Reserved words:
185
190
 
186
191
  #### Parameter notation
187
192
 
188
- ### Template
193
+ ### Task
194
+
195
+ ### Task type
189
196
 
190
197
  Todo todo
191
198
 
@@ -246,6 +253,11 @@ Or you can install them separately:
246
253
 
247
254
  ## 📚 Dictionary
248
255
 
256
+
257
+
258
+
259
+
260
+
249
261
  ### 📚 Dictionary
250
262
 
251
263
  The following glossary is used to clarify certain concepts:
@@ -261,6 +273,8 @@ The following glossary is used to clarify certain concepts:
261
273
  - **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.
262
274
  - **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.
263
275
 
276
+
277
+
264
278
  _Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
265
279
 
266
280
  #### Promptbook core
@@ -297,7 +311,7 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
297
311
 
298
312
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
299
313
  - [📯 Pipeline](https://github.com/webgptorg/promptbook/discussions/64)
300
- - [🎺 Pipeline templates](https://github.com/webgptorg/promptbook/discussions/88)
314
+ - [🙇‍♂️ Tasks and pipeline sections](https://github.com/webgptorg/promptbook/discussions/88)
301
315
  - [🤼 Personas](https://github.com/webgptorg/promptbook/discussions/22)
302
316
  - [⭕ Parameters](https://github.com/webgptorg/promptbook/discussions/83)
303
317
  - [🚀 Pipeline execution](https://github.com/webgptorg/promptbook/discussions/84)
@@ -321,6 +335,8 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
321
335
  - [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
322
336
  - [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
323
337
 
338
+
339
+
324
340
  ### Terms specific to Promptbook TypeScript implementation
325
341
 
326
342
  - Anonymous mode