@promptbook/utils 0.61.0-28 → 0.61.0-30

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/esm/index.es.js CHANGED
@@ -1969,7 +1969,7 @@ function isValidUuid(value) {
1969
1969
  /**
1970
1970
  * The version of the Promptbook library
1971
1971
  */
1972
- var PROMPTBOOK_VERSION = '0.61.0-27';
1972
+ var PROMPTBOOK_VERSION = '0.61.0-29';
1973
1973
  // TODO: !!!! List here all the versions and annotate + put into script
1974
1974
 
1975
1975
  // @promptbook/utils
@@ -1,4 +1,5 @@
1
1
  import type { Promisable } from 'type-fest';
2
+ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
2
3
  import { PipelineExecutionError } from '../errors/PipelineExecutionError';
3
4
  import type { TaskProgress } from '../types/TaskProgress';
4
5
  import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
@@ -10,6 +11,8 @@ import type { PromptResultUsage } from './PromptResultUsage';
10
11
  *
11
12
  * It can be created with `createPipelineExecutor` function.
12
13
  *
14
+ * @@@ almost-JSON (what about errors)
15
+ *
13
16
  * @see https://github.com/webgptorg/promptbook#executor
14
17
  */
15
18
  export type PipelineExecutor = {
@@ -17,8 +20,16 @@ export type PipelineExecutor = {
17
20
  };
18
21
  /**
19
22
  * @@@
23
+ *
24
+ * @@@ almost-JSON (what about errors)
20
25
  */
21
26
  export type PipelineExecutorResult = {
27
+ /**
28
+ * Result parameters of the execution
29
+ *
30
+ * Note: If the execution was not successful, there are only some of the result parameters
31
+ */
32
+ readonly outputParameters: Parameters;
22
33
  /**
23
34
  * Whether the execution was successful, details are aviable in `executionReport`
24
35
  */
@@ -40,13 +51,14 @@ export type PipelineExecutorResult = {
40
51
  */
41
52
  readonly executionReport: ExecutionReportJson;
42
53
  /**
43
- * Result parameters of the execution
54
+ * The prepared pipeline that was used for the execution
44
55
  *
45
- * Note: If the execution was not successful, there are only some of the result parameters
56
+ * Note: If you called `createPipelineExecutor` with fully prepared pipeline, this is the same object as this pipeline
57
+ * If you passed not fully prepared pipeline, this is same pipeline but fully prepared
46
58
  */
47
- readonly outputParameters: Parameters;
59
+ readonly preparedPipeline: PipelineJson;
48
60
  };
49
61
  /**
50
62
  * TODO: [🧠] Should this file be in /execution or /types folder?
51
- * TODO: [💷] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result
63
+ * TODO: [💷] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result - BUT maybe NOT?
52
64
  */
@@ -20,6 +20,16 @@ type CreatePipelineExecutorSettings = {
20
20
  * @default false
21
21
  */
22
22
  readonly isVerbose?: boolean;
23
+ /**
24
+ * If you pass fully prepared pipeline, this does not matter
25
+ *
26
+ * Otherwise:
27
+ * If false or not set, warning is shown when pipeline is not prepared
28
+ * If true, warning is suppressed
29
+ *
30
+ * @default false
31
+ */
32
+ readonly isNotPreparedWarningSupressed?: boolean;
23
33
  };
24
34
  /**
25
35
  * Options for `createPipelineExecutor`
@@ -47,8 +57,6 @@ interface CreatePipelineExecutorOptions {
47
57
  export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor;
48
58
  export {};
49
59
  /**
50
- * TODO: !!!!! return `preparedPipeline` from execution
51
- * TODO: !!!!! `isNotPreparedWarningSupressed`
52
60
  * TODO: Use isVerbose here (not only pass to `preparePipeline`)
53
61
  * TODO: [🪂] Use maxParallelCount here (not only pass to `preparePipeline`)
54
62
  * TODO: [♈] Probbably move expectations from templates to parameters
@@ -41,7 +41,7 @@ export type ExecutionReportJson = {
41
41
  /**
42
42
  * The prompt wich was executed
43
43
  */
44
- readonly prompt: Omit<Prompt, 'pipelineUrl' | 'parameters'>;
44
+ readonly prompt: Omit<Prompt, 'pipelineUrl'>;
45
45
  /**
46
46
  * Result of the prompt execution (if not failed during LLM execution)
47
47
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/utils",
3
- "version": "0.61.0-28",
3
+ "version": "0.61.0-30",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -1976,7 +1976,7 @@
1976
1976
  /**
1977
1977
  * The version of the Promptbook library
1978
1978
  */
1979
- var PROMPTBOOK_VERSION = '0.61.0-27';
1979
+ var PROMPTBOOK_VERSION = '0.61.0-29';
1980
1980
  // TODO: !!!! List here all the versions and annotate + put into script
1981
1981
 
1982
1982
  // @promptbook/utils
@@ -1,4 +1,5 @@
1
1
  import type { Promisable } from 'type-fest';
2
+ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
2
3
  import { PipelineExecutionError } from '../errors/PipelineExecutionError';
3
4
  import type { TaskProgress } from '../types/TaskProgress';
4
5
  import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
@@ -10,6 +11,8 @@ import type { PromptResultUsage } from './PromptResultUsage';
10
11
  *
11
12
  * It can be created with `createPipelineExecutor` function.
12
13
  *
14
+ * @@@ almost-JSON (what about errors)
15
+ *
13
16
  * @see https://github.com/webgptorg/promptbook#executor
14
17
  */
15
18
  export type PipelineExecutor = {
@@ -17,8 +20,16 @@ export type PipelineExecutor = {
17
20
  };
18
21
  /**
19
22
  * @@@
23
+ *
24
+ * @@@ almost-JSON (what about errors)
20
25
  */
21
26
  export type PipelineExecutorResult = {
27
+ /**
28
+ * Result parameters of the execution
29
+ *
30
+ * Note: If the execution was not successful, there are only some of the result parameters
31
+ */
32
+ readonly outputParameters: Parameters;
22
33
  /**
23
34
  * Whether the execution was successful, details are aviable in `executionReport`
24
35
  */
@@ -40,13 +51,14 @@ export type PipelineExecutorResult = {
40
51
  */
41
52
  readonly executionReport: ExecutionReportJson;
42
53
  /**
43
- * Result parameters of the execution
54
+ * The prepared pipeline that was used for the execution
44
55
  *
45
- * Note: If the execution was not successful, there are only some of the result parameters
56
+ * Note: If you called `createPipelineExecutor` with fully prepared pipeline, this is the same object as this pipeline
57
+ * If you passed not fully prepared pipeline, this is same pipeline but fully prepared
46
58
  */
47
- readonly outputParameters: Parameters;
59
+ readonly preparedPipeline: PipelineJson;
48
60
  };
49
61
  /**
50
62
  * TODO: [🧠] Should this file be in /execution or /types folder?
51
- * TODO: [💷] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result
63
+ * TODO: [💷] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result - BUT maybe NOT?
52
64
  */
@@ -20,6 +20,16 @@ type CreatePipelineExecutorSettings = {
20
20
  * @default false
21
21
  */
22
22
  readonly isVerbose?: boolean;
23
+ /**
24
+ * If you pass fully prepared pipeline, this does not matter
25
+ *
26
+ * Otherwise:
27
+ * If false or not set, warning is shown when pipeline is not prepared
28
+ * If true, warning is suppressed
29
+ *
30
+ * @default false
31
+ */
32
+ readonly isNotPreparedWarningSupressed?: boolean;
23
33
  };
24
34
  /**
25
35
  * Options for `createPipelineExecutor`
@@ -47,8 +57,6 @@ interface CreatePipelineExecutorOptions {
47
57
  export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor;
48
58
  export {};
49
59
  /**
50
- * TODO: !!!!! return `preparedPipeline` from execution
51
- * TODO: !!!!! `isNotPreparedWarningSupressed`
52
60
  * TODO: Use isVerbose here (not only pass to `preparePipeline`)
53
61
  * TODO: [🪂] Use maxParallelCount here (not only pass to `preparePipeline`)
54
62
  * TODO: [♈] Probbably move expectations from templates to parameters
@@ -41,7 +41,7 @@ export type ExecutionReportJson = {
41
41
  /**
42
42
  * The prompt wich was executed
43
43
  */
44
- readonly prompt: Omit<Prompt, 'pipelineUrl' | 'parameters'>;
44
+ readonly prompt: Omit<Prompt, 'pipelineUrl'>;
45
45
  /**
46
46
  * Result of the prompt execution (if not failed during LLM execution)
47
47
  */