@promptbook/types 0.67.0-2 โ 0.67.0-3
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 +21 -37
- package/esm/typings/src/config.d.ts +12 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -65,37 +65,23 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
65
65
|
|
|
66
66
|
## ๐ค The Promptbook Whitepaper
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 2, 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.
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
But often you will struggle with the limitations of LLMs, such as hallucinations, off-topic responses, poor quality output, language drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w๐๐ขrd responses. When this happens, you generally have three options:
|
|
71
71
|
|
|
72
72
|
1. **Fine-tune** the model to your specifications or even train your own.
|
|
73
73
|
2. **Prompt-engineer** the prompt to the best shape you can achieve.
|
|
74
|
-
3. Use **multiple prompts** in a pipeline to get the best result.
|
|
75
|
-
|
|
76
|
-
In any of these situations, but especially in (3), the Promptbook library can make your life easier and make **orchestraror for your prompts**.
|
|
77
|
-
|
|
78
|
-
- **Separation of concerns** between prompt engineer and programmer; between code files and prompt files; and between prompts and their execution logic.
|
|
79
|
-
- Set up a **common format** for prompts that is interchangeable between projects and language/technology stacks.
|
|
80
|
-
- **Preprocessing** and cleaning the input data from the user.
|
|
81
|
-
- Use default values - **Jokers** to bypass some parts of the pipeline.
|
|
82
|
-
- **Expect** some specific output from the model.
|
|
83
|
-
- **Retry** mismatched outputs.
|
|
84
|
-
- **Combine** multiple models together.
|
|
85
|
-
- Interactive **User interaction** with the model and the user.
|
|
86
|
-
- Leverage **external** sources (like ChatGPT plugins or OpenAI's GPTs).
|
|
87
|
-
- Simplify your code to be **DRY** and not repeat all the boilerplate code for each prompt.
|
|
88
|
-
- **Versioning** of promptbooks
|
|
89
|
-
- **Reuse** parts of promptbooks in/between projects.
|
|
90
|
-
- Run the LLM **optimally** in parallel, with the best _cost/quality_ ratio or _speed/quality_ ratio.
|
|
91
|
-
- **Execution report** to see what happened during the execution.
|
|
92
|
-
- **Logging** the results of the promptbooks.
|
|
93
|
-
- _(Not ready yet)_ **Caching** calls to LLMs to save money and time.
|
|
94
|
-
- _(Not ready yet)_ Extend one prompt book from another one.
|
|
95
|
-
- _(Not ready yet)_ Leverage the **streaming** to make super cool UI/UX.
|
|
96
|
-
- _(Not ready yet)_ **A/B testing** to determine which prompt works best for the job.
|
|
74
|
+
3. Use **multiple prompts** in a [pipeline](https://github.com/webgptorg/promptbook/discussions/64) to get the best result.
|
|
97
75
|
|
|
76
|
+
In all of these situations, but especially in 3., the Promptbook library can make your life easier.
|
|
98
77
|
|
|
78
|
+
- [**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.
|
|
79
|
+
- Establishes a [**common format `.ptbk.md`**](https://github.com/webgptorg/promptbook/discussions/85) that can be used to describe your prompt business logic without having to write code or deal with the technicalities of LLMs.
|
|
80
|
+
- **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.
|
|
81
|
+
- Has 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.
|
|
82
|
+
- 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.
|
|
83
|
+
- Promptbook has built in versioning. You can test multiple **A/B versions** of pipelines and see which one works best.
|
|
84
|
+
- Promptbook is designed to do [**RAG** (Retrieval-Augmented Generation)](https://github.com/webgptorg/promptbook/discussions/41) and other advanced techniques. You can use **knowledge** to improve the quality of the output.
|
|
99
85
|
|
|
100
86
|
## ๐ง Promptbook _(for prompt-engeneers)_
|
|
101
87
|
|
|
@@ -139,9 +125,7 @@ File `write-website-content.ptbk.md`:
|
|
|
139
125
|
>
|
|
140
126
|
> ## โจ Improving the title
|
|
141
127
|
>
|
|
142
|
-
> -
|
|
143
|
-
> - MODEL NAME `gpt-4`
|
|
144
|
-
> - POSTPROCESSING `unwrapResult`
|
|
128
|
+
> - PERSONA Jane, Copywriter and Marketing Specialist.
|
|
145
129
|
>
|
|
146
130
|
> ```
|
|
147
131
|
> As an experienced marketing specialist, you have been entrusted with improving the name of your client's business.
|
|
@@ -175,9 +159,7 @@ File `write-website-content.ptbk.md`:
|
|
|
175
159
|
>
|
|
176
160
|
> ## ๐ฐ Cunning subtitle
|
|
177
161
|
>
|
|
178
|
-
> -
|
|
179
|
-
> - MODEL NAME `gpt-4`
|
|
180
|
-
> - POSTPROCESSING `unwrapResult`
|
|
162
|
+
> - PERSONA Josh, a copywriter, tasked with creating a claim for the website.
|
|
181
163
|
>
|
|
182
164
|
> ```
|
|
183
165
|
> As an experienced copywriter, you have been entrusted with creating a claim for the "{title}" web page.
|
|
@@ -197,8 +179,7 @@ File `write-website-content.ptbk.md`:
|
|
|
197
179
|
>
|
|
198
180
|
> ## ๐ฆ Keyword analysis
|
|
199
181
|
>
|
|
200
|
-
> -
|
|
201
|
-
> - MODEL NAME `gpt-4`
|
|
182
|
+
> - PERSONA Paul, extremely creative SEO specialist.
|
|
202
183
|
>
|
|
203
184
|
> ```
|
|
204
185
|
> As an experienced SEO specialist, you have been entrusted with creating keywords for the website "{title}".
|
|
@@ -242,8 +223,7 @@ File `write-website-content.ptbk.md`:
|
|
|
242
223
|
>
|
|
243
224
|
> ## ๐ Write the content
|
|
244
225
|
>
|
|
245
|
-
> -
|
|
246
|
-
> - MODEL NAME `gpt-3.5-turbo-instruct`
|
|
226
|
+
> - PERSONA Jane
|
|
247
227
|
>
|
|
248
228
|
> ```
|
|
249
229
|
> As an experienced copywriter and web designer, you have been entrusted with creating text for a new website {title}.
|
|
@@ -422,7 +402,12 @@ The following glossary is used to clarify certain concepts:
|
|
|
422
402
|
|
|
423
403
|
### โ When not to use
|
|
424
404
|
|
|
425
|
-
- When you
|
|
405
|
+
- When you have already implemented single simple prompt and it works fine for your job
|
|
406
|
+
- When [OpenAI Assistant (GPTs)](https://help.openai.com/en/articles/8673914-gpts-vs-assistants) is enough for you
|
|
407
|
+
- When you need streaming _(this may be implemented in the future, [see discussion](https://github.com/webgptorg/promptbook/discussions/102))_.
|
|
408
|
+
- When you need to use something other than JavaScript or TypeScript _(other languages are on the way, [see the discussion](https://github.com/webgptorg/promptbook/discussions/101))_
|
|
409
|
+
- When your main focus is on something other than text - like images, audio, video, spreadsheets _(other media types may be added in the future, [see discussion](https://github.com/webgptorg/promptbook/discussions/103))_
|
|
410
|
+
- When you need to use recursion _([see the discussion](https://github.com/webgptorg/promptbook/discussions/38))_
|
|
426
411
|
|
|
427
412
|
## ๐ Known issues
|
|
428
413
|
|
|
@@ -431,7 +416,6 @@ The following glossary is used to clarify certain concepts:
|
|
|
431
416
|
|
|
432
417
|
## ๐งผ Intentionally not implemented features
|
|
433
418
|
|
|
434
|
-
|
|
435
419
|
- [โฟ No recursion](https://github.com/webgptorg/promptbook/discussions/38)
|
|
436
420
|
- [๐ณ There are no types, just strings](https://github.com/webgptorg/promptbook/discussions/52)
|
|
437
421
|
|
|
@@ -30,6 +30,18 @@ export declare const LOOP_LIMIT = 1000;
|
|
|
30
30
|
* @private within the repository - too low-level in comparison with other `MAX_...`
|
|
31
31
|
*/
|
|
32
32
|
export declare const CHARACTER_LOOP_LIMIT = 100000;
|
|
33
|
+
/**
|
|
34
|
+
* Timeout for the connections in milliseconds
|
|
35
|
+
*
|
|
36
|
+
* @private within the repository - too low-level in comparison with other `MAX_...`
|
|
37
|
+
*/
|
|
38
|
+
export declare const CONNECTION_TIMEOUT_MS: number;
|
|
39
|
+
/**
|
|
40
|
+
* How many times to retry the connections
|
|
41
|
+
*
|
|
42
|
+
* @private within the repository - too low-level in comparison with other `MAX_...`
|
|
43
|
+
*/
|
|
44
|
+
export declare const CONNECTION_RETRIES_LIMIT = 5;
|
|
33
45
|
/**
|
|
34
46
|
* The maximum number of (LLM) tasks running in parallel
|
|
35
47
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/types",
|
|
3
|
-
"version": "0.67.0-
|
|
3
|
+
"version": "0.67.0-3",
|
|
4
4
|
"description": "Supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
],
|
|
46
46
|
"typings": "./esm/typings/src/_packages/types.index.d.ts",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@promptbook/core": "0.67.0-
|
|
48
|
+
"@promptbook/core": "0.67.0-3"
|
|
49
49
|
}
|
|
50
50
|
}
|