@promptbook/node 0.77.0-0 → 0.77.0-4
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/README.md +1 -1
- package/esm/index.es.js +14 -7
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/cli.index.d.ts +4 -0
- package/esm/typings/src/_packages/core.index.d.ts +2 -0
- package/esm/typings/src/_packages/google.index.d.ts +10 -0
- package/esm/typings/src/_packages/types.index.d.ts +6 -0
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/_packages/vercel.index.d.ts +2 -0
- package/esm/typings/src/cli/cli-commands/list-models.d.ts +11 -0
- package/esm/typings/src/execution/AvailableModel.d.ts +5 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -0
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -0
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +5 -0
- package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/GoogleExecutionToolsOptions.d.ts +12 -0
- package/esm/typings/src/llm-providers/google/createGoogleExecutionTools.d.ts +18 -0
- package/esm/typings/src/llm-providers/google/register-configuration.d.ts +13 -0
- package/esm/typings/src/llm-providers/google/register-constructor.d.ts +14 -0
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +1 -1
- package/esm/typings/src/llm-providers/vercel/VercelExecutionToolsOptions.d.ts +22 -0
- package/esm/typings/src/llm-providers/vercel/VercelProvider.d.ts +13 -0
- package/esm/typings/src/llm-providers/vercel/createExecutionToolsFromVercelProvider.d.ts +2 -5
- package/esm/typings/src/utils/environment/$isRunningInJest.d.ts +8 -0
- package/package.json +2 -2
- package/umd/index.umd.js +14 -7
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/_packages/gemini.index.d.ts +0 -2
|
@@ -4,6 +4,8 @@ import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic
|
|
|
4
4
|
import { _AnthropicClaudeRegistration } from '../llm-providers/anthropic-claude/register-constructor';
|
|
5
5
|
import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
|
|
6
6
|
import { _AzureOpenAiRegistration } from '../llm-providers/azure-openai/register-constructor';
|
|
7
|
+
import { _GoogleMetadataRegistration } from '../llm-providers/google/register-configuration';
|
|
8
|
+
import { _GoogleRegistration } from '../llm-providers/google/register-constructor';
|
|
7
9
|
import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
8
10
|
import { _OpenAiAssistantMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
9
11
|
import { _OpenAiRegistration } from '../llm-providers/openai/register-constructor';
|
|
@@ -24,6 +26,8 @@ export { _AnthropicClaudeMetadataRegistration };
|
|
|
24
26
|
export { _AnthropicClaudeRegistration };
|
|
25
27
|
export { _AzureOpenAiMetadataRegistration };
|
|
26
28
|
export { _AzureOpenAiRegistration };
|
|
29
|
+
export { _GoogleMetadataRegistration };
|
|
30
|
+
export { _GoogleRegistration };
|
|
27
31
|
export { _OpenAiMetadataRegistration };
|
|
28
32
|
export { _OpenAiAssistantMetadataRegistration };
|
|
29
33
|
export { _OpenAiRegistration };
|
|
@@ -82,6 +82,7 @@ import { countTotalUsage } from '../llm-providers/_common/utils/count-total-usag
|
|
|
82
82
|
import { limitTotalUsage } from '../llm-providers/_common/utils/count-total-usage/limitTotalUsage';
|
|
83
83
|
import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
|
|
84
84
|
import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
|
|
85
|
+
import { _GoogleMetadataRegistration } from '../llm-providers/google/register-configuration';
|
|
85
86
|
import { joinLlmExecutionTools } from '../llm-providers/multiple/joinLlmExecutionTools';
|
|
86
87
|
import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools';
|
|
87
88
|
import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
@@ -196,6 +197,7 @@ export { countTotalUsage };
|
|
|
196
197
|
export { limitTotalUsage };
|
|
197
198
|
export { _AnthropicClaudeMetadataRegistration };
|
|
198
199
|
export { _AzureOpenAiMetadataRegistration };
|
|
200
|
+
export { _GoogleMetadataRegistration };
|
|
199
201
|
export { joinLlmExecutionTools };
|
|
200
202
|
export { MultipleLlmExecutionTools };
|
|
201
203
|
export { _OpenAiMetadataRegistration };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
+
import { createGoogleExecutionTools } from '../llm-providers/google/createGoogleExecutionTools';
|
|
3
|
+
import type { GoogleExecutionToolsOptions } from '../llm-providers/google/GoogleExecutionToolsOptions';
|
|
4
|
+
import { _GoogleRegistration } from '../llm-providers/google/register-constructor';
|
|
5
|
+
import type { VercelExecutionToolsOptions } from '../llm-providers/vercel/VercelExecutionToolsOptions';
|
|
6
|
+
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
7
|
+
export { createGoogleExecutionTools };
|
|
8
|
+
export type { GoogleExecutionToolsOptions };
|
|
9
|
+
export { _GoogleRegistration };
|
|
10
|
+
export type { VercelExecutionToolsOptions };
|
|
@@ -55,6 +55,7 @@ import type { AnthropicClaudeExecutionToolsOptions } from '../llm-providers/anth
|
|
|
55
55
|
import type { AnthropicClaudeExecutionToolsDirectOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
|
|
56
56
|
import type { AnthropicClaudeExecutionToolsProxiedOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
|
|
57
57
|
import type { AzureOpenAiExecutionToolsOptions } from '../llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions';
|
|
58
|
+
import type { GoogleExecutionToolsOptions } from '../llm-providers/google/GoogleExecutionToolsOptions';
|
|
58
59
|
import type { OpenAiAssistantExecutionToolsOptions } from '../llm-providers/openai/OpenAiAssistantExecutionToolsOptions';
|
|
59
60
|
import type { OpenAiExecutionToolsOptions } from '../llm-providers/openai/OpenAiExecutionToolsOptions';
|
|
60
61
|
import type { PromptbookServer_Error } from '../llm-providers/remote/interfaces/PromptbookServer_Error';
|
|
@@ -72,6 +73,8 @@ import type { RemoteServerOptions } from '../llm-providers/remote/interfaces/Rem
|
|
|
72
73
|
import type { AnonymousRemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
|
|
73
74
|
import type { CollectionRemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
|
|
74
75
|
import type { CollectionRemoteServerClientOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
|
|
76
|
+
import type { VercelExecutionToolsOptions } from '../llm-providers/vercel/VercelExecutionToolsOptions';
|
|
77
|
+
import type { VercelProvider } from '../llm-providers/vercel/VercelProvider';
|
|
75
78
|
import type { IsPipelineImplementingInterfaceOptions } from '../pipeline/PipelineInterface/isPipelineImplementingInterface';
|
|
76
79
|
import type { PipelineInterface } from '../pipeline/PipelineInterface/PipelineInterface';
|
|
77
80
|
import type { CommonTaskJson } from '../pipeline/PipelineJson/CommonTaskJson';
|
|
@@ -309,6 +312,7 @@ export type { AnthropicClaudeExecutionToolsOptions };
|
|
|
309
312
|
export type { AnthropicClaudeExecutionToolsDirectOptions };
|
|
310
313
|
export type { AnthropicClaudeExecutionToolsProxiedOptions };
|
|
311
314
|
export type { AzureOpenAiExecutionToolsOptions };
|
|
315
|
+
export type { GoogleExecutionToolsOptions };
|
|
312
316
|
export type { OpenAiAssistantExecutionToolsOptions };
|
|
313
317
|
export type { OpenAiExecutionToolsOptions };
|
|
314
318
|
export type { PromptbookServer_Error };
|
|
@@ -326,6 +330,8 @@ export type { RemoteServerOptions };
|
|
|
326
330
|
export type { AnonymousRemoteServerOptions };
|
|
327
331
|
export type { CollectionRemoteServerOptions };
|
|
328
332
|
export type { CollectionRemoteServerClientOptions };
|
|
333
|
+
export type { VercelExecutionToolsOptions };
|
|
334
|
+
export type { VercelProvider };
|
|
329
335
|
export type { IsPipelineImplementingInterfaceOptions };
|
|
330
336
|
export type { PipelineInterface };
|
|
331
337
|
export type { CommonTaskJson };
|
|
@@ -10,6 +10,7 @@ import { forEachAsync } from '../execution/utils/forEachAsync';
|
|
|
10
10
|
import { isValidJsonString } from '../formats/json/utils/isValidJsonString';
|
|
11
11
|
import { $getCurrentDate } from '../utils/$getCurrentDate';
|
|
12
12
|
import { $isRunningInBrowser } from '../utils/environment/$isRunningInBrowser';
|
|
13
|
+
import { $isRunningInJest } from '../utils/environment/$isRunningInJest';
|
|
13
14
|
import { $isRunningInNode } from '../utils/environment/$isRunningInNode';
|
|
14
15
|
import { $isRunningInWebWorker } from '../utils/environment/$isRunningInWebWorker';
|
|
15
16
|
import { CHARACTERS_PER_STANDARD_LINE } from '../utils/expectation-counters/constants';
|
|
@@ -84,6 +85,7 @@ export { forEachAsync };
|
|
|
84
85
|
export { isValidJsonString };
|
|
85
86
|
export { $getCurrentDate };
|
|
86
87
|
export { $isRunningInBrowser };
|
|
88
|
+
export { $isRunningInJest };
|
|
87
89
|
export { $isRunningInNode };
|
|
88
90
|
export { $isRunningInWebWorker };
|
|
89
91
|
export { CHARACTERS_PER_STANDARD_LINE };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
2
|
import { createExecutionToolsFromVercelProvider } from '../llm-providers/vercel/createExecutionToolsFromVercelProvider';
|
|
3
|
+
import type { VercelProvider } from '../llm-providers/vercel/VercelProvider';
|
|
3
4
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
4
5
|
export { createExecutionToolsFromVercelProvider };
|
|
6
|
+
export type { VercelProvider };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Initializes `list-models` command for Promptbook CLI utilities
|
|
4
|
+
*
|
|
5
|
+
* @private internal function of `promptbookCli`
|
|
6
|
+
*/
|
|
7
|
+
export declare function initializeListModelsCommand(program: Program): void;
|
|
8
|
+
/**
|
|
9
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10
|
+
* Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
|
|
11
|
+
*/
|
|
@@ -8,7 +8,7 @@ export type AvailableModel = {
|
|
|
8
8
|
/**
|
|
9
9
|
* The model title
|
|
10
10
|
*/
|
|
11
|
-
readonly modelTitle
|
|
11
|
+
readonly modelTitle?: string_title;
|
|
12
12
|
/**
|
|
13
13
|
* The model name aviailable
|
|
14
14
|
*/
|
|
@@ -18,3 +18,7 @@ export type AvailableModel = {
|
|
|
18
18
|
*/
|
|
19
19
|
readonly modelVariant: ModelVariant;
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* TODO: !!!!!! Maybe remove `modelTitle`
|
|
23
|
+
* TODO: !!!!!! Put pricing information here
|
|
24
|
+
*/
|
package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
|
|
|
7
7
|
* It looks for environment variables:
|
|
8
8
|
* - `process.env.OPENAI_API_KEY`
|
|
9
9
|
* - `process.env.ANTHROPIC_CLAUDE_API_KEY`
|
|
10
|
+
* - ...
|
|
10
11
|
*
|
|
11
12
|
* @returns @@@
|
|
12
13
|
* @public exported from `@promptbook/node`
|
|
@@ -10,6 +10,7 @@ import type { CreateLlmToolsFromConfigurationOptions } from './createLlmToolsFro
|
|
|
10
10
|
* It looks for environment variables:
|
|
11
11
|
* - `process.env.OPENAI_API_KEY`
|
|
12
12
|
* - `process.env.ANTHROPIC_CLAUDE_API_KEY`
|
|
13
|
+
* - ...
|
|
13
14
|
*
|
|
14
15
|
* @returns @@@
|
|
15
16
|
* @public exported from `@promptbook/node`
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { string_SCREAMING_CASE } from '../../../utils/normalization/normalizeTo_SCREAMING_CASE';
|
|
1
2
|
import type { string_name } from '../../../types/typeAliases';
|
|
2
3
|
import type { string_title } from '../../../types/typeAliases';
|
|
3
4
|
import type { Registered } from '../../../utils/$Register';
|
|
@@ -12,6 +13,10 @@ export type LlmToolsMetadata = Registered & {
|
|
|
12
13
|
* @@@
|
|
13
14
|
*/
|
|
14
15
|
readonly title: string_title;
|
|
16
|
+
/**
|
|
17
|
+
* @@@
|
|
18
|
+
*/
|
|
19
|
+
readonly envVariables: ReadonlyArray<string_name & string_SCREAMING_CASE>;
|
|
15
20
|
/**
|
|
16
21
|
* @@@
|
|
17
22
|
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { createGoogleGenerativeAI } from '@ai-sdk/google';
|
|
2
|
+
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Options for `GoogleExecutionTools`
|
|
5
|
+
*
|
|
6
|
+
* !!!!!! This extends Google's `ClientOptions` with are directly passed to the Google generative AI client.
|
|
7
|
+
* @public exported from `@promptbook/google`
|
|
8
|
+
*/
|
|
9
|
+
export type GoogleExecutionToolsOptions = CommonToolsOptions & Parameters<typeof createGoogleGenerativeAI>[0];
|
|
10
|
+
/**
|
|
11
|
+
* TODO: [🧠][🤺] Pass `userId`
|
|
12
|
+
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
2
|
+
import type { GoogleExecutionToolsOptions } from './GoogleExecutionToolsOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Execution Tools for calling Google Gemini API.
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/google`
|
|
7
|
+
*/
|
|
8
|
+
export declare const createGoogleExecutionTools: ((options: GoogleExecutionToolsOptions) => LlmExecutionTools) & {
|
|
9
|
+
packageName: string;
|
|
10
|
+
className: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* TODO: [🧠][main] !!!! Make anonymous this with all LLM providers
|
|
14
|
+
* TODO: [🧠][🧱][main] !!!! Maybe change all `new GoogleExecutionTools` -> `createGoogleExecutionTools` in manual
|
|
15
|
+
* TODO: [🧠] Maybe auto-detect usage in browser and determine default value of `isProxied`
|
|
16
|
+
* TODO: [🦺] Is there some way how to put `packageName` and `className` on top and function definition on bottom?
|
|
17
|
+
* TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
|
|
18
|
+
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Registration } from '../../utils/$Register';
|
|
2
|
+
/**
|
|
3
|
+
* Registration of LLM provider metadata
|
|
4
|
+
*
|
|
5
|
+
* Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/core`
|
|
8
|
+
* @public exported from `@promptbook/cli`
|
|
9
|
+
*/
|
|
10
|
+
export declare const _GoogleMetadataRegistration: Registration;
|
|
11
|
+
/**
|
|
12
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13
|
+
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Registration } from '../../utils/$Register';
|
|
2
|
+
/**
|
|
3
|
+
* Registration of LLM provider
|
|
4
|
+
*
|
|
5
|
+
* Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/google`
|
|
8
|
+
* @public exported from `@promptbook/cli`
|
|
9
|
+
*/
|
|
10
|
+
export declare const _GoogleRegistration: Registration;
|
|
11
|
+
/**
|
|
12
|
+
* TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
|
|
13
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14
|
+
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AvailableModel } from '../../execution/AvailableModel';
|
|
2
|
+
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
3
|
+
import type { VercelProvider } from './VercelProvider';
|
|
4
|
+
/**
|
|
5
|
+
* Options for `createExecutionToolsFromVercelProvider`
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/google`
|
|
8
|
+
*/
|
|
9
|
+
export type VercelExecutionToolsOptions = CommonToolsOptions & {
|
|
10
|
+
/**
|
|
11
|
+
* Vercel provider for the execution tools
|
|
12
|
+
*/
|
|
13
|
+
readonly vercelProvider: VercelProvider;
|
|
14
|
+
/**
|
|
15
|
+
* List of available models for given Vercel provider
|
|
16
|
+
*/
|
|
17
|
+
readonly availableModels: ReadonlyArray<AvailableModel>;
|
|
18
|
+
/**
|
|
19
|
+
* Additional settings for chat models when calling `vercelProvider.chat('model-name', settings)`
|
|
20
|
+
*/
|
|
21
|
+
readonly additionalChatSettings?: Partial<Parameters<VercelProvider['chat']>[1]>;
|
|
22
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { createGoogleGenerativeAI } from '@ai-sdk/google';
|
|
2
|
+
import type { createOpenAI } from '@ai-sdk/openai';
|
|
3
|
+
/**
|
|
4
|
+
* This is common interface for all v1 Vercel providers
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/vercel`
|
|
7
|
+
*/
|
|
8
|
+
export type VercelProvider = ReturnType<typeof createOpenAI> | ReturnType<typeof createGoogleGenerativeAI>;
|
|
9
|
+
/**
|
|
10
|
+
* ^^^^
|
|
11
|
+
* TODO: Is there some way to get the type of the provider directly,
|
|
12
|
+
* NOT this stupid way via inferring the return type from a specific vercel provider⁉
|
|
13
|
+
*/
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import type { createOpenAI } from '@ai-sdk/openai';
|
|
2
|
-
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
3
1
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
4
|
-
type
|
|
2
|
+
import type { VercelExecutionToolsOptions } from './VercelExecutionToolsOptions';
|
|
5
3
|
/**
|
|
6
4
|
* !!!!!!
|
|
7
5
|
*
|
|
8
6
|
* @public exported from `@promptbook/vercel`
|
|
9
7
|
*/
|
|
10
|
-
export declare function createExecutionToolsFromVercelProvider(
|
|
11
|
-
export {};
|
|
8
|
+
export declare function createExecutionToolsFromVercelProvider(options: VercelExecutionToolsOptions): LlmExecutionTools;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detects if the code is running in jest environment
|
|
3
|
+
*
|
|
4
|
+
* Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/utils`
|
|
7
|
+
*/
|
|
8
|
+
export declare const $isRunningInJest: Function;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/node",
|
|
3
|
-
"version": "0.77.0-
|
|
3
|
+
"version": "0.77.0-4",
|
|
4
4
|
"description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
|
|
5
5
|
"--note-0": " <- [🐊]",
|
|
6
6
|
"private": false,
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"module": "./esm/index.es.js",
|
|
55
55
|
"typings": "./esm/typings/src/_packages/node.index.d.ts",
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@promptbook/core": "0.77.0-
|
|
57
|
+
"@promptbook/core": "0.77.0-4"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"colors": "1.4.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
*
|
|
44
44
|
* @see https://github.com/webgptorg/promptbook
|
|
45
45
|
*/
|
|
46
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.
|
|
46
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.77.0-3';
|
|
47
47
|
/**
|
|
48
48
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
49
49
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -8938,6 +8938,7 @@
|
|
|
8938
8938
|
* It looks for environment variables:
|
|
8939
8939
|
* - `process.env.OPENAI_API_KEY`
|
|
8940
8940
|
* - `process.env.ANTHROPIC_CLAUDE_API_KEY`
|
|
8941
|
+
* - ...
|
|
8941
8942
|
*
|
|
8942
8943
|
* @returns @@@
|
|
8943
8944
|
* @public exported from `@promptbook/node`
|
|
@@ -8991,16 +8992,16 @@
|
|
|
8991
8992
|
* Mixes registered LLM tools from $llmToolsMetadataRegister and $llmToolsRegister
|
|
8992
8993
|
*/
|
|
8993
8994
|
var all = [];
|
|
8994
|
-
var _loop_1 = function (packageName, className) {
|
|
8995
|
+
var _loop_1 = function (packageName, className, envVariables) {
|
|
8995
8996
|
if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
|
|
8996
8997
|
return "continue";
|
|
8997
8998
|
}
|
|
8998
|
-
all.push({ packageName: packageName, className: className });
|
|
8999
|
+
all.push({ packageName: packageName, className: className, envVariables: envVariables });
|
|
8999
9000
|
};
|
|
9000
9001
|
try {
|
|
9001
9002
|
for (var _c = __values($llmToolsMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
9002
|
-
var _e = _d.value, packageName = _e.packageName, className = _e.className;
|
|
9003
|
-
_loop_1(packageName, className);
|
|
9003
|
+
var _e = _d.value, packageName = _e.packageName, className = _e.className, envVariables = _e.envVariables;
|
|
9004
|
+
_loop_1(packageName, className, envVariables);
|
|
9004
9005
|
}
|
|
9005
9006
|
}
|
|
9006
9007
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -9049,7 +9050,7 @@
|
|
|
9049
9050
|
}
|
|
9050
9051
|
return spaceTrim__default["default"](function (block) { return "\n Available LLM providers are:\n ".concat(block(metadata
|
|
9051
9052
|
.map(function (_a, i) {
|
|
9052
|
-
var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
|
|
9053
|
+
var packageName = _a.packageName, className = _a.className, envVariables = _a.envVariables, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
|
|
9053
9054
|
var more;
|
|
9054
9055
|
if (just(false)) {
|
|
9055
9056
|
more = '';
|
|
@@ -9071,7 +9072,12 @@
|
|
|
9071
9072
|
else {
|
|
9072
9073
|
more = "(unknown state, looks like a unexpected behavior)";
|
|
9073
9074
|
}
|
|
9074
|
-
|
|
9075
|
+
var envVariablesMessage = '';
|
|
9076
|
+
if (envVariables) {
|
|
9077
|
+
envVariablesMessage = 'Configured by ' + envVariables.join(' + ');
|
|
9078
|
+
}
|
|
9079
|
+
return spaceTrim__default["default"]("\n ".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "`\n ").concat(more, "\n ").concat(envVariablesMessage, "\n "));
|
|
9080
|
+
// <- TODO: !!!!!! Is this indented correctly?
|
|
9075
9081
|
})
|
|
9076
9082
|
.join('\n')), "\n "); });
|
|
9077
9083
|
}
|
|
@@ -9124,6 +9130,7 @@
|
|
|
9124
9130
|
* It looks for environment variables:
|
|
9125
9131
|
* - `process.env.OPENAI_API_KEY`
|
|
9126
9132
|
* - `process.env.ANTHROPIC_CLAUDE_API_KEY`
|
|
9133
|
+
* - ...
|
|
9127
9134
|
*
|
|
9128
9135
|
* @returns @@@
|
|
9129
9136
|
* @public exported from `@promptbook/node`
|