@promptbook/openai 0.92.0-27 → 0.92.0-28

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 (38) hide show
  1. package/esm/index.es.js +7 -7
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/core.index.d.ts +4 -4
  4. package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +0 -2
  5. package/esm/typings/src/constants.d.ts +35 -0
  6. package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -1
  7. package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +2 -1
  8. package/esm/typings/src/executables/apps/locatePandoc.d.ts +2 -1
  9. package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +2 -1
  10. package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +2 -1
  11. package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +2 -1
  12. package/esm/typings/src/execution/AbstractTaskResult.d.ts +1 -1
  13. package/esm/typings/src/execution/LlmExecutionToolsConstructor.d.ts +2 -1
  14. package/esm/typings/src/execution/PipelineExecutorResult.d.ts +1 -1
  15. package/esm/typings/src/execution/createPipelineExecutor/$OngoingTaskResult.d.ts +12 -9
  16. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +20 -14
  17. package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +7 -6
  18. package/esm/typings/src/execution/createPipelineExecutor/getContextForTask.d.ts +5 -1
  19. package/esm/typings/src/execution/createPipelineExecutor/getExamplesForTask.d.ts +1 -1
  20. package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +8 -11
  21. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +4 -4
  22. package/esm/typings/src/formats/csv/CsvSettings.d.ts +2 -2
  23. package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +2 -2
  24. package/esm/typings/src/formfactors/completion/CompletionFormfactorDefinition.d.ts +1 -1
  25. package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +2 -1
  26. package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +2 -2
  27. package/esm/typings/src/formfactors/index.d.ts +3 -3
  28. package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +4 -37
  29. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  30. package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
  31. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  32. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  33. package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -2
  34. package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -2
  35. package/esm/typings/src/version.d.ts +1 -1
  36. package/package.json +2 -2
  37. package/umd/index.umd.js +7 -7
  38. package/umd/index.umd.js.map +1 -1
@@ -3,30 +3,31 @@ import { PipelineExecutionError } from '../../errors/PipelineExecutionError';
3
3
  import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
4
4
  import type { Parameters } from '../../types/typeAliases';
5
5
  /**
6
- * @@@
6
+ * Options for filtering and extracting only output parameters from a pipeline execution.
7
7
  *
8
8
  * @private internal type of `createPipelineExecutor`
9
9
  */
10
10
  type FilterJustOutputParametersOptions = {
11
11
  /**
12
- * @@@
12
+ * The fully prepared pipeline containing parameter definitions.
13
13
  */
14
14
  readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
15
15
  /**
16
- * @@@
16
+ * The parameters passed to the pipeline, including both input and output values.
17
17
  */
18
18
  readonly parametersToPass: Readonly<Parameters>;
19
19
  /**
20
- * @@@
20
+ * Array to collect warnings encountered during parameter extraction.
21
21
  */
22
22
  readonly $warnings: PipelineExecutionError[];
23
23
  /**
24
- * @@@
24
+ * String identifier for the pipeline, used in warning messages.
25
25
  */
26
26
  readonly pipelineIdentification: string;
27
27
  };
28
28
  /**
29
- * @@@
29
+ * Filters and returns only the output parameters from the provided pipeline execution options.
30
+ * Adds warnings for any expected output parameters that are missing.
30
31
  *
31
32
  * @private internal utility of `createPipelineExecutor`
32
33
  */
@@ -3,8 +3,12 @@ import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
3
3
  import type { string_markdown } from '../../types/typeAliases';
4
4
  import type { string_parameter_value } from '../../types/typeAliases';
5
5
  /**
6
- * @@@
6
+ * Returns the context for a given task, typically used to provide additional information or variables
7
+ * required for the execution of the task within a pipeline. The context is returned as a string value
8
+ * that may include markdown formatting.
7
9
  *
10
+ * @param task - The task for which the context is being generated. This should be a deeply immutable TaskJson object.
11
+ * @returns The context as a string, formatted as markdown and parameter value.
8
12
  * @private internal utility of `createPipelineExecutor`
9
13
  */
