@promptbook/remote-server 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 +6 -6
  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 +6 -6
package/esm/index.es.js CHANGED
@@ -7,8 +7,8 @@ import spaceTrim$1, { spaceTrim } from 'spacetrim';
7
7
  /**
8
8
  * The version of the Promptbook library
9
9
  */
10
- var PROMPTBOOK_VERSION = '0.72.0-3';
11
- // TODO:[main] !!!! List here all the versions and annotate + put into script
10
+ var PROMPTBOOK_VERSION = '0.72.0-5';
11
+ // TODO: [main] !!!! List here all the versions and annotate + put into script
12
12
 
13
13
  /*! *****************************************************************************
14
14
  Copyright (c) Microsoft Corporation.
@@ -1159,10 +1159,10 @@ function startRemoteServer(options) {
1159
1159
  case 1:
1160
1160
  _c.trys.push([1, 14, 15, 16]);
1161
1161
  if (isAnonymous === true && !isAnonymousModeAllowed) {
1162
- throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO:[main] !!! Test
1162
+ throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!! Test
1163
1163
  }
1164
1164
  if (isAnonymous === false && !isCollectionModeAllowed) {
1165
- throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO:[main] !!! Test
1165
+ throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: [main] !!! Test
1166
1166
  }
1167
1167
  llmExecutionTools = void 0;
1168
1168
  if (!(isAnonymous === true && llmToolsConfiguration !== null)) return [3 /*break*/, 2];
@@ -1253,10 +1253,10 @@ function startRemoteServer(options) {
1253
1253
  case 1:
1254
1254
  _b.trys.push([1, 3, 4, 5]);
1255
1255
  if (isAnonymous === true && !isAnonymousModeAllowed) {
1256
- throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO:[main] !!! Test
1256
+ throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!! Test
1257
1257
  }
1258
1258
  if (isAnonymous === false && !isCollectionModeAllowed) {
1259
- throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO:[main] !!! Test
1259
+ throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: [main] !!! Test
1260
1260
  }
1261
1261
  llmExecutionTools = void 0;
1262
1262
  if (isAnonymous === true) {
@@ -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/remote-server",
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/remote-server.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
  "colors": "1.4.0",
package/umd/index.umd.js CHANGED
@@ -14,8 +14,8 @@
14
14
  /**
15
15
  * The version of the Promptbook library
16
16
  */
17
- var PROMPTBOOK_VERSION = '0.72.0-3';
18
- // TODO:[main] !!!! List here all the versions and annotate + put into script
17
+ var PROMPTBOOK_VERSION = '0.72.0-5';
18
+ // TODO: [main] !!!! List here all the versions and annotate + put into script
19
19
 
20
20
  /*! *****************************************************************************
21
21
  Copyright (c) Microsoft Corporation.
@@ -1166,10 +1166,10 @@
1166
1166
  case 1:
1167
1167
  _c.trys.push([1, 14, 15, 16]);
1168
1168
  if (isAnonymous === true && !isAnonymousModeAllowed) {
1169
- throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO:[main] !!! Test
1169
+ throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!! Test
1170
1170
  }
1171
1171
  if (isAnonymous === false && !isCollectionModeAllowed) {
1172
- throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO:[main] !!! Test
1172
+ throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: [main] !!! Test
1173
1173
  }
1174
1174
  llmExecutionTools = void 0;
1175
1175
  if (!(isAnonymous === true && llmToolsConfiguration !== null)) return [3 /*break*/, 2];
@@ -1260,10 +1260,10 @@
1260
1260
  case 1:
1261
1261
  _b.trys.push([1, 3, 4, 5]);
1262
1262
  if (isAnonymous === true && !isAnonymousModeAllowed) {
1263
- throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO:[main] !!! Test
1263
+ throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!! Test
1264
1264
  }
1265
1265
  if (isAnonymous === false && !isCollectionModeAllowed) {
1266
- throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO:[main] !!! Test
1266
+ throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: [main] !!! Test
1267
1267
  }
1268
1268
  llmExecutionTools = void 0;
1269
1269
  if (isAnonymous === true) {