@promptbook/browser 0.66.0-4 → 0.66.0-5

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
@@ -5,7 +5,7 @@ import { isRunningInBrowser } from 'openai/core';
5
5
  /**
6
6
  * The version of the Promptbook library
7
7
  */
8
- var PROMPTBOOK_VERSION = '0.66.0-3';
8
+ var PROMPTBOOK_VERSION = '0.66.0-4';
9
9
  // TODO: !!!! List here all the versions and annotate + put into script
10
10
 
11
11
  /*! *****************************************************************************
@@ -47,15 +47,15 @@ import { CallbackInterfaceTools } from '../knowledge/dialogs/callback/CallbackIn
47
47
  import type { CallbackInterfaceToolsOptions } from '../knowledge/dialogs/callback/CallbackInterfaceToolsOptions';
48
48
  import { prepareKnowledgePieces } from '../knowledge/prepare-knowledge/_common/prepareKnowledgePieces';
49
49
  import { prepareKnowledgeFromMarkdown } from '../knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown';
50
- import { $llmToolsConfigurationBoilerplatesRegister } from '../llm-providers/_common/$llmToolsConfigurationBoilerplatesRegister';
50
+ import { $llmToolsMetadataRegister } from '../llm-providers/_common/$llmToolsMetadataRegister';
51
51
  import { $llmToolsRegister } from '../llm-providers/_common/$llmToolsRegister';
52
52
  import { createLlmToolsFromConfiguration } from '../llm-providers/_common/createLlmToolsFromConfiguration';
53
53
  import { cacheLlmTools } from '../llm-providers/_common/utils/cache/cacheLlmTools';
54
54
  import { countTotalUsage } from '../llm-providers/_common/utils/count-total-usage/countTotalUsage';
55
55
  import { limitTotalUsage } from '../llm-providers/_common/utils/count-total-usage/limitTotalUsage';
56
- import { _AnthropicClaudeConfigurationRegistration } from '../llm-providers/anthropic-claude/register-configuration';
56
+ import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
57
57
  import { joinLlmExecutionTools } from '../llm-providers/multiple/joinLlmExecutionTools';
58
- import { _OpenAiConfigurationRegistration } from '../llm-providers/openai/register-configuration';
58
+ import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
59
59
  import { preparePersona } from '../personas/preparePersona';
60
60
  import { isPipelinePrepared } from '../prepare/isPipelinePrepared';
61
61
  import { preparePipeline } from '../prepare/preparePipeline';
@@ -117,15 +117,15 @@ export { CallbackInterfaceTools };
117
117
  export type { CallbackInterfaceToolsOptions };
118
118
  export { prepareKnowledgePieces };
119
119
  export { prepareKnowledgeFromMarkdown };
120
- export { $llmToolsConfigurationBoilerplatesRegister };
120
+ export { $llmToolsMetadataRegister };
121
121
  export { $llmToolsRegister };
122
122
  export { createLlmToolsFromConfiguration };
123
123
  export { cacheLlmTools };
124
124
  export { countTotalUsage };
125
125
  export { limitTotalUsage };
126
- export { _AnthropicClaudeConfigurationRegistration };
126
+ export { _AnthropicClaudeMetadataRegistration };
127
127
  export { joinLlmExecutionTools };
128
- export { _OpenAiConfigurationRegistration };
128
+ export { _OpenAiMetadataRegistration };
129
129
  export { preparePersona };
130
130
  export { isPipelinePrepared };
131
131
  export { preparePipeline };
@@ -32,6 +32,8 @@ import type { UserInterfaceTools } from '../execution/UserInterfaceTools';
32
32
  import type { UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
33
33
  import type { CallbackInterfaceToolsOptions } from '../knowledge/dialogs/callback/CallbackInterfaceToolsOptions';
34
34
  import type { LlmToolsConfiguration } from '../llm-providers/_common/LlmToolsConfiguration';
35
+ import type { LlmToolsMetadata } from '../llm-providers/_common/LlmToolsMetadata';
36
+ import type { LlmToolsOptions } from '../llm-providers/_common/LlmToolsOptions';
35
37
  import type { CacheItem } from '../llm-providers/_common/utils/cache/CacheItem';
36
38
  import type { CacheLlmToolsOptions } from '../llm-providers/_common/utils/cache/CacheLlmToolsOptions';
37
39
  import type { LlmExecutionToolsWithTotalUsage } from '../llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage';
@@ -249,6 +251,8 @@ export type { UserInterfaceTools };
249
251
  export type { UserInterfaceToolsPromptDialogOptions };
250
252
  export type { CallbackInterfaceToolsOptions };
251
253
  export type { LlmToolsConfiguration };
254
+ export type { LlmToolsMetadata };
255
+ export type { LlmToolsOptions };
252
256
  export type { CacheItem };
253
257
  export type { CacheLlmToolsOptions };
254
258
  export type { LlmExecutionToolsWithTotalUsage };
@@ -6,7 +6,7 @@ import type { Command as Program } from 'commander';
6
6
  */