10
14
  export declare function getContextForTask(task: ReadonlyDeep<TaskJson>): Promise<string_parameter_value & string_markdown>;
@@ -3,7 +3,7 @@ import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
3
3
  import type { string_markdown } from '../../types/typeAliases';
4
4
  import type { string_parameter_value } from '../../types/typeAliases';
5
5
  /**
6
- * @@@
6
+ * Retrieves example values or templates for a given task, used to guide or validate pipeline execution.
7
7
  *
8
8
  * @private internal utility of `createPipelineExecutor`
9
9
  */
@@ -6,34 +6,31 @@ import type { string_markdown } from '../../types/typeAliases';
6
6
  import type { string_parameter_value } from '../../types/typeAliases';
7
7
  import type { ExecutionTools } from '../ExecutionTools';
8
8
  /**
9
- * @@@
9
+ * Options for retrieving relevant knowledge for a specific task during pipeline execution.
10
10
  *
11
- * @private internal type of `getKnowledgeFoTask`
11
+ * @private internal type of `getKnowledgeForTask`
12
12
  */
13
13
  type GetKnowledgeForTaskOptions = {
14
14
  /**
15
- * The execution tools to be used during the execution of the pipeline
15
+ * The execution tools to be used during the execution of the pipeline.
16
16
  */
17
17
  readonly tools: ExecutionTools;
18
18
  /**
19
- * @@@
19
+ * The fully prepared pipeline containing all tasks and knowledge pieces.
20
20
  */
21
21
  readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
22
22
  /**
23
- * @@@
23
+ * The current task for which knowledge is being retrieved.
24
24
  */
25
25
  readonly task: ReadonlyDeep<TaskJson>;
26
26
  /**
27
- * @@@
28
- *
29
- * Parameters to complete the content of the task for embedding
27
+ * Parameters used to complete the content of the task for embedding and knowledge retrieval.
30
28
  */
31
29
  readonly parameters: Readonly<Parameters>;
32
30
  };
33
31
  /**
34
- * @@@
35
- *
36
- * Here is the place where RAG (retrieval-augmented generation) happens
32
+ * Retrieves the most relevant knowledge pieces for a given task using embedding-based similarity search.
33
+ * This is where retrieval-augmented generation (RAG) is performed to enhance the task with external knowledge.
37
34
  *
38
35
  * @private internal utility of `createPipelineExecutor`
39
36
  */
@@ -1,18 +1,18 @@
1
1
  import type { AutomaticTranslator } from './AutomaticTranslator';
2
2
  import type { TranslatorOptions } from './TranslatorOptions';
3
3
  /**
4
- * @@@
4
+ * Options for configuring the Lindat automatic translator, including API URL and language settings.
5
5
  */
6
6
  type LindatAutomaticTranslatorOptions = TranslatorOptions & {
7
7
  /**
8
- * @@@
8
+ * Optional URL of the Lindat translation API endpoint.
9
9
  */
10
10
  readonly apiUrl?: URL;
11
11
  };
12
12
  /**
13
- * @@@
13
+ * Automatic translator implementation using the Lindat translation API.
14
14
  *
15
- * @private still in development [🏳]
15
+ * @private still in development [🏳️]
16
16
  */
