@promptbook/browser 0.72.0-4 → 0.72.0-6

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.
Files changed (23) hide show
  1. package/esm/index.es.js +2 -2
  2. package/esm/typings/src/_packages/core.index.d.ts +4 -0
  3. package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
  4. package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +5 -1
  5. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +1 -1
  6. package/esm/typings/src/errors/AbstractFormatError.d.ts +11 -0
  7. package/esm/typings/src/execution/PipelineExecutor.d.ts +1 -0
  8. package/esm/typings/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +3 -0
  9. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +3 -0
  10. package/esm/typings/src/execution/createPipelineExecutor/20-executeTemplate.d.ts +3 -0
  11. package/esm/typings/src/execution/createPipelineExecutor/{30-executeFormatCells.d.ts → 30-executeFormatSubvalues.d.ts} +2 -6
  12. package/esm/typings/src/execution/embeddingVectorToString.d.ts +1 -1
  13. package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +2 -1
  14. package/esm/typings/src/formats/csv/CsvFormatError.d.ts +10 -0
  15. package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +2 -2
  16. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -1
  17. package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +1 -1
  18. package/esm/typings/src/types/PipelineJson/ParameterJson.d.ts +1 -1
  19. package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +0 -3
  20. package/esm/typings/src/types/execution-report/executionReportJsonToString.d.ts +2 -1
  21. package/esm/typings/src/types/typeAliases.d.ts +1 -1
  22. package/package.json +2 -2
  23. package/umd/index.umd.js +2 -2
package/esm/index.es.js CHANGED
@@ -5,8 +5,8 @@ import { isRunningInBrowser } from 'openai/core';
5
5
  /**
6
6
  * The version of the Promptbook library
7
7
  */
8
- var PROMPTBOOK_VERSION = '0.72.0-3';
9
- // TODO:[main] !!!! List here all the versions and annotate + put into script
8
+ var PROMPTBOOK_VERSION = '0.72.0-5';
9
+ // TODO: [main] !!!! List here all the versions and annotate + put into script
10
10
 
11
11
  /*! *****************************************************************************
12
12
  Copyright (c) Microsoft Corporation.
@@ -26,6 +26,7 @@ import { pipelineStringToJsonSync } from '../conversion/pipelineStringToJsonSync
26
26
  import { prettifyPipelineString } from '../conversion/prettify/prettifyPipelineString';
27
27
  import { stringifyPipelineJson } from '../conversion/utils/stringifyPipelineJson';
28
28
  import { validatePipeline } from '../conversion/validation/validatePipeline';
29
+ import { AbstractFormatError } from '../errors/AbstractFormatError';
29
30
  import { CollectionError } from '../errors/CollectionError';
30
31
  import { EnvironmentMismatchError } from '../errors/EnvironmentMismatchError';
31
32
  import { ExpectError } from '../errors/ExpectError';
@@ -48,6 +49,7 @@ import { UNCERTAIN_USAGE } from '../execution/utils/usage-constants';
48
49
  import { usageToHuman } from '../execution/utils/usageToHuman';
49
50
  import { usageToWorktime } from '../execution/utils/usageToWorktime';
50
51
  import { CsvFormatDefinition } from '../formats/csv/CsvFormatDefinition';
52
+ import { CsvFormatError } from '../formats/csv/CsvFormatError';
51
53
  import { MANDATORY_CSV_SETTINGS } from '../formats/csv/CsvSettings';
52
54
  import { TextFormatDefinition } from '../formats/text/TextFormatDefinition';
53
55
  import { CallbackInterfaceTools } from '../knowledge/dialogs/callback/CallbackInterfaceTools';
@@ -105,6 +107,7 @@ export { pipelineStringToJsonSync };
105
107
  export { prettifyPipelineString };
106
108
  export { stringifyPipelineJson };
107
109
  export { validatePipeline };
110
+ export { AbstractFormatError };
108
111
  export { CollectionError };
109
112
  export { EnvironmentMismatchError };
110
113
  export { ExpectError };
@@ -127,6 +130,7 @@ export { UNCERTAIN_USAGE };
127
130
  export { usageToHuman };
128
131
  export { usageToWorktime };
129
132
  export { CsvFormatDefinition };
133
+ export { CsvFormatError };
130
134
  export { MANDATORY_CSV_SETTINGS };
131
135
  export { TextFormatDefinition };
132
136
  export { CallbackInterfaceTools };
@@ -25,5 +25,5 @@ type CreatePipelineCollectionFromUrlyOptions = {
25
25
  export declare function createCollectionFromUrl(url: string_url | URL, options: CreatePipelineCollectionFromUrlyOptions): Promise<PipelineCollection>;
26
26
  export {};
27
27
  /**
28
- * TODO:[main] !!!! [🧠] Library precompilation and do not mix markdown and json promptbooks
28
+ * TODO: [main] !!!! [🧠] Library precompilation and do not mix markdown and json promptbooks
29
29
  */