7
7
  export declare function initializeMakeCommand(program: Program): void;
8
8
  /**
9
- * TODO: [🥃] !!! Allow `ptbk make` without llm tools
9
+ * TODO: [🥃] !!! Allow `ptbk make` without configuring any llm tools
10
10
  * TODO: Maybe remove this command - "about" command should be enough?
11
11
  * TODO: [0] DRY Javascript and typescript - Maybe make ONLY typescript and for javascript just remove types
12
12
  * Note: [🟡] This code should never be published outside of `@promptbook/cli`
@@ -1 +1 @@
1
- export {};
1
+ import '../../../_packages/core.index';
@@ -1,4 +1,4 @@
1
- export {};
1
+ import '../../../_packages/core.index';
2
2
  /**
3
3
  * TODO: [📓] Maybe test all file in samples (not just 10-simple.md)
4
4
  */
@@ -1 +1 @@
1
- export {};
1
+ import '../../../_packages/core.index';
@@ -1,4 +1,5 @@
1
1
  import { Register } from '../../utils/Register';
2
+ import type { LlmToolsMetadata } from './LlmToolsMetadata';
2
3
  /**
3
4
  * @@@
4
5
  *
@@ -6,7 +7,4 @@ import { Register } from '../../utils/Register';
6
7
  * @singleton Only one instance of each register is created per build, but thare can be more @@@
7
8
  * @public exported from `@promptbook/core`
8
9
  */
9
- export declare const $llmToolsConfigurationBoilerplatesRegister: Register<import("../../utils/Register").Registered & {
10
- title: string;
11
- options: object;
12
- }>;
10
+ export declare const $llmToolsMetadataRegister: Register<LlmToolsMetadata>;
@@ -1,8 +1,10 @@
1
1
  import type { string_title } from '../../types/typeAliases';
2
- import type { TODO_object } from '../../utils/organization/TODO_object';
3
2
  import type { Registered } from '../../utils/Register';
3
+ import type { LlmToolsOptions } from './LlmToolsOptions';
4
4
  /**
5
5
  * @@@
6
+ *
7
+ * @@@ `LlmToolsMetadata` vs `LlmToolsConfiguration` vs `LlmToolsOptions` (vs `Registered`)
6
8
  */
7
9
  export type LlmToolsConfiguration = Array<Registered & {
8
10
  /**
@@ -12,9 +14,9 @@ export type LlmToolsConfiguration = Array<Registered & {
12
14
  /**
13
15
  * @@@
14
16
  */
15
- options: TODO_object;
17
+ options: LlmToolsOptions;
16
18
  }>;
17
19
  /**
18
20
  * TODO: [🧠][🌰] `title` is redundant BUT maybe allow each provider pass it's own title for tracking purposes
19
- * TODO: [🧠] Maybe add option for `constructorName` instead of `className`
21
+ * TODO: Maybe instead of `LlmToolsConfiguration[number]` make `LlmToolsConfigurationItem`
20
22
  */