17
17
  export declare class LindatAutomaticTranslator implements AutomaticTranslator {
18
18
  protected readonly options: LindatAutomaticTranslatorOptions;
@@ -1,10 +1,10 @@
1
1
  import type { ParseConfig, UnparseConfig } from 'papaparse';
2
2
  /**
3
- * @@@
3
+ * Settings and configuration options for CSV format handling within the application.
4
4
  */
5
5
  export type CsvSettings = Pick<ParseConfig & UnparseConfig, 'delimiter' | 'quoteChar' | 'newline' | 'skipEmptyLines'>;
6
6
  /**
7
- * @@@
7
+ * Contains configuration options for parsing and generating CSV files, such as delimiters and quoting rules.
8
8
  *
9
9
  * @public exported from `@promptbook/core`
10
10
  */
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @@@
2
+ * Chatbot form factor definition for conversational interfaces that interact with users in a chat-like manner.
3
3
  *
4
4
  * @public exported from `@promptbook/core`
5
5
  */
6
6
  export declare const ChatbotFormfactorDefinition: {
7
7
  readonly name: "CHATBOT";
8
8
  readonly aliasNames: readonly ["CHAT"];
9
- readonly description: "@@@";
9
+ readonly description: "A chatbot form factor for conversational user interfaces.";
10
10
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/174";
11
11
  readonly pipelineInterface: {
12
12
  readonly inputParameters: readonly [{
@@ -5,7 +5,7 @@
5
5
  */
6
6
  export declare const CompletionFormfactorDefinition: {
7
7
  readonly name: "COMPLETION";
8
- readonly description: "@@@";
8
+ readonly description: "Completion is formfactor that emulates completion models";
9
9
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
10
10
  readonly pipelineInterface: {
11
11
  readonly inputParameters: readonly [{
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Generator is form of app that @@@
2
+ * Generator form factor represents an application that generates content or data based on user input or predefined rules.
3
+ * This form factor is used for apps that produce outputs, such as text, images, or other media, based on provided input.
3
4
  *
4
5
  * @public exported from `@promptbook/core`
5
6
  */
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @@@
2
+ * A generic pipeline
3
3
  *
4
4
  * @public exported from `@promptbook/core`
5
5
  */
6
6
  export declare const GenericFormfactorDefinition: {
7
7
  readonly name: "GENERIC";
8
- readonly description: "@@@";
8
+ readonly description: "A generic pipeline";
9
9
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/173";
10
10
  readonly pipelineInterface: {
11
11
  readonly inputParameters: readonly [];
@@ -5,7 +5,7 @@
5
5
  */
6
6
  export declare const FORMFACTOR_DEFINITIONS: readonly [{
7
7
  readonly name: "GENERIC";
8
- readonly description: "@@@";
8
+ readonly description: "A generic pipeline";
9
9
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/173";
10
10
  readonly pipelineInterface: {
11
11
  readonly inputParameters: readonly [];
@@ -14,7 +14,7 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
14
14
  }, {
15
15
  readonly name: "CHATBOT";
16
16
  readonly aliasNames: readonly ["CHAT"];
17
- readonly description: "@@@";
17
+ readonly description: "A chatbot form factor for conversational user interfaces.";
18
18
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/174";
19
19
  readonly pipelineInterface: {
20
20
  readonly inputParameters: readonly [{
@@ -143,7 +143,7 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
143
143
  };
144
144
  }, {
145
145
  readonly name: "COMPLETION";
146
- readonly description: "@@@";
146
+ readonly description: "Completion is formfactor that emulates completion models";
147
147
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
148
148
  readonly pipelineInterface: {
149
149
  readonly inputParameters: readonly [{
@@ -1,43 +1,10 @@
1
+ import { MODEL_ORDERS } from '../../../constants';
2
+ import { MODEL_TRUST_LEVELS } from '../../../constants';
1
3
  import type { string_name } from '../../../types/typeAliases';
2
4
  import type { string_title } from '../../../types/typeAliases';
3
5
  import type { Registered } from '../../../utils/$Register';
4
6
  import type { string_SCREAMING_CASE } from '../../../utils/normalization/normalizeTo_SCREAMING_CASE';
5
7
  import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
6
- /**
7
- * How is the model provider trusted?
8
- *
9
- * @public exported from `@promptbook/core`
10
- */
11
- export declare const MODEL_TRUST_LEVEL: {
12
- readonly FULL: "Model is running on the local machine, training data and model weights are known, data are ethically sourced";
13
- readonly OPEN: "Model is open source, training data and model weights are known";
14
- readonly PARTIALLY_OPEN: "Model is open source, but training data and model weights are not (fully) known";
15
- readonly CLOSED_LOCAL: "Model can be run locally, but it is not open source";
16
- readonly CLOSED_FREE: "Model is behind API gateway but free to use";
17
- readonly CLOSED_BUSINESS: "Model is behind API gateway and paid but has good SLA, TOS, privacy policy and in general is a good to use in business applications";
18
- readonly CLOSED: "Model is behind API gateway and paid";
19
- readonly UNTRUSTED: "Model has questions about the training data and ethics, but it is not known if it is a problem or not";
20
- readonly VURNABLE: "Model has some known serious vulnerabilities, leaks, ethical problems, etc.";
21
- };
22
- /**
23
- * How is the model provider important?
24
- *
25
- * @public exported from `@promptbook/core`
26
- */
27
- export declare const MODEL_ORDER: {
28
- /**
29
- * Top-tier models, e.g. OpenAI, Anthropic,...
30
- */
31
- readonly TOP_TIER: 333;
32
- /**
33
- * Mid-tier models, e.g. Llama, Mistral, etc.
34
- */
35
- readonly NORMAL: 100;
36
- /**
37
- * Low-tier models, e.g. Phi, Tiny, etc.
38
- */
39
- readonly LOW_TIER: 0;
40
- };
41
8
  /**
42
9
  * Metadata definition for LLM execution tools that provides information about a provider's capabilities,
43
10
  * configuration options, and relationships within the registry system.
@@ -57,11 +24,11 @@ export type LlmToolsMetadata = Registered & {
57
24
  /**
58
25
  * How is the model is trusted?
59
26
  */
60
- readonly trustLevel: keyof typeof MODEL_TRUST_LEVEL;
27
+ readonly trustLevel: keyof typeof MODEL_TRUST_LEVELS;
61
28
  /**
62
29
  * How is the model provider important and should be sorted in the list of available providers?
63
30
  */
64
- readonly order: typeof MODEL_ORDER[keyof typeof MODEL_ORDER] | number;
31
+ readonly order: typeof MODEL_ORDERS[keyof typeof MODEL_ORDERS] | number;
65
32
  /**
66
33
  * List of environment variables that can be used to configure the provider
67
34
  *
@@ -3,7 +3,7 @@ import type { number_usd } from '../../types/typeAliases';
3
3
  /**
4
4
  * List of available Anthropic Claude models with pricing
5
5
  *
6
- * Note: Done at 2024-08-16
6
+ * Note: Done at 2025-05-06
7
7
  *
8
8
  * @see https://docs.anthropic.com/en/docs/models-overview
9
9
  * @public exported from `@promptbook/anthropic-claude`
@@ -3,7 +3,7 @@ import type { number_usd } from '../../types/typeAliases';
3
3
  /**
4
4
  * List of available Deepseek models with descriptions
5
5
  *
6
- * Note: Done at 2025-04-22
6
+ * Note: Done at 2025-05-06
7
7
  *
8
8
  * @see https://www.deepseek.com/models
9
9
  * @public exported from `@promptbook/deepseek`
@@ -3,7 +3,7 @@ import type { number_usd } from '../../types/typeAliases';
3
3
  /**
4
4
  * List of available Google models with descriptions
5
5
  *
6
- * Note: Done at 2025-04-22
6
+ * Note: Done at 2025-05-06
7
7
  *
8
8
  * @see https://ai.google.dev/models/gemini
9
9
  * @public exported from `@promptbook/google`
@@ -3,7 +3,7 @@ import type { number_usd } from '../../types/typeAliases';
3
3
  /**
4
4
  * List of available OpenAI models with pricing
5
5
  *
6
- * Note: Done at 2024-05-20
6
+ * Note: Done at 2025-05-06
7
7
  *
8
8
  * @see https://platform.openai.com/docs/models/
9
9
  * @see https://openai.com/api/pricing/
@@ -10,9 +10,9 @@ import type { Registration } from '../../utils/$Register';
10
10
  */
11
11
  export declare const _OpenAiMetadataRegistration: Registration;
12
12
  /**
13
- * @@@ registration1 of default configuration for Open AI
13
+ * Registration of the OpenAI Assistant metadata
14
14
  *
15
- * Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
15
+ * Note: [🏐] Configurations registrations are done in the metadata registration section, but the constructor registration is handled separately.
16
16
  *
17
17
  * @public exported from `@promptbook/core`
18
18
  * @public exported from `@promptbook/wizzard`
@@ -10,9 +10,9 @@ import type { Registration } from '../../utils/$Register';
10
10
  */
11
11
  export declare const _OpenAiRegistration: Registration;
12
12
  /**
13
- * @@@ registration2
13
+ * Registration of the OpenAI Assistant provider
14
14
  *
15
- * Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
15
+ * Note: [🏐] Configurations registrations are done in register-constructor.ts BUT constructor register-constructor.ts
16
16
  *
17
17
  * @public exported from `@promptbook/openai`
18
18
  * @public exported from `@promptbook/wizzard`
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.92.0-26`).
18
+ * It follows semantic versioning (e.g., `0.92.0-27`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/openai",
3
- "version": "0.92.0-27",
3
+ "version": "0.92.0-28",
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,
@@ -51,7 +51,7 @@
51
51
  "module": "./esm/index.es.js",
52
52
  "typings": "./esm/typings/src/_packages/openai.index.d.ts",
53
53
  "peerDependencies": {
54
- "@promptbook/core": "0.92.0-27"
54
+ "@promptbook/core": "0.92.0-28"
55
55
  },
56
56
  "dependencies": {
57
57
  "bottleneck": "^2.19.5",
package/umd/index.umd.js CHANGED
@@ -25,7 +25,7 @@
25
25
  * @generated
26
26
  * @see https://github.com/webgptorg/promptbook
27
27
  */
28
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-27';
28
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-28';
29
29
  /**
30
30
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
31
31
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1278,7 +1278,7 @@
1278
1278
  /**
1279
1279
  * List of available OpenAI models with pricing
1280
1280
  *
1281
- * Note: Done at 2024-05-20
1281
+ * Note: Done at 2025-05-06
1282
1282
  *
1283
1283
  * @see https://platform.openai.com/docs/models/
1284
1284
  * @see https://openai.com/api/pricing/
@@ -1539,7 +1539,7 @@
1539
1539
  modelName: 'text-embedding-3-large',
1540
1540
  modelDescription: "OpenAI's most capable text embedding model designed for high-quality embeddings for complex similarity tasks and information retrieval.",
1541
1541
  pricing: {
1542
- prompt: computeUsage(`$0.13 / 1M tokens`),
1542
+ prompt: computeUsage(`$0.13 / 1M tokens`),
1543
1543
  // TODO: [🏏] Leverage the batch API @see https://platform.openai.com/docs/guides/batch
1544
1544
  output: 0, // <- Note: [🆖] In Embedding models you dont pay for output
1545
1545
  },
@@ -1632,8 +1632,8 @@
1632
1632
  modelName: 'gpt-4o-mini',
1633
1633
  modelDescription: 'Smaller, more cost-effective version of GPT-4o with good performance across text, vision, and audio tasks at reduced complexity.',
1634
1634
  pricing: {
1635
- prompt: computeUsage(`$3.00 / 1M tokens`),
1636
- output: computeUsage(`$9.00 / 1M tokens`),
1635
+ prompt: computeUsage(`$0.15 / 1M tokens`),
1636
+ output: computeUsage(`$0.60 / 1M tokens`),
1637
1637
  },
1638
1638
  },
1639
1639
  /**/
@@ -2515,9 +2515,9 @@
2515
2515
  */
2516
2516
  const _OpenAiRegistration = $llmToolsRegister.register(createOpenAiExecutionTools);
2517
2517
  /**
2518
- * @@@ registration2
2518
+ * Registration of the OpenAI Assistant provider
2519
2519
  *
2520
- * Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
2520
+ * Note: [🏐] Configurations registrations are done in register-constructor.ts BUT constructor register-constructor.ts
2521
2521
  *
2522
2522
  * @public exported from `@promptbook/openai`
2523
2523
  * @public exported from `@promptbook/wizzard`