@@ -19,5 +19,9 @@ export type ForeachJson = {
19
19
  /**
20
20
  * @@@
21
21
  */
22
- readonly subparameterNames: Array<string_parameter_name>;
22
+ readonly inputSubparameterNames: Array<string_parameter_name>;
23
+ /**
24
+ * @@@
25
+ */
26
+ readonly outputSubparameterName: string_parameter_name;
23
27
  };
@@ -18,7 +18,7 @@ import type { PipelineString } from '../types/PipelineString';
18
18
  */
19
19
  export declare function pipelineStringToJsonSync(pipelineString: PipelineString): PipelineJson;
20
20
  /**
21
- * TODO:[main] !!!! Warn if used only sync version
21
+ * TODO: [main] !!!! Warn if used only sync version
22
22
  * TODO: [🚞] Report here line/column of error
23
23
  * TODO: Use spaceTrim more effectively
24
24
  * TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This error indicates problems parsing the format value
3
+ *
4
+ * For example, when the format value is not a valid JSON or CSV
5
+ * This is not thrown directly but in extended classes
6
+ *
7
+ * @public exported from `@promptbook/core`
8
+ */
9
+ export declare class AbstractFormatError extends Error {
10
+ constructor(message: string);
11
+ }
@@ -14,5 +14,6 @@ export type PipelineExecutor = {
14
14
  (inputParameters: Parameters, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<PipelineExecutorResult>;
15
15
  };
16
16
  /**
17
+ * TODO: [🐚] Change onProgress to object that represents the running execution, can be subscribed via RxJS to and also awaited
17
18
  * TODO: [🧠] Should this file be in /execution or /types folder?
18
19
  */
@@ -8,3 +8,6 @@ import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorO
8
8
  * @public exported from `@promptbook/core`
9
9
  */
10
10
  export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor;
11
+ /**
12
+ * TODO: [🐚] Change onProgress to object that represents the running execution, can be subscribed via RxJS to and also awaited
13
+ */
@@ -53,3 +53,6 @@ type ExecutePipelineOptions = {
53
53
  */
54
54
  export declare function executePipeline(options: ExecutePipelineOptions): Promise<PipelineExecutorResult>;
55
55
  export {};
56
+ /**
57
+ * TODO: [🐚] Change onProgress to object that represents the running execution, can be subscribed via RxJS to and also awaited
58
+ */
@@ -60,3 +60,6 @@ export {};
60
60
  /**
61
61
  * TODO: [🤹‍♂️]
62
62
  */
63
+ /**
64
+ * TODO: [🐚] Change onProgress to object that represents the running execution, can be subscribed via RxJS to and also awaited
65
+ */
@@ -3,7 +3,7 @@ import type { ExecuteAttemptsOptions } from './40-executeAttempts';
3
3
  /**
4
4
  * @@@
5
5
  *
6
- * @private internal type of `executeFormatCells`
6
+ * @private internal type of `executeFormatSubvalues`
7
7
  */
8
8
  type ExecuteFormatCellsOptions = ExecuteAttemptsOptions;
9
9
  /**
@@ -11,9 +11,5 @@ type ExecuteFormatCellsOptions = ExecuteAttemptsOptions;
11
11
  *
12
12
  * @private internal utility of `createPipelineExecutor`
13
13
  */
14
- export declare function executeFormatCells(options: ExecuteFormatCellsOptions): Promise<TODO_any>;
14
+ export declare function executeFormatSubvalues(options: ExecuteFormatCellsOptions): Promise<TODO_any>;
15
15
  export {};
16
- /**
17
- * TODO: !!!!!! Make pipelineIdentification more precise
18
- * TODO: !!!!!! How FOREACH execution looks in the report
19
- */
@@ -4,4 +4,4 @@ import type { EmbeddingVector } from './EmbeddingVector';
4
4
  *
5
5
  * @public exported from `@promptbook/core`
6
6
  */
7
- export declare function embeddingVectorToString(embeddingVector: EmbeddingVector): string;
7
+ export declare function embeddingVectorToString(embeddingVector: Readonly<EmbeddingVector>): string;
@@ -1,5 +1,6 @@
1
1
  import type { Promisable } from 'type-fest';
2
2
  import type { Parameters } from '../../types/typeAliases';
3
+ import type { string_parameter_name } from '../../types/typeAliases';
3
4
  import type { string_name } from '../../types/typeAliases';
4
5
  import type { string_SCREAMING_CASE } from '../../utils/normalization/normalizeTo_SCREAMING_CASE';
5
6
  import type { empty_object } from '../../utils/organization/empty_object';
@@ -23,7 +24,7 @@ export type FormatSubvalueDefinition<TValue extends string, TSettings extends em
23
24
  * For example, if you have a JSON object and you want to map all values to uppercase
24
25
  * Or iterate over all CSV cells @@@
25
26
  */
26
- mapValues(value: TValue, settings: TSettings, mapCallback: (subvalues: Parameters, index: number) => Promisable<string>): Promise<string>;
27
+ mapValues(value: TValue, outputParameterName: string_parameter_name, settings: TSettings, mapCallback: (subvalues: Parameters, index: number) => Promisable<string>): Promise<string>;
27
28
  };
28
29
  /**
29
30
  * Note: [👩🏾‍🤝‍🧑🏽]
@@ -0,0 +1,10 @@
1
+ import { AbstractFormatError } from "../../errors/AbstractFormatError";
2
+ /**
3
+ * This error indicates problem with parsing of CSV
4
+ *
5
+ * @public exported from `@promptbook/core`
6
+ */
7
+ export declare class CsvFormatError extends AbstractFormatError {
8
+ readonly name = "CsvFormatError";
9
+ constructor(message: string);
10
+ }
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ts-node
2
2
  export {};
3
3
  /**
4
- * TODO:[main] !!! Playground with WebGPT / Promptbook.studio anonymous server
5
- * TODO:[main] !!! Test here that `systemMessage`, `temperature` and `seed` are working correctly
4
+ * TODO: [main] !!! Playground with WebGPT / Promptbook.studio anonymous server
5
+ * TODO: [main] !!! Test here that `systemMessage`, `temperature` and `seed` are working correctly
6
6
  */
@@ -14,7 +14,7 @@ import { OpenAiExecutionTools } from './OpenAiExecutionTools';
14
14
  * @public exported from `@promptbook/openai`
15
15
  */
16
16
  export declare class OpenAiAssistantExecutionTools extends OpenAiExecutionTools implements LlmExecutionTools {
17
- private readonly assistantId?;
17
+ private readonly assistantId;
18
18
  /**
19
19
  * Creates OpenAI Execution Tools.
20
20
  *
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ts-node
2
2
  export {};
3
3
  /**
4
- * TODO:[main] !!! Test here that `systemMessage`, `temperature` and `seed` are working correctly
4
+ * TODO: [main] !!! Test here that `systemMessage`, `temperature` and `seed` are working correctly
5
5
  */
@@ -33,7 +33,7 @@ export type ParameterJson = {
33
33
  readonly sampleValues?: Array<string_parameter_value>;
34
34
  };
35
35
  /**
36
- * TODO: [🧠] !!!!!! Should be here registered subparameter from foreach or not?
36
+ * TODO: [🧠] Should be here registered subparameters from foreach or not?
37
37
  * TODO: [♈] Probbably move expectations from templates to parameters
38
38
  * TODO: [🍙] Make some standard order of json properties
39
39
  */
@@ -39,6 +39,3 @@ export type ExecutionReportJson = {
39
39
  */
40
40
  readonly promptExecutions: Array<ExecutionPromptReportJson>;
41
41
  };
42
- /**
43
- * TODO: !!!!!! FOREACH in report
44
- */
@@ -1,3 +1,4 @@
1
+ import type { ReadonlyDeep } from 'type-fest';
1
2
  import type { ExecutionReportJson } from './ExecutionReportJson';
2
3
  import type { ExecutionReportString } from './ExecutionReportString';
3
4
  import type { ExecutionReportStringOptions } from './ExecutionReportStringOptions';
@@ -6,7 +7,7 @@ import type { ExecutionReportStringOptions } from './ExecutionReportStringOption
6
7
  *
7
8
  * @public exported from `@promptbook/core`
8
9
  */
9
- export declare function executionReportJsonToString(executionReportJson: ExecutionReportJson, options?: Partial<ExecutionReportStringOptions>): ExecutionReportString;
10
+ export declare function executionReportJsonToString(executionReportJson: ReadonlyDeep<ExecutionReportJson>, options?: Partial<ExecutionReportStringOptions>): ExecutionReportString;
10
11
  /**
11
12
  * TODO: Add mermaid chart for every report
12
13
  * TODO: [🧠] Allow to filter out some parts of the report by options
@@ -592,7 +592,7 @@ export type number_megabytes = number_positive;
592
592
  export type number_gigabytes = number_positive;
593
593
  export type number_terabytes = number_positive;
594
594
  /**.
595
- * TODO:[main] !!! Change "For example" to @example
595
+ * TODO: [main] !!! Change "For example" to @example
596
596
  * TODO: !! Change to branded types
597
597
  * TODO: Delete type aliases that are not exported or used internally
598
598
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/browser",
3
- "version": "0.72.0-4",
3
+ "version": "0.72.0-6",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -51,7 +51,7 @@
51
51
  "module": "./esm/index.es.js",
52
52
  "typings": "./esm/typings/src/_packages/browser.index.d.ts",
53
53
  "peerDependencies": {
54
- "@promptbook/core": "0.72.0-4"
54
+ "@promptbook/core": "0.72.0-6"
55
55
  },
56
56
  "dependencies": {
57
57
  "spacetrim": "0.11.39"
package/umd/index.umd.js CHANGED
@@ -12,8 +12,8 @@
12
12
  /**
13
13
  * The version of the Promptbook library
14
14
  */
15
- var PROMPTBOOK_VERSION = '0.72.0-3';
16
- // TODO:[main] !!!! List here all the versions and annotate + put into script
15
+ var PROMPTBOOK_VERSION = '0.72.0-5';
16
+ // TODO: [main] !!!! List here all the versions and annotate + put into script
17
17
 
18
18
  /*! *****************************************************************************
19
19
  Copyright (c) Microsoft Corporation.