@promptbook/cli 0.69.0-1 → 0.69.0-10
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 -57
- package/esm/index.es.js +1895 -1162
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +5 -1
- package/esm/typings/src/_packages/types.index.d.ts +8 -0
- package/esm/typings/src/_packages/utils.index.d.ts +4 -4
- package/esm/typings/src/commands/FOREACH/ForeachCommand.d.ts +2 -6
- package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +26 -0
- package/esm/typings/src/commands/FOREACH/foreachCommand.test.d.ts +3 -0
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +2 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -4
- package/esm/typings/src/config.d.ts +7 -1
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +3 -0
- package/esm/typings/src/conversion/utils/extractParameterNamesFromTemplate.d.ts +2 -1
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +5 -0
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +5 -3
- package/esm/typings/src/execution/createPipelineExecutor/$OngoingTemplateResult.d.ts +21 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts +20 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorSettings.d.ts +33 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +10 -0
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +55 -0
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTemplate.d.ts +62 -0
- package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatCells.d.ts +21 -0
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +74 -0
- package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +34 -0
- package/esm/typings/src/execution/createPipelineExecutor/getContextForTemplate.d.ts +10 -0
- package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTemplate.d.ts +27 -0
- package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTemplate.d.ts +30 -0
- package/esm/typings/src/execution/createPipelineExecutor/getSamplesForTemplate.d.ts +10 -0
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +2 -0
- package/esm/typings/src/execution/utils/usageToHuman.d.ts +3 -4
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +9 -12
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +30 -0
- package/esm/typings/src/formats/csv/{ListFormatDefinition.d.ts → CsvFormatDefinition.d.ts} +3 -2
- package/esm/typings/src/formats/index.d.ts +1 -1
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +1 -1
- package/esm/typings/src/formats/text/TextFormatDefinition.d.ts +17 -0
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +1 -1
- package/esm/typings/src/types/PipelineJson/ParameterJson.d.ts +1 -0
- package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +5 -0
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +3 -0
- package/esm/typings/src/utils/expectation-counters/index.d.ts +3 -0
- package/esm/typings/src/utils/{extractParameterNames.d.ts → parameters/extractParameterNames.d.ts} +2 -2
- package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +27 -0
- package/esm/typings/src/utils/{replaceParameters.d.ts → parameters/replaceParameters.d.ts} +2 -2
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +10 -0
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.test.d.ts +1 -0
- package/package.json +2 -1
- package/umd/index.umd.js +1898 -1166
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/execution/createPipelineExecutor.d.ts +0 -72
- package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +0 -16
- /package/esm/typings/src/utils/{extractParameterNames.test.d.ts → parameters/extractParameterNames.test.d.ts} +0 -0
- /package/esm/typings/src/{execution/utils/usageToHuman.test.d.ts → utils/parameters/mapAvailableToExpectedParameters.test.d.ts} +0 -0
- /package/esm/typings/src/utils/{replaceParameters.test.d.ts → parameters/replaceParameters.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -105,13 +105,15 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
105
105
|
|
|
106
106
|
## 🤍 The Promptbook Whitepaper
|
|
107
107
|
|
|
108
|
+
|
|
109
|
+
|
|
108
110
|
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.
|
|
109
111
|
|
|
110
112
|
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:
|
|
111
113
|
|
|
112
114
|
1. **Fine-tune** the model to your specifications or even train your own.
|
|
113
115
|
2. **Prompt-engineer** the prompt to the best shape you can achieve.
|
|
114
|
-
3.
|
|
116
|
+
3. Orchestrate **multiple prompts** in a [pipeline](https://github.com/webgptorg/promptbook/discussions/64) to get the best result.
|
|
115
117
|
|
|
116
118
|
In all of these situations, but especially in 3., the Promptbook library can make your life easier.
|
|
117
119
|
|
|
@@ -123,7 +125,9 @@ In all of these situations, but especially in 3., the Promptbook library can mak
|
|
|
123
125
|
- Promptbook has built in versioning. You can test multiple **A/B versions** of pipelines and see which one works best.
|
|
124
126
|
- 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.
|
|
125
127
|
|
|
126
|
-
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## 🧔 Pipeline _(for prompt-engeneers)_
|
|
127
131
|
|
|
128
132
|
**P**romp**t** **b**oo**k** markdown file (or `.ptbk.md` file) is document that describes a **pipeline** - a series of prompts that are chained together to form somewhat reciepe for transforming natural language input.
|
|
129
133
|
|
|
@@ -440,6 +444,8 @@ The following glossary is used to clarify certain concepts:
|
|
|
440
444
|
- When you want to **version** your prompts and **test multiple versions**
|
|
441
445
|
- When you want to **log** the execution of prompts and backtrace the issues
|
|
442
446
|
|
|
447
|
+
[See more](https://github.com/webgptorg/promptbook/discussions/111)
|
|
448
|
+
|
|
443
449
|
### ➖ When not to use
|
|
444
450
|
|
|
445
451
|
- When you have already implemented single simple prompt and it works fine for your job
|
|
@@ -449,6 +455,8 @@ The following glossary is used to clarify certain concepts:
|
|
|
449
455
|
- 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))_
|
|
450
456
|
- When you need to use recursion _([see the discussion](https://github.com/webgptorg/promptbook/discussions/38))_
|
|
451
457
|
|
|
458
|
+
[See more](https://github.com/webgptorg/promptbook/discussions/112)
|
|
459
|
+
|
|
452
460
|
## 🐜 Known issues
|
|
453
461
|
|
|
454
462
|
- [🤸♂️ Iterations not working yet](https://github.com/webgptorg/promptbook/discussions/55)
|
|
@@ -461,63 +469,15 @@ The following glossary is used to clarify certain concepts:
|
|
|
461
469
|
|
|
462
470
|
## ❔ FAQ
|
|
463
471
|
|
|
464
|
-
|
|
465
|
-
|
|
466
472
|
If you have a question [start a discussion](https://github.com/webgptorg/promptbook/discussions/), [open an issue](https://github.com/webgptorg/promptbook/issues) or [write me an email](https://www.pavolhejny.com/contact).
|
|
467
473
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
We are considering creating a bridge/converter between these two libraries.
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
### Promptbooks vs. OpenAI`s GPTs
|
|
481
|
-
|
|
482
|
-
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.
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
### Where should I store my promptbooks?
|
|
499
|
-
|
|
500
|
-
If you use raw SDKs, you just put prompts in the sourcecode, mixed in with typescript, javascript, python or whatever programming language you use.
|
|
501
|
-
|
|
502
|
-
If you use promptbooks, you can store them in several places, each with its own advantages and disadvantages:
|
|
503
|
-
|
|
504
|
-
1. As **source code**, typically git-committed. In this case you can use the versioning system and the promptbooks will be tightly coupled with the version of the application. You still get the power of promptbooks, as you separate the concerns of the prompt-engineer and the programmer.
|
|
505
|
-
|
|
506
|
-
2. As data in a **database** In this case, promptbooks are like posts / articles on the blog. They can be modified independently of the application. You don't need to redeploy the application to change the promptbooks. You can have multiple versions of promptbooks for each user. You can have a web interface for non-programmers to create and modify promptbooks. But you lose the versioning system and you still have to consider the interface between the promptbooks and the application _(= input and output parameters)_.
|
|
507
|
-
|
|
508
|
-
3. In a **configuration** in environment variables. This is a good way to store promptbooks if you have an application with multiple deployments and you want to have different but simple promptbooks for each deployment and you don't need to change them often.
|
|
509
|
-
|
|
510
|
-
### What should I do when I need same promptbook in multiple human languages?
|
|
511
|
-
|
|
512
|
-
A single promptbook can be written for several _(human)_ languages at once. However, we recommend that you have separate promptbooks for each language.
|
|
513
|
-
|
|
514
|
-
In large language models, you will get better results if you have prompts in the same language as the user input.
|
|
515
|
-
|
|
516
|
-
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.
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
474
|
+
- [❔ Why not just use the OpenAI SDK / Anthropic Claude SDK / ...?](https://github.com/webgptorg/promptbook/discussions/114)
|
|
475
|
+
- [❔ How is it different from the OpenAI`s GPTs?](https://github.com/webgptorg/promptbook/discussions/118)
|
|
476
|
+
- [❔ How is it different from the Langchain?](https://github.com/webgptorg/promptbook/discussions/115)
|
|
477
|
+
- [❔ How is it different from the DSPy?](https://github.com/webgptorg/promptbook/discussions/117)
|
|
478
|
+
- [❔ How is it different from _anything_?](https://github.com/webgptorg/promptbook/discussions?discussions_q=is%3Aopen+label%3A%22Promptbook+vs%22)
|
|
479
|
+
- [❔ Is Promptbook using RAG _(Retrieval-Augmented Generation)_?](https://github.com/webgptorg/promptbook/discussions/123)
|
|
480
|
+
- [❔ Is Promptbook using function calling?](https://github.com/webgptorg/promptbook/discussions/124)
|
|
521
481
|
|
|
522
482
|
## ⌚ Changelog
|
|
523
483
|
|