@promptbook/openai 0.85.0 → 0.86.0-11
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 -29
- package/esm/index.es.js +1 -1
- package/esm/typings/src/cli/promptbookCli.d.ts +1 -1
- package/esm/typings/src/collection/collectionToJson.test.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +2 -2
- package/esm/typings/src/types/Prompt.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +2 -2
- package/esm/typings/src/utils/editable/utils/stringifyPipelineJson.d.ts +1 -1
- package/esm/typings/src/wizzard/wizzard.d.ts +6 -6
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
## 🌟 New Features
|
|
18
18
|
|
|
19
|
+
- 📂 We have plugin for [VSCode](https://github.com/webgptorg/book-extension) to support `.book` file extension
|
|
19
20
|
- 💫 Support of [`o3-mini` model by OpenAI](https://openai.com/index/openai-o3-mini/)
|
|
20
21
|
- 🐋 **Support of [DeepSeek models](https://www.npmjs.com/package/@promptbook/deepseek)**
|
|
21
22
|
- 💙 Working [the **Book** language v1.0.0](https://github.com/webgptorg/book)
|
|
@@ -24,6 +25,10 @@
|
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
|
|
28
|
+
<blockquote style="color: #ff8811">
|
|
29
|
+
<b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
|
|
30
|
+
</blockquote>
|
|
31
|
+
|
|
27
32
|
## 📦 Package `@promptbook/openai`
|
|
28
33
|
|
|
29
34
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -74,7 +79,7 @@ const tools = {
|
|
|
74
79
|
const collection = await createCollectionFromDirectory('./books', tools);
|
|
75
80
|
|
|
76
81
|
// ▶ Get single Pipeline
|
|
77
|
-
const pipeline = await collection.getPipelineByUrl(`https://promptbook.studio/my-collection/write-article.book
|
|
82
|
+
const pipeline = await collection.getPipelineByUrl(`https://promptbook.studio/my-collection/write-article.book`);
|
|
78
83
|
|
|
79
84
|
// ▶ Create executor - the function that will execute the Pipeline
|
|
80
85
|
const pipelineExecutor = createPipelineExecutor({ pipeline, tools });
|
|
@@ -108,7 +113,7 @@ import { wizzard } from '@promptbook/wizzard';
|
|
|
108
113
|
|
|
109
114
|
const {
|
|
110
115
|
outputParameters: { joke },
|
|
111
|
-
} = await wizzard.execute(`https://github.com/webgptorg/book/blob/main/books/templates/generic.book
|
|
116
|
+
} = await wizzard.execute(`https://github.com/webgptorg/book/blob/main/books/templates/generic.book`, {
|
|
112
117
|
topic: 'Prague',
|
|
113
118
|
});
|
|
114
119
|
|
|
@@ -137,7 +142,7 @@ const tools = await $provideExecutionToolsForNode();
|
|
|
137
142
|
const collection = await createCollectionFromDirectory('./books', tools);
|
|
138
143
|
|
|
139
144
|
// ▶ Get single Pipeline
|
|
140
|
-
const pipeline = await collection.getPipelineByUrl(`https://promptbook.studio/my-collection/write-article.book
|
|
145
|
+
const pipeline = await collection.getPipelineByUrl(`https://promptbook.studio/my-collection/write-article.book`);
|
|
141
146
|
|
|
142
147
|
// ▶ Create executor - the function that will execute the Pipeline
|
|
143
148
|
const pipelineExecutor = createPipelineExecutor({ pipeline, tools });
|
|
@@ -209,7 +214,7 @@ const tools = {
|
|
|
209
214
|
const collection = await createCollectionFromDirectory('./books', tools);
|
|
210
215
|
|
|
211
216
|
// ▶ Get single Pipeline
|
|
212
|
-
const pipeline = await collection.getPipelineByUrl(`https://promptbook.studio/my-collection/write-article.book
|
|
217
|
+
const pipeline = await collection.getPipelineByUrl(`https://promptbook.studio/my-collection/write-article.book`);
|
|
213
218
|
|
|
214
219
|
// ▶ Create executor - the function that will execute the Pipeline
|
|
215
220
|
const pipelineExecutor = createPipelineExecutor({ pipeline, tools });
|
|
@@ -254,7 +259,7 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
254
259
|
|
|
255
260
|
During the computer revolution, we have seen [multiple generations of computer languages](https://github.com/webgptorg/promptbook/discussions/180), from the physical rewiring of the vacuum tubes through low-level machine code to the high-level languages like Python or JavaScript. And now, we're on the edge of the **next revolution**!
|
|
256
261
|
|
|
257
|
-
It's a revolution of writing software in plain human language that is understandable and executable by both humans and machines – and it's going to change everything!
|
|
262
|
+
It's a revolution of writing software in **plain human language** that is understandable and executable by both humans and machines – and it's going to change everything!
|
|
258
263
|
|
|
259
264
|
The incredible growth in power of microprocessors and the Moore's Law have been the driving force behind the ever-more powerful languages, and it's been an amazing journey! Similarly, the large language models (like GPT or Claude) are the next big thing in language technology, and they're set to transform the way we interact with computers.
|
|
260
265
|
|
|
@@ -283,41 +288,24 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
|
|
|
283
288
|
<thead>
|
|
284
289
|
<tr>
|
|
285
290
|
<th>Project</th>
|
|
286
|
-
<th>
|
|
287
|
-
<th>Link</th>
|
|
291
|
+
<th>About</th>
|
|
288
292
|
</tr>
|
|
289
293
|
</thead>
|
|
290
294
|
<tbody>
|
|
291
295
|
<tr>
|
|
292
|
-
<td>
|
|
293
|
-
<td>Promptbook Core is a description and documentation of the basic concepts, ideas and inner workings of how Promptbook should be implemented, and defines what features must be describable by book language.</td>
|
|
294
|
-
<td rowspan=2>https://github.com/webgptorg/book</td>
|
|
295
|
-
</tr>
|
|
296
|
-
<tr>
|
|
297
|
-
<td>Book language</td>
|
|
296
|
+
<td><a href="https://github.com/webgptorg/book">Book language</a></td>
|
|
298
297
|
<td>
|
|
299
|
-
Book is a markdown-like language to define core entities like
|
|
298
|
+
Book is a markdown-like language to define core entities like personas, knowledge, tasks,.... It is designed to be understandable by non-programmers and non-technical people<hr>
|
|
299
|
+
There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
|
|
300
300
|
</td>
|
|
301
301
|
</tr>
|
|
302
302
|
<tr>
|
|
303
|
-
<td>Promptbook
|
|
304
|
-
<td>Promptbook implementation in TypeScript released as multiple NPM packages</td>
|
|
305
|
-
<td>https://github.com/webgptorg/promptbook + <a href="https://www.npmjs.com/package/@promptbook/core#-packages-for-developers">Multiple packages published on NPM</a></td>
|
|
303
|
+
<td><a href="https://github.com/webgptorg/promptbook">Promptbook Engine</a></td>
|
|
304
|
+
<td>Promptbook implementation in TypeScript released as <a href="https://www.npmjs.com/package/@promptbook/core#-packages-for-developers">multiple NPM packages</a> and <a href="https://hub.docker.com/r/hejny/promptbook">Docker HUB</a></td>
|
|
306
305
|
</tr>
|
|
307
306
|
<tr>
|
|
308
|
-
<td>Promptbook
|
|
307
|
+
<td><a href="https://promptbook.studio">Promptbook Studio</a></td>
|
|
309
308
|
<td>Studio to write Books and instantly publish them as miniapps</td>
|
|
310
|
-
<td>
|
|
311
|
-
https://promptbook.studio<br/>
|
|
312
|
-
https://github.com/hejny/promptbook-studio</td>
|
|
313
|
-
</tr><tr>
|
|
314
|
-
<td>Hello World</td>
|
|
315
|
-
<td>Simple starter kit with Books integrated into the sample applications</td>
|
|
316
|
-
<td>
|
|
317
|
-
https://github.com/webgptorg/hello-world<br/>
|
|
318
|
-
https://github.com/webgptorg/hello-world-node-js<br/>
|
|
319
|
-
https://github.com/webgptorg/hello-world-next-js
|
|
320
|
-
</td>
|
|
321
309
|
</tr>
|
|
322
310
|
</tbody>
|
|
323
311
|
</table>
|
package/esm/index.es.js
CHANGED
|
@@ -16,7 +16,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
16
16
|
* @generated
|
|
17
17
|
* @see https://github.com/webgptorg/promptbook
|
|
18
18
|
*/
|
|
19
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.
|
|
19
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.86.0-10';
|
|
20
20
|
/**
|
|
21
21
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
22
22
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function promptbookCli(): Promise<void>;
|
|
7
7
|
/**
|
|
8
|
-
* TODO: [🧠] Maybe `run` command the default, instead of `ptbk run ./foo.book
|
|
8
|
+
* TODO: [🧠] Maybe `run` command the default, instead of `ptbk run ./foo.book` -> `ptbk ./foo.book`
|
|
9
9
|
* TODO: [🥠] Do not export, its just for CLI script
|
|
10
10
|
* TODO: [🕌] When more functionalities, rename
|
|
11
11
|
* Note: 11:11
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export {};
|
|
2
2
|
/**
|
|
3
|
-
* Note: [🐠] For example here URL https://example.com/pipeline.book
|
|
3
|
+
* Note: [🐠] For example here URL https://example.com/pipeline.book is not valid
|
|
4
4
|
* because it is on private network BUT its very hard to debug because
|
|
5
5
|
* there is no error message and false return (the error) happen deep in:
|
|
6
6
|
* `isValidPipelineUrl` -> `isValidPipelineUrl` -> `isUrlOnPrivateNetwork`
|
|
@@ -6,7 +6,7 @@ import type { PipelineCollection } from '../PipelineCollection';
|
|
|
6
6
|
/**
|
|
7
7
|
* Options for `createCollectionFromDirectory` function
|
|
8
8
|
*
|
|
9
|
-
* Note: `rootDirname` is not needed because it is the folder in which `.book` or `.book
|
|
9
|
+
* Note: `rootDirname` is not needed because it is the folder in which `.book` or `.book` file is located
|
|
10
10
|
* This is not same as `path` which is the first argument of `createCollectionFromDirectory` - it can be a subfolder
|
|
11
11
|
*/
|
|
12
12
|
type CreatePipelineCollectionFromDirectoryOptions = Omit<PrepareAndScrapeOptions, 'rootDirname'> & {
|
|
@@ -3,7 +3,7 @@ import type { ForeachCommand } from './ForeachCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the foreach command
|
|
5
5
|
*
|
|
6
|
-
* Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book
|
|
6
|
+
* Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book` file
|
|
7
7
|
*
|
|
8
8
|
* @see `documentationUrl` for more details
|
|
9
9
|
* @public exported from `@promptbook/editable`
|
|
@@ -3,7 +3,7 @@ import type { FormfactorCommand } from './FormfactorCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the formfactor command
|
|
5
5
|
*
|
|
6
|
-
* Note: @@@ This command is used as formfactor for new commands - it should NOT be used in any `.book
|
|
6
|
+
* Note: @@@ This command is used as formfactor for new commands - it should NOT be used in any `.book` file
|
|
7
7
|
*
|
|
8
8
|
* @see `documentationUrl` for more details
|
|
9
9
|
* @public exported from `@promptbook/editable`
|
|
@@ -3,7 +3,7 @@ import type { BoilerplateCommand } from './BoilerplateCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the boilerplate command
|
|
5
5
|
*
|
|
6
|
-
* Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.book
|
|
6
|
+
* Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.book` file
|
|
7
7
|
*
|
|
8
8
|
* @see `documentationUrl` for more details
|
|
9
9
|
* @private within the commands folder
|
|
@@ -2,7 +2,7 @@ import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
|
2
2
|
import type { PipelineString } from '../../pipeline/PipelineString';
|
|
3
3
|
import type { string_json } from '../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
|
-
* Import the pipeline.book
|
|
5
|
+
* Import the pipeline.book or pipeline.book.json file
|
|
6
6
|
*
|
|
7
7
|
* Note: Using here custom import to work in jest tests
|
|
8
8
|
* Note: Using sync version is 💩 in the production code, but it's ok here in tests
|
|
@@ -10,7 +10,7 @@ import type { string_json } from '../../types/typeAliases';
|
|
|
10
10
|
* @param path - The path to the file relative to examples/pipelines directory
|
|
11
11
|
* @private internal function of tests
|
|
12
12
|
*/
|
|
13
|
-
export declare function importPipelineWithoutPreparation(path: `${string}.book
|
|
13
|
+
export declare function importPipelineWithoutPreparation(path: `${string}.book`): PipelineString;
|
|
14
14
|
export declare function importPipelineWithoutPreparation(path: `${string}.book.json`): PipelineJson;
|
|
15
15
|
/**
|
|
16
16
|
* Import the pipeline.book.json file as parsed JSON
|
|
@@ -29,12 +29,12 @@ export type PipelineJson = {
|
|
|
29
29
|
* Note: It must be unique across all pipeline collections
|
|
30
30
|
* Note: It must use HTTPs URL
|
|
31
31
|
* Tip: You can do versioning in the URL
|
|
32
|
-
* For example: https://promptbook.studio/webgpt/write-website-content-cs.book
|
|
32
|
+
* For example: https://promptbook.studio/webgpt/write-website-content-cs.book@1.0.0
|
|
33
33
|
* Warning: Do not hash part of the URL, hash part is used for identification of the task in the pipeline
|
|
34
34
|
*/
|
|
35
35
|
readonly pipelineUrl?: string_pipeline_url;
|
|
36
36
|
/**
|
|
37
|
-
* Internal helper for tracking the source `.book
|
|
37
|
+
* Internal helper for tracking the source `.book` file of the pipeline
|
|
38
38
|
*/
|
|
39
39
|
readonly sourceFile?: string_filename;
|
|
40
40
|
/**
|
|
@@ -95,7 +95,7 @@ export type CommonPrompt = {
|
|
|
95
95
|
/**
|
|
96
96
|
* Unique identifier of the pipeline with specific task name as hash
|
|
97
97
|
*
|
|
98
|
-
* @example https://promptbook.studio/webgpt/write-website-content-cs.book
|
|
98
|
+
* @example https://promptbook.studio/webgpt/write-website-content-cs.book#keywords
|
|
99
99
|
*/
|
|
100
100
|
readonly pipelineUrl?: string_pipeline_url_with_task_hash;
|
|
101
101
|
/**
|
|
@@ -328,13 +328,13 @@ export type string_pipeline_root_url = string;
|
|
|
328
328
|
/**
|
|
329
329
|
* Semantic helper
|
|
330
330
|
*
|
|
331
|
-
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.book
|
|
331
|
+
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.book"`
|
|
332
332
|
*/
|
|
333
333
|
export type string_pipeline_url = string;
|
|
334
334
|
/**
|
|
335
335
|
* Semantic helper
|
|
336
336
|
*
|
|
337
|
-
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.book
|
|
337
|
+
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.book#keywords"`
|
|
338
338
|
*/
|
|
339
339
|
export type string_pipeline_url_with_task_hash = string;
|
|
340
340
|
/**
|
|
@@ -9,7 +9,7 @@ import type { string_json } from '../../../types/typeAliases';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function stringifyPipelineJson<TType>(pipeline: TType): string_json<TType>;
|
|
11
11
|
/**
|
|
12
|
-
* TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.book
|
|
12
|
+
* TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.book
|
|
13
13
|
* TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
|
|
14
14
|
* TODO: [🧠] Maybe more elegant solution than replacing via regex
|
|
15
15
|
* TODO: [🍙] Make some standard order of json properties
|
|
@@ -19,9 +19,9 @@ declare class Wizzard {
|
|
|
19
19
|
* Run the book
|
|
20
20
|
*
|
|
21
21
|
* It can be loaded from:
|
|
22
|
-
* 1) As a file ./books/write-cv.book
|
|
23
|
-
* 2) As a URL https://promptbook.studio/hejny/write-cv.book
|
|
24
|
-
* 2) As a URL https://promptbook.studio/hejny/write-cv.book
|
|
22
|
+
* 1) As a file ./books/write-cv.book
|
|
23
|
+
* 2) As a URL https://promptbook.studio/hejny/write-cv.book found in ./books folder recursively
|
|
24
|
+
* 2) As a URL https://promptbook.studio/hejny/write-cv.book fetched from the internet
|
|
25
25
|
* 3) As a string
|
|
26
26
|
*
|
|
27
27
|
* Note: This works simmilar to the `ptbk run` command
|
|
@@ -43,9 +43,9 @@ declare class Wizzard {
|
|
|
43
43
|
* Load book from the source
|
|
44
44
|
*
|
|
45
45
|
* Pipelines can be loaded from:
|
|
46
|
-
* 1) As a file ./books/write-cv.book
|
|
47
|
-
* 2) As a URL https://promptbook.studio/hejny/write-cv.book
|
|
48
|
-
* 2) As a URL https://promptbook.studio/hejny/write-cv.book
|
|
46
|
+
* 1) As a file ./books/write-cv.book
|
|
47
|
+
* 2) As a URL https://promptbook.studio/hejny/write-cv.book found in ./books folder recursively
|
|
48
|
+
* 2) As a URL https://promptbook.studio/hejny/write-cv.book fetched from the internet
|
|
49
49
|
* 3) As a string
|
|
50
50
|
*
|
|
51
51
|
* @param pipelineSource
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/openai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.0-11",
|
|
4
4
|
"description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"module": "./esm/index.es.js",
|
|
48
48
|
"typings": "./esm/typings/src/_packages/openai.index.d.ts",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@promptbook/core": "0.
|
|
50
|
+
"@promptbook/core": "0.86.0-11"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"colors": "1.4.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* @generated
|
|
25
25
|
* @see https://github.com/webgptorg/promptbook
|
|
26
26
|
*/
|
|
27
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.
|
|
27
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.86.0-10';
|
|
28
28
|
/**
|
|
29
29
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
30
30
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|