@promptbook/openai 0.46.0-0 → 0.46.0-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.
- package/README.md +19 -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,11 @@ npm i ptbk
|
|
|
317
314
|
|
|
318
315
|
Or you can install them separately:
|
|
319
316
|
|
|
320
|
-
<!--[🔠]-->
|
|
321
317
|
|
|
322
|
-
<!-- Add all new -->
|
|
323
318
|
|
|
319
|
+
|
|
320
|
+
- ⭐ **[ptbk](https://www.npmjs.com/package/@promptbook/core)** - Bundle of all packages, when you want to install everything and you don't care about the size
|
|
321
|
+
- **[promptbook](https://www.npmjs.com/package/@promptbook/core)** - Just alias for `ptbk`
|
|
324
322
|
- **[@promptbook/core](https://www.npmjs.com/package/@promptbook/core)** - Core of the library, it contains the main logic for promptbooks
|
|
325
323
|
- ⭐ **[@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
324
|
- _(Not finished)_ **[@promptbook/wizzard](https://www.npmjs.com/package/@promptbook/wizzard)** - Wizard for creating+running promptbooks in single line
|
|
@@ -499,7 +497,7 @@ There are [postprocessing functions](#postprocessing-functions) that can be used
|
|
|
499
497
|
|
|
500
498
|
- _(Not implemented yet)_ `ConsoleInterfaceTools` is a wrapper around `readline` module that interacts with the user via console.
|
|
501
499
|
- `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.
|
|
500
|
+
- `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
501
|
|
|
504
502
|
### Executor
|
|
505
503
|
|
|
@@ -569,10 +567,7 @@ There are two types of expectations which are not strictly symmetrical:
|
|
|
569
567
|
|
|
570
568
|
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
569
|
|
|
572
|
-
|
|
573
|
-
### New
|
|
574
|
-
[🥻] Insert here when making new command
|
|
575
|
-
-->
|
|
570
|
+
|
|
576
571
|
|
|
577
572
|
### Execution report
|
|
578
573
|
|
|
@@ -580,7 +575,7 @@ Execution report is a simple object or markdown that contains information about
|
|
|
580
575
|
|
|
581
576
|
[See the example of such a report](/samples/templates/50-advanced.report.md)
|
|
582
577
|
|
|
583
|
-
|
|
578
|
+
|
|
584
579
|
|
|
585
580
|
### Remote server
|
|
586
581
|
|
|
@@ -591,23 +586,7 @@ This is useful to make all logic on browser side but not expose your API keys or
|
|
|
591
586
|
|
|
592
587
|
## 👨💻 Usage and integration _(for developers)_
|
|
593
588
|
|
|
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
589
|
|
|
610
|
-
-->
|
|
611
590
|
|
|
612
591
|
### 🔌 Usage in Typescript / Javascript
|
|
613
592
|
|
|
@@ -632,11 +611,11 @@ npm install --save @promptbook/wizzard
|
|
|
632
611
|
|
|
633
612
|
## 🐜 Known issues
|
|
634
613
|
|
|
635
|
-
|
|
614
|
+
|
|
636
615
|
|
|
637
616
|
## 🧼 Intentionally not implemented features
|
|
638
617
|
|
|
639
|
-
|
|
618
|
+
|
|
640
619
|
|
|
641
620
|
## ❔ FAQ
|
|
642
621
|
|
|
@@ -652,42 +631,17 @@ Langchain is primarily aimed at ML developers working in Python. This library is
|
|
|
652
631
|
|
|
653
632
|
We are considering creating a bridge/converter between these two libraries.
|
|
654
633
|
|
|
655
|
-
<!--
|
|
656
634
|
|
|
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
635
|
|
|
666
636
|
### Promptbooks vs. OpenAI`s GPTs
|
|
667
637
|
|
|
668
638
|
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
639
|
|
|
670
|
-
<!--
|
|
671
|
-
TODO:
|
|
672
|
-
### Promptbooks vs. Semantic Kernel
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
-->
|
|
676
|
-
|
|
677
|
-
<!--
|
|
678
|
-
TODO: !
|
|
679
|
-
### Promptbooks vs. Langtail
|
|
680
640
|
|
|
681
641
|
|
|
682
|
-
-->
|
|
683
642
|
|
|
684
|
-
<!--
|
|
685
|
-
TODO:
|
|
686
|
-
### Promptbooks vs. Evidentally AI
|
|
687
643
|
|
|
688
|
-
Logging and monitoring
|
|
689
644
|
|
|
690
|
-
-->
|
|
691
645
|
|
|
692
646
|
### Where should I store my promptbooks?
|
|
693
647
|
|
|
@@ -709,33 +663,9 @@ In large language models, you will get better results if you have prompts in the
|
|
|
709
663
|
|
|
710
664
|
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
665
|
|
|
712
|
-
<!--
|
|
713
|
-
TODO: (Maybe)
|
|
714
|
-
### Why you need to explicitly specify input and output parameters?
|
|
715
|
-
-->
|
|
716
|
-
|
|
717
|
-
<!--
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
!
|
|
722
666
|
|
|
723
667
|
|
|
724
668
|
|
|
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
669
|
|
|
740
670
|
## ⌚ Changelog
|
|
741
671
|
|
|
@@ -745,13 +675,11 @@ See [CHANGELOG.md](./CHANGELOG.md)
|
|
|
745
675
|
|
|
746
676
|
<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
677
|
|
|
748
|
-
|
|
749
|
-
|
|
678
|
+
|
|
679
|
+
|
|
750
680
|
|
|
751
681
|
## 🖋️ Contributing
|
|
752
682
|
|
|
753
683
|
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
684
|
|
|
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-->
|
|
685
|
+
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-1",
|
|
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-1"
|
|
42
42
|
},
|
|
43
43
|
"main": "./umd/index.umd.js",
|
|
44
44
|
"module": "./esm/index.es.js",
|