@promptbook/openai 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 +20 -91
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
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/openai)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
|
|
15
15
|
## 📦 Package `@promptbook/openai`
|
|
16
16
|
|
|
@@ -25,17 +25,14 @@ npm i @promptbook/openai
|
|
|
25
25
|
|
|
26
26
|
Wrapper around [OpenAI's SDK](https://www.npmjs.com/package/openai) to make it easier to use inside Promptbooks.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
33
|
Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
TODO: Probbably remove this section only in packages
|
|
37
|
-
> ⚠ Warning: This library is still in early development.
|
|
38
|
-
-->
|
|
35
|
+
|
|
39
36
|
|
|
40
37
|
## 🤍 Whitepaper
|
|
41
38
|
|
|
@@ -78,13 +75,13 @@ In any of these situations, but especially in (3), the Promptbook library can ma
|
|
|
78
75
|
- Multiple promptbooks forms a library which will become a **part of your application codebase**.
|
|
79
76
|
- Theese promptbooks are designed such as they **can be written by non-programmers**.
|
|
80
77
|
|
|
81
|
-
|
|
78
|
+
|
|
82
79
|
|
|
83
80
|
### Sample:
|
|
84
81
|
|
|
85
82
|
File `write-website-content.ptbk.md`:
|
|
86
83
|
|
|
87
|
-
|
|
84
|
+
|
|
88
85
|
|
|
89
86
|
> # 🌍 Create website content
|
|
90
87
|
>
|
|
@@ -255,7 +252,7 @@ File `write-website-content.ptbk.md`:
|
|
|
255
252
|
>
|
|
256
253
|
> `-> {content}`
|
|
257
254
|
|
|
258
|
-
|
|
255
|
+
|
|
259
256
|
|
|
260
257
|
Following is the scheme how the promptbook above is executed:
|
|
261
258
|
|
|
@@ -317,10 +314,12 @@ npm i ptbk
|
|
|
317
314
|
|
|
318
315
|
Or you can install them separately:
|
|
319
316
|
|
|
320
|
-
|
|
317
|
+
> ⭐ Marked packages are worth to try first
|
|
321
318
|
|
|
322
|
-
<!-- Add all new -->
|
|
323
319
|
|
|
320
|
+
|
|
321
|
+
- ⭐ **[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
|
|
322
|
+
- **[promptbook](https://www.npmjs.com/package/promptbook)** - Same as `ptbk`
|
|
324
323
|
- **[@promptbook/core](https://www.npmjs.com/package/@promptbook/core)** - Core of the library, it contains the main logic for promptbooks
|
|
325
324
|
- ⭐ **[@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
|
|
326
325
|
- _(Not finished)_ **[@promptbook/wizzard](https://www.npmjs.com/package/@promptbook/wizzard)** - Wizard for creating+running promptbooks in single line
|
|
@@ -499,7 +498,7 @@ There are [postprocessing functions](#postprocessing-functions) that can be used
|
|
|
499
498
|
|
|
500
499
|
- _(Not implemented yet)_ `ConsoleInterfaceTools` is a wrapper around `readline` module that interacts with the user via console.
|
|
501
500
|
- `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.
|
|
502
|
-
- `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.
|
|
501
|
+
- `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.
|
|
503
502
|
|
|
504
503
|
### Executor
|
|
505
504
|
|
|
@@ -569,10 +568,7 @@ There are two types of expectations which are not strictly symmetrical:
|
|
|
569
568
|
|
|
570
569
|
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.
|
|
571
570
|
|
|
572
|
-
|
|
573
|
-
### New
|
|
574
|
-
[🥻] Insert here when making new command
|
|
575
|
-
-->
|
|
571
|
+
|
|
576
572
|
|
|
577
573
|
### Execution report
|
|
578
574
|
|
|
@@ -580,7 +576,7 @@ Execution report is a simple object or markdown that contains information about
|
|
|
580
576
|
|
|
581
577
|
[See the example of such a report](/samples/templates/50-advanced.report.md)
|
|
582
578
|
|
|
583
|
-
|
|
579
|
+
|
|
584
580
|
|
|
585
581
|
### Remote server
|
|
586
582
|
|
|
@@ -591,23 +587,7 @@ This is useful to make all logic on browser side but not expose your API keys or
|
|
|
591
587
|
|
|
592
588
|
## 👨💻 Usage and integration _(for developers)_
|
|
593
589
|
|
|
594
|
-
<!--
|
|
595
|
-
|
|
596
|
-
TODO: [🧙♂️]
|
|
597
|
-
|
|
598
|
-
### 🧙♂️ Using wizzard
|
|
599
|
-
|
|
600
|
-
First you need to install this library:
|
|
601
|
-
|
|
602
|
-
```bash
|
|
603
|
-
npm install --save @promptbook/wizzard
|
|
604
|
-
```
|
|
605
|
-
|
|
606
|
-
> TODO: !! Write the Wizzard sample
|
|
607
|
-
|
|
608
|
-
[Usage samples](./samples/usage/)
|
|
609
590
|
|
|
610
|
-
-->
|
|
611
591
|
|
|
612
592
|
### 🔌 Usage in Typescript / Javascript
|
|
613
593
|
|
|
@@ -632,11 +612,11 @@ npm install --save @promptbook/wizzard
|
|
|
632
612
|
|
|
633
613
|
## 🐜 Known issues
|
|
634
614
|
|
|
635
|
-
|
|
615
|
+
|
|
636
616
|
|
|
637
617
|
## 🧼 Intentionally not implemented features
|
|
638
618
|
|
|
639
|
-
|
|
619
|
+
|
|
640
620
|
|
|
641
621
|
## ❔ FAQ
|
|
642
622
|
|
|
@@ -652,42 +632,17 @@ Langchain is primarily aimed at ML developers working in Python. This library is
|
|
|
652
632
|
|
|
653
633
|
We are considering creating a bridge/converter between these two libraries.
|
|
654
634
|
|
|
655
|
-
<!--
|
|
656
635
|
|
|
657
|
-
==========
|
|
658
|
-
Include:
|
|
659
|
-
- Langchain is the python library and JavaScript is on second place
|
|
660
|
-
- Langchain primarily focused on making templates, not on combining templates into larger structures
|
|
661
|
-
- at the language level it distinguishes between chat and completion, I need to mix the two into one template pipeline
|
|
662
|
-
- 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)
|
|
663
|
-
- The focus of promptbooks is primarily on building user applications, not the data processing, training or autogpt.
|
|
664
|
-
-->
|
|
665
636
|
|
|
666
637
|
### Promptbooks vs. OpenAI`s GPTs
|
|
667
638
|
|
|
668
639
|
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.
|
|
669
640
|
|
|
670
|
-
<!--
|
|
671
|
-
TODO:
|
|
672
|
-
### Promptbooks vs. Semantic Kernel
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
-->
|
|
676
|
-
|
|
677
|
-
<!--
|
|
678
|
-
TODO: !
|
|
679
|
-
### Promptbooks vs. Langtail
|
|
680
641
|
|
|
681
642
|
|
|
682
|
-
-->
|
|
683
643
|
|
|
684
|
-
<!--
|
|
685
|
-
TODO:
|
|
686
|
-
### Promptbooks vs. Evidentally AI
|
|
687
644
|
|
|
688
|
-
Logging and monitoring
|
|
689
645
|
|
|
690
|
-
-->
|
|
691
646
|
|
|
692
647
|
### Where should I store my promptbooks?
|
|
693
648
|
|
|
@@ -709,33 +664,9 @@ In large language models, you will get better results if you have prompts in the
|
|
|
709
664
|
|
|
710
665
|
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.
|
|
711
666
|
|
|
712
|
-
<!--
|
|
713
|
-
TODO: (Maybe)
|
|
714
|
-
### Why you need to explicitly specify input and output parameters?
|
|
715
|
-
-->
|
|
716
|
-
|
|
717
|
-
<!--
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
!
|
|
722
667
|
|
|
723
668
|
|
|
724
669
|
|
|
725
|
-
unit testing
|
|
726
|
-
|
|
727
|
-
escaping
|
|
728
|
-
|
|
729
|
-
how i get block into prompt
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
## 🚷 Limitations
|
|
733
|
-
|
|
734
|
-
function calling
|
|
735
|
-
system message
|
|
736
|
-
iterations
|
|
737
|
-
|
|
738
|
-
-->
|
|
739
670
|
|
|
740
671
|
## ⌚ Changelog
|
|
741
672
|
|
|
@@ -745,13 +676,11 @@ See [CHANGELOG.md](./CHANGELOG.md)
|
|
|
745
676
|
|
|
746
677
|
<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>
|
|
747
678
|
|
|
748
|
-
|
|
749
|
-
|
|
679
|
+
|
|
680
|
+
|
|
750
681
|
|
|
751
682
|
## 🖋️ Contributing
|
|
752
683
|
|
|
753
684
|
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).
|
|
754
685
|
|
|
755
|
-
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/).
|
|
756
|
-
|
|
757
|
-
<!--/Contributing-->
|
|
686
|
+
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/openai",
|
|
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,
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"openai": "4.2.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@promptbook/core": "0.46.0-
|
|
41
|
+
"@promptbook/core": "0.46.0-2"
|
|
42
42
|
},
|
|
43
43
|
"main": "./umd/index.umd.js",
|
|
44
44
|
"module": "./esm/index.es.js",
|