@@ -0,0 +1,27 @@
1
+ import type { string_name } from '../../types/typeAliases';
2
+ import type { string_title } from '../../types/typeAliases';
3
+ import type { Registered } from '../../utils/Register';
4
+ import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
5
+ /**
6
+ * @@@
7
+ *
8
+ * @@@ `LlmToolsMetadata` vs `LlmToolsConfiguration` vs `LlmToolsOptions` (vs `Registered`)
9
+ */
10
+ export type LlmToolsMetadata = Registered & {
11
+ /**
12
+ * @@@
13
+ */
14
+ title: string_title;
15
+ /**
16
+ * @@@
17
+ */
18
+ getBoilerplateConfiguration(): LlmToolsConfiguration[number];
19
+ /**
20
+ * @@@
21
+ */
22
+ createConfigurationFromEnv(env: Record<string_name, string>): LlmToolsConfiguration[number] | null;
23
+ };
24
+ /**
25
+ * TODO: Add configuration schema and maybe some documentation link
26
+ * TODO: Maybe constrain LlmToolsConfiguration[number] by generic to ensure that `createConfigurationFromEnv` and `getBoilerplateConfiguration` always create same `packageName` and `className`
27
+ */
@@ -0,0 +1,7 @@
1
+ import type { TODO_object } from '../../utils/organization/TODO_object';
2
+ /**
3
+ * @@@
4
+ *
5
+ * @@@ `LlmToolsMetadata` vs `LlmToolsConfiguration` vs `LlmToolsOptions` (vs `Registered`)
6
+ */
7
+ export type LlmToolsOptions = TODO_object;
@@ -3,7 +3,7 @@ import type { TODO_any } from '../../utils/organization/TODO_any';
3
3
  /**
4
4
  * @@@
5
5
  *
6
- * TODO: !!!!!! Not centralized - register each provider to each package
6
+ * TODO: !!!!!! Remove EXECUTION_TOOLS_CLASSES and use $llmToolsRegister instead
7
7
  *
8
8
  * @private internal type for `createLlmToolsFromConfiguration`
9
9
  */
@@ -5,4 +5,4 @@
5
5
  *
6
6
  * @public exported from `@promptbook/core`
7
7
  */
8
- export declare const _AnthropicClaudeConfigurationRegistration: void;
8
+ export declare const _AnthropicClaudeMetadataRegistration: void;
@@ -8,4 +8,4 @@
8
8
  export declare const _AnthropicClaudeRegistration: void;
9
9
  /**
10
10
  * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
11
- */
11
+ */
@@ -5,4 +5,4 @@
5
5
  *
6
6
  * @public exported from `@promptbook/core`
7
7
  */
8
- export declare const _OpenAiConfigurationRegistration: void;
8
+ export declare const _OpenAiMetadataRegistration: void;
@@ -8,4 +8,4 @@
8
8
  export declare const _OpenAiRegistration: void;
9
9
  /**
10
10
  * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
11
- */
11
+ */
@@ -1 +1 @@
1
- export {};
1
+ import '../../src/_packages/core.index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/browser",
3
- "version": "0.66.0-4",
3
+ "version": "0.66.0-5",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -47,7 +47,7 @@
47
47
  "module": "./esm/index.es.js",
48
48
  "typings": "./esm/typings/src/_packages/browser.index.d.ts",
49
49
  "peerDependencies": {
50
- "@promptbook/core": "0.66.0-4"
50
+ "@promptbook/core": "0.66.0-5"
51
51
  },
52
52
  "dependencies": {
53
53
  "spacetrim": "0.11.39"
package/umd/index.umd.js CHANGED
@@ -8,7 +8,7 @@
8
8
  /**
9
9
  * The version of the Promptbook library
10
10
  */
11
- var PROMPTBOOK_VERSION = '0.66.0-3';
11
+ var PROMPTBOOK_VERSION = '0.66.0-4';
12
12
  // TODO: !!!! List here all the versions and annotate + put into script
13
13
 
14
14
  /*! *****************************************************************************