@promptbook/types 0.88.0-1 → 0.88.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 CHANGED
@@ -141,6 +141,14 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
141
141
  </tbody>
142
142
  </table>
143
143
 
144
+ Hello world examples:
145
+
146
+ - [Hello world](https://github.com/webgptorg/hello-world)
147
+ - [Hello world in Node.js](https://github.com/webgptorg/hello-world-node-js)
148
+ - [Hello world in Next.js](https://github.com/webgptorg/hello-world-next-js)
149
+
150
+
151
+
144
152
  We also have a community of developers and users of **Promptbook**:
145
153
 
146
154
  - [Discord community](https://discord.gg/x3QWNaa89N)
@@ -307,16 +315,9 @@ Or you can install them separately:
307
315
 
308
316
  ## 📚 Dictionary
309
317
 
310
-
311
-
312
-
313
-
314
-
315
- ### 📚 Dictionary
316
-
317
318
  The following glossary is used to clarify certain concepts:
318
319
 
319
- #### General LLM / AI terms
320
+ ### General LLM / AI terms
320
321
 
321
322
  - **Prompt drift** is a phenomenon where the AI model starts to generate outputs that are not aligned with the original prompt. This can happen due to the model's training data, the prompt's wording, or the model's architecture.
322
323
  - **Pipeline, workflow or chain** is a sequence of tasks that are executed in a specific order. In the context of AI, a pipeline can refer to a sequence of AI models that are used to process data.
@@ -329,11 +330,11 @@ The following glossary is used to clarify certain concepts:
329
330
 
330
331
 
331
332
 
332
- _Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
333
+ _Note: This section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
333
334
 
334
335
 
335
336
 
336
- #### 💯 Core concepts
337
+ ### 💯 Core concepts
337
338
 
338
339
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
339
340
  - [📯 Pipeline](https://github.com/webgptorg/promptbook/discussions/64)
@@ -346,7 +347,7 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
346
347
  - [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29)
347
348
  - [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32)
348
349
 
349
- ##### Advanced concepts
350
+ #### Advanced concepts
350
351
 
351
352
  - [📚 Knowledge (Retrieval-augmented generation)](https://github.com/webgptorg/promptbook/discussions/41)
352
353
  - [🌏 Remote server](https://github.com/webgptorg/promptbook/discussions/89)
@@ -363,17 +364,9 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
363
364
 
364
365
 
365
366
 
366
- ### Terms specific to Promptbook TypeScript implementation
367
-
368
- - Anonymous mode
369
- - Application mode
370
-
367
+ ## 🚂 Promptbook Engine
371
368
 
372
-
373
- ## 🔌 Usage in Typescript / Javascript
374
-
375
- - [Simple usage](./examples/usage/simple-script)
376
- - [Usage with client and remote server](./examples/usage/remote)
369
+ ![Schema of Promptbook Engine](./documents/promptbook-engine.svg)
377
370
 
378
371
  ## ➕➖ When to use Promptbook?
379
372
 
@@ -439,13 +432,13 @@ See [TODO.md](./TODO.md)
439
432
  <div style="display: flex; align-items: center; gap: 20px;">
440
433
 
441
434
  <a href="https://promptbook.studio/">
442
- <img src="./design/promptbook-studio-logo.png" alt="Partner 3" height="100">
435
+ <img src="./design/promptbook-studio-logo.png" alt="Partner 3" height="70">
443
436
  </a>
444
437
 
445
438
  <a href="https://technologickainkubace.org/en/about-technology-incubation/about-the-project/">
446
- <img src="./other/partners/CI-Technology-Incubation.png" alt="Technology Incubation" height="100">
439
+ <img src="./other/partners/CI-Technology-Incubation.png" alt="Technology Incubation" height="70">
447
440
  </a>
448
-
441
+
449
442
  </div>
450
443
 
451
444
  ## 🖋️ Contributing
@@ -40,6 +40,7 @@ import type { ExecutionReportString } from '../execution/execution-report/Execut
40
40
  import type { ExecutionReportStringOptions } from '../execution/execution-report/ExecutionReportStringOptions';
41
41
  import type { ExecutionTask } from '../execution/ExecutionTask';
42
42
  import type { PreparationTask } from '../execution/ExecutionTask';
43
+ import type { task_status } from '../execution/ExecutionTask';
43
44
  import type { AbstractTask } from '../execution/ExecutionTask';
44
45
  import type { Task } from '../execution/ExecutionTask';
45
46
  import type { ExecutionTools } from '../execution/ExecutionTools';
@@ -322,6 +323,7 @@ export type { ExecutionReportString };
322
323
  export type { ExecutionReportStringOptions };
323
324
  export type { ExecutionTask };
324
325
  export type { PreparationTask };
326
+ export type { task_status };
325
327
  export type { AbstractTask };
326
328
  export type { Task };
327
329
  export type { ExecutionTools };
@@ -62,6 +62,7 @@ import { clonePipeline } from '../utils/serialization/clonePipeline';
62
62
  import { deepClone } from '../utils/serialization/deepClone';
63
63
  import { exportJson } from '../utils/serialization/exportJson';
64
64
  import { isSerializableAsJson } from '../utils/serialization/isSerializableAsJson';
65
+ import { jsonStringsToJsons } from '../utils/serialization/jsonStringsToJsons';
65
66
  import { difference } from '../utils/sets/difference';
66
67
  import { intersection } from '../utils/sets/intersection';
67
68
  import { union } from '../utils/sets/union';
@@ -143,6 +144,7 @@ export { clonePipeline };
143
144
  export { deepClone };
144
145
  export { exportJson };
145
146
  export { isSerializableAsJson };
147
+ export { jsonStringsToJsons };
146
148
  export { difference };
147
149
  export { intersection };
148
150
  export { union };
@@ -0,0 +1,11 @@
1
+ import type { Command as Program } from 'commander';
2
+ type actionCallbackFunction = Parameters<Program['action']>[0];
3
+ /**
4
+ * Wraps action to handle error console logging and exit process with error code
5
+ *
6
+ * @param action Action to be wrapped in error handling
7
+ * @returns Wrapped action
8
+ * @private internal helper function for CLI commands
9
+ */
10
+ export declare function handleActionErrors(action: actionCallbackFunction): actionCallbackFunction;
11
+ export {};
@@ -40,6 +40,10 @@ export type PreparationTask = AbstractTask<PipelineExecutorResult> & {
40
40
  readonly taskType: 'PREPARATION';
41
41
  readonly taskId: `prep-${task_id}`;
42
42
  };
43
+ /**
44
+ * Status of a task
45
+ */
46
+ export type task_status = 'RUNNING' | 'FINISHED' | 'ERROR';
43
47
  /**
44
48
  * Base interface for all task types
45
49
  */
@@ -52,6 +56,18 @@ export type AbstractTask<TTaskResult extends AbstractTaskResult> = {
52
56
  * Unique identifier for the task
53
57
  */
54
58
  readonly taskId: task_id;
59
+ /**
60
+ * Status of the task
61
+ */
62
+ readonly status: task_status;
63
+ /**
64
+ * Date when the task was created
65
+ */
66
+ readonly createdAt: Date;
67
+ /**
68
+ * Date when the task was last updated
69
+ */
70
+ readonly updatedAt: Date;
55
71
  /**
56
72
  * Gets a promise that resolves with the task result
57
73
  */
@@ -66,6 +82,14 @@ export type AbstractTask<TTaskResult extends AbstractTaskResult> = {
66
82
  * Gets just the current value which is mutated during the task processing
67
83
  */
68
84
  currentValue: PartialDeep<TTaskResult>;
85
+ /**
86
+ * List of errors that occurred during the task processing
87
+ */
88
+ readonly errors: Array<Error>;
89
+ /**
90
+ * List of warnings that occurred during the task processing
91
+ */
92
+ readonly warnings: Array<Error>;
69
93
  };
70
94
  export type Task = ExecutionTask | PreparationTask;
71
95
  export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Recursively converts JSON strings to JSON objects
3
+
4
+ * @public exported from `@promptbook/utils`
5
+ */
6
+ export declare function jsonStringsToJsons<T>(object: T): T;
7
+ /**
8
+ * TODO: Type the return type correctly
9
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/types",
3
- "version": "0.88.0-1",
3
+ "version": "0.88.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,
@@ -45,6 +45,6 @@
45
45
  "homepage": "https://ptbk.io/",
46
46
  "typings": "./esm/typings/src/_packages/types.index.d.ts",
47
47
  "peerDependencies": {
48
- "@promptbook/core": "0.88.0-1"
48
+ "@promptbook/core": "0.88.0-11"
49
49
  }
50
50
  }