promptbook 0.46.0-0 → 0.46.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 +17 -103
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -2,37 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Library to supercharge your use of large language models
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
7
|
|
|
8
8
|
[](https://github.com/webgptorg/promptbook/blob/main/LICENSE)
|
|
9
9
|
[](https://snyk.io/test/github/webgptorg/promptbook)
|
|
10
10
|
[](https://github.com/webgptorg/promptbook/issues)
|
|
11
11
|
[](https://socket.dev/npm/package/promptbook)
|
|
12
12
|
|
|
13
|
-
<!--/Badges-->
|
|
14
|
-
|
|
15
|
-
## 📦 Package `promptbook`
|
|
16
|
-
|
|
17
|
-
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
18
|
-
- This package `promptbook` is one part of the promptbook ecosystem.
|
|
19
|
-
|
|
20
|
-
To install this package, run:
|
|
21
13
|
|
|
22
|
-
```bash
|
|
23
|
-
npm i promptbook
|
|
24
|
-
```
|
|
25
14
|
|
|
26
|
-
<!-- TODO: -->
|
|
27
15
|
|
|
28
|
-
---
|
|
29
16
|
|
|
30
|
-
Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
31
17
|
|
|
32
|
-
<!--
|
|
33
|
-
TODO: Probbably remove this section only in packages
|
|
34
|
-
> ⚠ Warning: This library is still in early development.
|
|
35
|
-
-->
|
|
36
18
|
|
|
37
19
|
## 🤍 Whitepaper
|
|
38
20
|
|
|
@@ -75,13 +57,13 @@ In any of these situations, but especially in (3), the Promptbook library can ma
|
|
|
75
57
|
- Multiple promptbooks forms a library which will become a **part of your application codebase**.
|
|
76
58
|
- Theese promptbooks are designed such as they **can be written by non-programmers**.
|
|
77
59
|
|
|
78
|
-
|
|
60
|
+
|
|
79
61
|
|
|
80
62
|
### Sample:
|
|
81
63
|
|
|
82
64
|
File `write-website-content.ptbk.md`:
|
|
83
65
|
|
|
84
|
-
|
|
66
|
+
|
|
85
67
|
|
|
86
68
|
> # 🌍 Create website content
|
|
87
69
|
>
|
|
@@ -252,7 +234,7 @@ File `write-website-content.ptbk.md`:
|
|
|
252
234
|
>
|
|
253
235
|
> `-> {content}`
|
|
254
236
|
|
|
255
|
-
|
|
237
|
+
|
|
256
238
|
|
|
257
239
|
Following is the scheme how the promptbook above is executed:
|
|
258
240
|
|
|
@@ -314,10 +296,12 @@ npm i ptbk
|
|
|
314
296
|
|
|
315
297
|
Or you can install them separately:
|
|
316
298
|
|
|
317
|
-
|
|
299
|
+
> ⭐ Marked packages are worth to try first
|
|
318
300
|
|
|
319
|
-
<!-- Add all new -->
|
|
320
301
|
|
|
302
|
+
|
|
303
|
+
- ⭐ **[ptbk](https://www.npmjs.com/package/ptbk)** - Bundle of all packages, when you want to install everything and you don't care about the size
|
|
304
|
+
- **[promptbook](https://www.npmjs.com/package/promptbook)** - Same as `ptbk`
|
|
321
305
|
- **[@promptbook/core](https://www.npmjs.com/package/@promptbook/core)** - Core of the library, it contains the main logic for promptbooks
|
|
322
306
|
- ⭐ **[@promptbook/utils](https://www.npmjs.com/package/@promptbook/utils)** - Utility functions used in the library but also useful for individual use in preprocessing and postprocessing LLM inputs and outputs
|
|
323
307
|
- _(Not finished)_ **[@promptbook/wizzard](https://www.npmjs.com/package/@promptbook/wizzard)** - Wizard for creating+running promptbooks in single line
|
|
@@ -496,7 +480,7 @@ There are [postprocessing functions](#postprocessing-functions) that can be used
|
|
|
496
480
|
|
|
497
481
|
- _(Not implemented yet)_ `ConsoleInterfaceTools` is a wrapper around `readline` module that interacts with the user via console.
|
|
498
482
|
- `SimplePromptInterfaceTools` is a wrapper around `window.prompt` synchronous function that interacts with the user via browser prompt. It is used for testing and mocking **NOT intended to use in the production** due to its synchronous nature.
|
|
499
|
-
- `CallbackInterfaceTools` delagates the user interaction to a async callback function. You need to provide your own implementation of this callback function and its bind to UI.
|
|
483
|
+
- `CallbackInterfaceTools` delagates the user interaction to a async callback function. You need to provide your own implementation of this callback function and its bind to UI.
|
|
500
484
|
|
|
501
485
|
### Executor
|
|
502
486
|
|
|
@@ -566,10 +550,7 @@ There are two types of expectations which are not strictly symmetrical:
|
|
|
566
550
|
|
|
567
551
|
Look at [expectations.ptbk.md](samples/templates/45-expectations.ptbk.md) and [expect-json.ptbk.md](samples/templates/45-expect-json.ptbk.md) samples for more.
|
|
568
552
|
|
|
569
|
-
|
|
570
|
-
### New
|
|
571
|
-
[🥻] Insert here when making new command
|
|
572
|
-
-->
|
|
553
|
+
|
|
573
554
|
|
|
574
555
|
### Execution report
|
|
575
556
|
|
|
@@ -577,7 +558,7 @@ Execution report is a simple object or markdown that contains information about
|
|
|
577
558
|
|
|
578
559
|
[See the example of such a report](/samples/templates/50-advanced.report.md)
|
|
579
560
|
|
|
580
|
-
|
|
561
|
+
|
|
581
562
|
|
|
582
563
|
### Remote server
|
|
583
564
|
|
|
@@ -588,23 +569,7 @@ This is useful to make all logic on browser side but not expose your API keys or
|
|
|
588
569
|
|
|
589
570
|
## 👨💻 Usage and integration _(for developers)_
|
|
590
571
|
|
|
591
|
-
<!--
|
|
592
|
-
|
|
593
|
-
TODO: [🧙♂️]
|
|
594
|
-
|
|
595
|
-
### 🧙♂️ Using wizzard
|
|
596
|
-
|
|
597
|
-
First you need to install this library:
|
|
598
|
-
|
|
599
|
-
```bash
|
|
600
|
-
npm install --save @promptbook/wizzard
|
|
601
|
-
```
|
|
602
|
-
|
|
603
|
-
> TODO: !! Write the Wizzard sample
|
|
604
572
|
|
|
605
|
-
[Usage samples](./samples/usage/)
|
|
606
|
-
|
|
607
|
-
-->
|
|
608
573
|
|
|
609
574
|
### 🔌 Usage in Typescript / Javascript
|
|
610
575
|
|
|
@@ -629,11 +594,11 @@ npm install --save @promptbook/wizzard
|
|
|
629
594
|
|
|
630
595
|
## 🐜 Known issues
|
|
631
596
|
|
|
632
|
-
|
|
597
|
+
|
|
633
598
|
|
|
634
599
|
## 🧼 Intentionally not implemented features
|
|
635
600
|
|
|
636
|
-
|
|
601
|
+
|
|
637
602
|
|
|
638
603
|
## ❔ FAQ
|
|
639
604
|
|
|
@@ -649,42 +614,17 @@ Langchain is primarily aimed at ML developers working in Python. This library is
|
|
|
649
614
|
|
|
650
615
|
We are considering creating a bridge/converter between these two libraries.
|
|
651
616
|
|
|
652
|
-
<!--
|
|
653
617
|
|
|
654
|
-
==========
|
|
655
|
-
Include:
|
|
656
|
-
- Langchain is the python library and JavaScript is on second place
|
|
657
|
-
- Langchain primarily focused on making templates, not on combining templates into larger structures
|
|
658
|
-
- at the language level it distinguishes between chat and completion, I need to mix the two into one template pipeline
|
|
659
|
-
- for a non-programmer it's quite hard to work with such a thing and write templates - I would much prefer a system that allows non-technical people to write templates (of which there are many more on the market than free pythonists)
|
|
660
|
-
- The focus of promptbooks is primarily on building user applications, not the data processing, training or autogpt.
|
|
661
|
-
-->
|
|
662
618
|
|
|
663
619
|
### Promptbooks vs. OpenAI`s GPTs
|
|
664
620
|
|
|
665
621
|
GPTs are chat assistants that can be assigned to specific tasks and materials. But they are still chat assistants. Promptbooks are a way to orchestrate many more predefined tasks to have much tighter control over the process. Promptbooks are not a good technology for creating human-like chatbots, GPTs are not a good technology for creating outputs with specific requirements.
|
|
666
622
|
|
|
667
|
-
<!--
|
|
668
|
-
TODO:
|
|
669
|
-
### Promptbooks vs. Semantic Kernel
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
-->
|
|
673
623
|
|
|
674
|
-
<!--
|
|
675
|
-
TODO: !
|
|
676
|
-
### Promptbooks vs. Langtail
|
|
677
624
|
|
|
678
625
|
|
|
679
|
-
-->
|
|
680
626
|
|
|
681
|
-
<!--
|
|
682
|
-
TODO:
|
|
683
|
-
### Promptbooks vs. Evidentally AI
|
|
684
627
|
|
|
685
|
-
Logging and monitoring
|
|
686
|
-
|
|
687
|
-
-->
|
|
688
628
|
|
|
689
629
|
### Where should I store my promptbooks?
|
|
690
630
|
|
|
@@ -706,33 +646,9 @@ In large language models, you will get better results if you have prompts in the
|
|
|
706
646
|
|
|
707
647
|
The best way to manage this is to have suffixed promptbooks like `write-website-content.en.ptbk.md` and `write-website-content.cs.ptbk.md` for each supported language.
|
|
708
648
|
|
|
709
|
-
<!--
|
|
710
|
-
TODO: (Maybe)
|
|
711
|
-
### Why you need to explicitly specify input and output parameters?
|
|
712
|
-
-->
|
|
713
|
-
|
|
714
|
-
<!--
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
!
|
|
719
649
|
|
|
720
650
|
|
|
721
651
|
|
|
722
|
-
unit testing
|
|
723
|
-
|
|
724
|
-
escaping
|
|
725
|
-
|
|
726
|
-
how i get block into prompt
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
## 🚷 Limitations
|
|
730
|
-
|
|
731
|
-
function calling
|
|
732
|
-
system message
|
|
733
|
-
iterations
|
|
734
|
-
|
|
735
|
-
-->
|
|
736
652
|
|
|
737
653
|
## ⌚ Changelog
|
|
738
654
|
|
|
@@ -742,13 +658,11 @@ See [CHANGELOG.md](./CHANGELOG.md)
|
|
|
742
658
|
|
|
743
659
|
<p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a property="dct:title" rel="cc:attributionURL" href="https://github.com/webgptorg/promptbook">Promptbook</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://github.com/hejny/">Pavol Hejný</a> is licensed under <a href="https://creativecommons.org/licenses/by/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY 4.0</a></p>
|
|
744
660
|
|
|
745
|
-
|
|
746
|
-
|
|
661
|
+
|
|
662
|
+
|
|
747
663
|
|
|
748
664
|
## 🖋️ Contributing
|
|
749
665
|
|
|
750
666
|
I am open to pull requests, feedback, and suggestions. Or if you like this utility, you can [☕ buy me a coffee](https://www.buymeacoffee.com/hejny) or [donate via cryptocurrencies](https://github.com/hejny/hejny/blob/main/documents/crypto.md).
|
|
751
667
|
|
|
752
|
-
You can also ⭐ star the promptbook package, [follow me on GitHub](https://github.com/hejny) or [various other social networks](https://www.pavolhejny.com/contact/).
|
|
753
|
-
|
|
754
|
-
<!--/Contributing-->
|
|
668
|
+
You can also ⭐ star the promptbook package, [follow me on GitHub](https://github.com/hejny) or [various other social networks](https://www.pavolhejny.com/contact/).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "promptbook",
|
|
3
|
-
"version": "0.46.0-
|
|
3
|
+
"version": "0.46.0-2",
|
|
4
4
|
"description": "Library to supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://www.npmjs.com/package/@promptbook/core",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@promptbook/core": "0.46.0-
|
|
38
|
-
"@promptbook/execute-javascript": "0.46.0-
|
|
39
|
-
"@promptbook/langtail": "0.46.0-
|
|
40
|
-
"@promptbook/mock": "0.46.0-
|
|
41
|
-
"@promptbook/openai": "0.46.0-
|
|
42
|
-
"@promptbook/remote-client": "0.46.0-
|
|
43
|
-
"@promptbook/remote-server": "0.46.0-
|
|
44
|
-
"@promptbook/utils": "0.46.0-
|
|
45
|
-
"@promptbook/wizzard": "0.46.0-
|
|
37
|
+
"@promptbook/core": "0.46.0-2",
|
|
38
|
+
"@promptbook/execute-javascript": "0.46.0-2",
|
|
39
|
+
"@promptbook/langtail": "0.46.0-2",
|
|
40
|
+
"@promptbook/mock": "0.46.0-2",
|
|
41
|
+
"@promptbook/openai": "0.46.0-2",
|
|
42
|
+
"@promptbook/remote-client": "0.46.0-2",
|
|
43
|
+
"@promptbook/remote-server": "0.46.0-2",
|
|
44
|
+
"@promptbook/utils": "0.46.0-2",
|
|
45
|
+
"@promptbook/wizzard": "0.46.0-2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@promptbook/cli": "0.46.0-
|
|
49
|
-
"@promptbook/types": "0.46.0-
|
|
48
|
+
"@promptbook/cli": "0.46.0-2",
|
|
49
|
+
"@promptbook/types": "0.46.0-2"
|
|
50
50
|
}
|
|
51
51
|
}
|