@promptbook/cli 0.60.0-4 → 0.60.0-5
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 +11 -13
- package/esm/index.es.js +557 -554
- package/esm/index.es.js.map +1 -1
- package/esm/typings/promptbook-collection/index.d.ts +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +9 -9
- package/esm/typings/src/_packages/node.index.d.ts +1 -1
- package/esm/typings/src/_packages/types.index.d.ts +3 -3
- package/{umd/typings/src/library → esm/typings/src/collection}/PipelineCollection.d.ts +4 -4
- package/{umd/typings/src/library → esm/typings/src/collection}/SimplePipelineCollection.d.ts +5 -5
- package/{umd/typings/src/library/libraryToJson.d.ts → esm/typings/src/collection/collectionToJson.d.ts} +2 -2
- package/esm/typings/src/{library → collection}/constructors/createCollectionFromDirectory.d.ts +3 -3
- package/esm/typings/src/{library → collection}/constructors/createCollectionFromJson.d.ts +1 -1
- package/{umd/typings/src/library → esm/typings/src/collection}/constructors/createCollectionFromPromise.d.ts +1 -1
- package/esm/typings/src/{library → collection}/constructors/createCollectionFromUrl.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createSubcollection.d.ts +12 -0
- package/esm/typings/src/config.d.ts +2 -2
- package/esm/typings/src/conversion/prettify/prettifyPipelineString.d.ts +1 -1
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +1 -1
- package/esm/typings/src/errors/CollectionError.d.ts +1 -1
- package/esm/typings/src/errors/ExecutionError.d.ts +1 -1
- package/esm/typings/src/errors/NotFoundError.d.ts +1 -1
- package/esm/typings/src/execution/EmbeddingVector.d.ts +1 -1
- package/esm/typings/src/execution/{PromptbookExecutor.d.ts → PipelineExecutor.d.ts} +3 -3
- package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +2 -2
- package/{umd/typings/src/execution/createPromptbookExecutor.d.ts → esm/typings/src/execution/createPipelineExecutor.d.ts} +13 -13
- package/esm/typings/src/execution/utils/replaceParameters.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/joker.test.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/mocked-chat.test.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/mocked-completion.test.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +4 -4
- package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -1
- package/esm/typings/src/types/Command.d.ts +2 -2
- package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +5 -5
- package/esm/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +1 -1
- package/esm/typings/src/types/PipelineString.d.ts +1 -1
- package/esm/typings/src/types/Prompt.d.ts +3 -3
- package/esm/typings/src/types/TaskProgress.d.ts +1 -1
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +3 -3
- package/esm/typings/src/types/execution-report/config.d.ts +1 -1
- package/esm/typings/src/utils/emojis.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +557 -554
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/promptbook-collection/index.d.ts +1 -1
- package/umd/typings/src/_packages/core.index.d.ts +9 -9
- package/umd/typings/src/_packages/node.index.d.ts +1 -1
- package/umd/typings/src/_packages/types.index.d.ts +3 -3
- package/{esm/typings/src/library → umd/typings/src/collection}/PipelineCollection.d.ts +4 -4
- package/{esm/typings/src/library → umd/typings/src/collection}/SimplePipelineCollection.d.ts +5 -5
- package/{esm/typings/src/library/libraryToJson.d.ts → umd/typings/src/collection/collectionToJson.d.ts} +2 -2
- package/umd/typings/src/{library → collection}/constructors/createCollectionFromDirectory.d.ts +3 -3
- package/umd/typings/src/{library → collection}/constructors/createCollectionFromJson.d.ts +1 -1
- package/{esm/typings/src/library → umd/typings/src/collection}/constructors/createCollectionFromPromise.d.ts +1 -1
- package/umd/typings/src/{library → collection}/constructors/createCollectionFromUrl.d.ts +1 -1
- package/umd/typings/src/collection/constructors/createSubcollection.d.ts +12 -0
- package/umd/typings/src/config.d.ts +2 -2
- package/umd/typings/src/conversion/prettify/prettifyPipelineString.d.ts +1 -1
- package/umd/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +1 -1
- package/umd/typings/src/errors/CollectionError.d.ts +1 -1
- package/umd/typings/src/errors/ExecutionError.d.ts +1 -1
- package/umd/typings/src/errors/NotFoundError.d.ts +1 -1
- package/umd/typings/src/execution/EmbeddingVector.d.ts +1 -1
- package/umd/typings/src/execution/{PromptbookExecutor.d.ts → PipelineExecutor.d.ts} +3 -3
- package/umd/typings/src/execution/assertsExecutionSuccessful.d.ts +2 -2
- package/{esm/typings/src/execution/createPromptbookExecutor.d.ts → umd/typings/src/execution/createPipelineExecutor.d.ts} +13 -13
- package/umd/typings/src/execution/utils/replaceParameters.d.ts +1 -1
- package/umd/typings/src/llm-providers/mocked/joker.test.d.ts +1 -1
- package/umd/typings/src/llm-providers/mocked/mocked-chat.test.d.ts +1 -1
- package/umd/typings/src/llm-providers/mocked/mocked-completion.test.d.ts +1 -1
- package/umd/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +4 -4
- package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -1
- package/umd/typings/src/types/Command.d.ts +2 -2
- package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +5 -5
- package/umd/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +1 -1
- package/umd/typings/src/types/PipelineString.d.ts +1 -1
- package/umd/typings/src/types/Prompt.d.ts +3 -3
- package/umd/typings/src/types/TaskProgress.d.ts +1 -1
- package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +3 -3
- package/umd/typings/src/types/execution-report/config.d.ts +1 -1
- package/umd/typings/src/utils/emojis.d.ts +1 -1
- package/esm/typings/src/library/constructors/createSubcollection.d.ts +0 -12
- package/umd/typings/src/library/constructors/createSubcollection.d.ts +0 -12
- /package/esm/typings/src/{library/constructors/createCollectionFromDirectory.test.d.ts → collection/collectionToJson.test.d.ts} +0 -0
- /package/{umd/typings/src/library → esm/typings/src/collection}/constructors/createCollectionFromDirectory.test.d.ts +0 -0
- /package/esm/typings/src/{library → collection}/constructors/createCollectionFromJson.test.d.ts +0 -0
- /package/esm/typings/src/{library → collection}/constructors/createCollectionFromPromise.test.d.ts +0 -0
- /package/esm/typings/src/{library → collection}/constructors/justTestFsImport.d.ts +0 -0
- /package/{esm/typings/src/library/libraryToJson.test.d.ts → umd/typings/src/collection/collectionToJson.test.d.ts} +0 -0
- /package/umd/typings/src/{library/constructors/createCollectionFromJson.test.d.ts → collection/constructors/createCollectionFromDirectory.test.d.ts} +0 -0
- /package/umd/typings/src/{library/constructors/createCollectionFromPromise.test.d.ts → collection/constructors/createCollectionFromJson.test.d.ts} +0 -0
- /package/umd/typings/src/{library/libraryToJson.test.d.ts → collection/constructors/createCollectionFromPromise.test.d.ts} +0 -0
- /package/umd/typings/src/{library → collection}/constructors/justTestFsImport.d.ts +0 -0
package/README.md
CHANGED
|
@@ -47,14 +47,14 @@ This will emit `index.ts` with `getPipelineCollection` function file in `promptb
|
|
|
47
47
|
Then just use it:
|
|
48
48
|
|
|
49
49
|
```typescript
|
|
50
|
-
import {
|
|
50
|
+
import { createPipelineExecutor, assertsExecutionSuccessful } from '@promptbook/core';
|
|
51
51
|
import { getPipelineCollection } from './promptbook-collection'; // <- Importing from pre-built library
|
|
52
52
|
import { JavascriptExecutionTools } from '@promptbook/execute-javascript';
|
|
53
53
|
import { OpenAiExecutionTools } from '@promptbook/openai';
|
|
54
54
|
|
|
55
|
-
// ▶ Get
|
|
55
|
+
// ▶ Get single Pipeline
|
|
56
56
|
const promptbook = await getPipelineCollection().getPipelineByUrl(
|
|
57
|
-
`https://promptbook.studio/my-
|
|
57
|
+
`https://promptbook.studio/my-collection/write-article.ptbk.md`,
|
|
58
58
|
);
|
|
59
59
|
|
|
60
60
|
// ▶ Prepare tools
|
|
@@ -66,14 +66,14 @@ const tools = {
|
|
|
66
66
|
script: [new JavascriptExecutionTools()],
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
// ▶ Create executor - the function that will execute the
|
|
70
|
-
const
|
|
69
|
+
// ▶ Create executor - the function that will execute the Pipeline
|
|
70
|
+
const pipelineExecutor = createPipelineExecutor({ pipeline, tools });
|
|
71
71
|
|
|
72
72
|
// ▶ Prepare input parameters
|
|
73
73
|
const inputParameters = { word: 'cat' };
|
|
74
74
|
|
|
75
|
-
// 🚀▶ Execute the
|
|
76
|
-
const result = await
|
|
75
|
+
// 🚀▶ Execute the Pipeline
|
|
76
|
+
const result = await pipelineExecutor(inputParameters);
|
|
77
77
|
|
|
78
78
|
// ▶ Fail if the execution was not successful
|
|
79
79
|
assertsExecutionSuccessful(result);
|
|
@@ -83,7 +83,7 @@ const { isSuccessful, errors, outputParameters, executionReport } = result;
|
|
|
83
83
|
console.info(outputParameters);
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
This is simmilar to compilation process, during the build time the `promptbook make` command will check promptbooks for errors, convert them to the more optimized format and build knowledge base (RAG) for the
|
|
86
|
+
This is simmilar to compilation process, during the build time the `promptbook make` command will check promptbooks for errors, convert them to the more optimized format and build knowledge base (RAG) for the pipeline collection.
|
|
87
87
|
|
|
88
88
|
There is also a javascript and json format available.
|
|
89
89
|
|
|
@@ -100,8 +100,6 @@ This will prettify all promptbooks in `promptbook` directory and adds Mermaid gr
|
|
|
100
100
|
|
|
101
101
|
Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
103
|
## 🤍 The Promptbook Whitepaper
|
|
106
104
|
|
|
107
105
|
When you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 2, or whatever, it doesn't matter how it is integrated. Whether it's the direct calling of a REST API, using the SDK, hardcoding the prompt in the source code, or importing a text file, the process remains the same.
|
|
@@ -146,7 +144,7 @@ File `write-website-content.ptbk.md`:
|
|
|
146
144
|
>
|
|
147
145
|
> Instructions for creating web page content.
|
|
148
146
|
>
|
|
149
|
-
> -
|
|
147
|
+
> - PIPELINE URL https://promptbook.studio/webgpt/write-website-content.ptbk.md
|
|
150
148
|
> - PROMPTBOOK VERSION 0.0.1
|
|
151
149
|
> - INPUT PARAM `{rawTitle}` Automatically suggested a site name or empty text
|
|
152
150
|
> - INPUT PARAM `{rawAssigment}` Automatically generated site entry from image recognition
|
|
@@ -500,7 +498,7 @@ Internally it can have multiple formats:
|
|
|
500
498
|
### Promptbook **Library**
|
|
501
499
|
|
|
502
500
|
Library of all promptbooks used in your application.
|
|
503
|
-
Each promptbook is a separate `.ptbk.md` file with unique `
|
|
501
|
+
Each promptbook is a separate `.ptbk.md` file with unique `PIPELINE URL`. Theese urls are used to reference promptbooks in other promptbooks or in the application code.
|
|
504
502
|
|
|
505
503
|
### Prompt Result
|
|
506
504
|
|
|
@@ -638,7 +636,7 @@ Look at [expectations.ptbk.md](samples/templates/45-expectations.ptbk.md) and [e
|
|
|
638
636
|
|
|
639
637
|
### Execution report
|
|
640
638
|
|
|
641
|
-
Execution report is a simple object or markdown that contains information about the execution of the
|
|
639
|
+
Execution report is a simple object or markdown that contains information about the execution of the pipeline.
|
|
642
640
|
|
|
643
641
|
[See the example of such a report](/samples/templates/50-advanced.report.md)
|
|
644
642
|
|