@promptbook/core 0.65.0-2 → 0.65.0-3
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 +213 -10
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/anthropic-claude.index.d.ts +6 -0
- package/esm/typings/src/_packages/core.index.d.ts +2 -0
- package/esm/typings/src/_packages/node.index.d.ts +0 -2
- package/esm/typings/src/_packages/remote-client.index.d.ts +2 -2
- package/esm/typings/src/_packages/types.index.d.ts +16 -2
- package/esm/typings/src/llm-providers/_common/config.d.ts +3 -3
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +5 -3
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +23 -2
- package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +13 -0
- package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +3 -2
- package/esm/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Error.d.ts +2 -2
- package/esm/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Progress.d.ts +2 -2
- package/esm/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Request.d.ts +14 -2
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteLlmExecutionToolsOptions.d.ts +49 -0
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +23 -2
- package/esm/typings/src/llm-providers/remote/playground/playground.d.ts +2 -0
- package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +2 -1
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/package.json +2 -1
- package/umd/index.umd.js +216 -13
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +0 -26
package/esm/index.es.js
CHANGED
|
@@ -3,18 +3,19 @@ import { format } from 'prettier';
|
|
|
3
3
|
import parserHtml from 'prettier/parser-html';
|
|
4
4
|
import hexEncoder from 'crypto-js/enc-hex';
|
|
5
5
|
import sha256 from 'crypto-js/sha256';
|
|
6
|
-
import
|
|
6
|
+
import { io } from 'socket.io-client';
|
|
7
7
|
import Anthropic from '@anthropic-ai/sdk';
|
|
8
8
|
import colors from 'colors';
|
|
9
9
|
import { OpenAIClient, AzureKeyCredential } from '@azure/openai';
|
|
10
10
|
import OpenAI from 'openai';
|
|
11
|
+
import * as dotenv from 'dotenv';
|
|
11
12
|
import moment from 'moment';
|
|
12
13
|
|
|
13
14
|
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
14
15
|
/**
|
|
15
16
|
* The version of the Promptbook library
|
|
16
17
|
*/
|
|
17
|
-
var PROMPTBOOK_VERSION = '0.65.0-
|
|
18
|
+
var PROMPTBOOK_VERSION = '0.65.0-2';
|
|
18
19
|
// TODO: !!!! List here all the versions and annotate + put into script
|
|
19
20
|
|
|
20
21
|
/*! *****************************************************************************
|
|
@@ -1629,7 +1630,7 @@ function forEachAsync(array, options, callbackfunction) {
|
|
|
1629
1630
|
});
|
|
1630
1631
|
}
|
|
1631
1632
|
|
|
1632
|
-
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.65.0-
|
|
1633
|
+
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.65.0-2",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",dependentParameterNames:["knowledgeContent"],resultingParameterName:"knowledgePieces"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-from-markdown.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.ptbk.md",promptbookVersion:"0.65.0-2",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",dependentParameterNames:["knowledgePieceContent"],resultingParameterName:"keywords"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-keywords.ptbk.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.ptbk.md",promptbookVersion:"0.65.0-2",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Title should be concise and clear\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"],resultingParameterName:"title"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",promptbookVersion:"0.65.0-2",parameters:[{name:"availableModelNames",description:"List of available model names separated by comma (,)",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"make-model-requirements",title:"Make modelRequirements",modelRequirements:{modelVariant:"CHAT",modelName:"gpt-4-turbo"},content:"You are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Sample\n\n```json\n{\n\"modelName\": \"gpt-4o\",\n\"systemMessage\": \"You are experienced AI engineer and helpfull assistant.\",\n\"temperature\": 0.7\n}\n```\n\n## Instructions\n\n### Option `modelName`\n\nPick from the following models:\n\n- {availableModelNames}\n\n### Option `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Option `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",expectFormat:"JSON",dependentParameterNames:["availableModelNames","personaDescription"],resultingParameterName:"modelRequirements"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
|
|
1633
1634
|
|
|
1634
1635
|
var defaultDiacriticsRemovalMap = [
|
|
1635
1636
|
{
|
|
@@ -6477,6 +6478,147 @@ var CallbackInterfaceTools = /** @class */ (function () {
|
|
|
6477
6478
|
return CallbackInterfaceTools;
|
|
6478
6479
|
}());
|
|
6479
6480
|
|
|
6481
|
+
/**
|
|
6482
|
+
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
6483
|
+
*
|
|
6484
|
+
* You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
|
|
6485
|
+
* This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
|
|
6486
|
+
*
|
|
6487
|
+
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
6488
|
+
* @public exported from `@promptbook/remote-client`
|
|
6489
|
+
*/
|
|
6490
|
+
var RemoteLlmExecutionTools = /** @class */ (function () {
|
|
6491
|
+
function RemoteLlmExecutionTools(options) {
|
|
6492
|
+
this.options = options;
|
|
6493
|
+
}
|
|
6494
|
+
Object.defineProperty(RemoteLlmExecutionTools.prototype, "title", {
|
|
6495
|
+
get: function () {
|
|
6496
|
+
// TODO: [🧠] Maybe fetch title+description from the remote server (as well as if model methods are defined)
|
|
6497
|
+
return 'Remote server';
|
|
6498
|
+
},
|
|
6499
|
+
enumerable: false,
|
|
6500
|
+
configurable: true
|
|
6501
|
+
});
|
|
6502
|
+
Object.defineProperty(RemoteLlmExecutionTools.prototype, "description", {
|
|
6503
|
+
get: function () {
|
|
6504
|
+
return 'Use all models by your remote server';
|
|
6505
|
+
},
|
|
6506
|
+
enumerable: false,
|
|
6507
|
+
configurable: true
|
|
6508
|
+
});
|
|
6509
|
+
/**
|
|
6510
|
+
* Creates a connection to the remote proxy server.
|
|
6511
|
+
*/
|
|
6512
|
+
RemoteLlmExecutionTools.prototype.makeConnection = function () {
|
|
6513
|
+
var _this = this;
|
|
6514
|
+
return new Promise(function (resolve, reject) {
|
|
6515
|
+
var socket = io(_this.options.remoteUrl, {
|
|
6516
|
+
path: _this.options.path,
|
|
6517
|
+
// path: `${this.remoteUrl.pathname}/socket.io`,
|
|
6518
|
+
transports: [/*'websocket', <- TODO: [🌬] Make websocket transport work */ 'polling'],
|
|
6519
|
+
});
|
|
6520
|
+
// console.log('Connecting to', this.options.remoteUrl.href, { socket });
|
|
6521
|
+
socket.on('connect', function () {
|
|
6522
|
+
resolve(socket);
|
|
6523
|
+
});
|
|
6524
|
+
setTimeout(function () {
|
|
6525
|
+
reject(new Error("Timeout while connecting to ".concat(_this.options.remoteUrl)));
|
|
6526
|
+
}, 60000 /* <- TODO: Timeout to config */);
|
|
6527
|
+
});
|
|
6528
|
+
};
|
|
6529
|
+
/**
|
|
6530
|
+
* Calls remote proxy server to use a chat model
|
|
6531
|
+
*/
|
|
6532
|
+
RemoteLlmExecutionTools.prototype.callChatModel = function (prompt) {
|
|
6533
|
+
if (this.options.isVerbose) {
|
|
6534
|
+
console.info("\uD83D\uDD8B Remote callChatModel call");
|
|
6535
|
+
}
|
|
6536
|
+
return /* not await */ this.callCommonModel(prompt);
|
|
6537
|
+
};
|
|
6538
|
+
/**
|
|
6539
|
+
* Calls remote proxy server to use a completion model
|
|
6540
|
+
*/
|
|
6541
|
+
RemoteLlmExecutionTools.prototype.callCompletionModel = function (prompt) {
|
|
6542
|
+
if (this.options.isVerbose) {
|
|
6543
|
+
console.info("\uD83D\uDCAC Remote callCompletionModel call");
|
|
6544
|
+
}
|
|
6545
|
+
return /* not await */ this.callCommonModel(prompt);
|
|
6546
|
+
};
|
|
6547
|
+
/**
|
|
6548
|
+
* Calls remote proxy server to use a embedding model
|
|
6549
|
+
*/
|
|
6550
|
+
RemoteLlmExecutionTools.prototype.callEmbeddingModel = function (prompt) {
|
|
6551
|
+
if (this.options.isVerbose) {
|
|
6552
|
+
console.info("\uD83D\uDCAC Remote callEmbeddingModel call");
|
|
6553
|
+
}
|
|
6554
|
+
return /* not await */ this.callCommonModel(prompt);
|
|
6555
|
+
};
|
|
6556
|
+
// <- Note: [🤖] callXxxModel
|
|
6557
|
+
/**
|
|
6558
|
+
* Calls remote proxy server to use both completion or chat model
|
|
6559
|
+
*/
|
|
6560
|
+
RemoteLlmExecutionTools.prototype.callCommonModel = function (prompt) {
|
|
6561
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6562
|
+
var socket, promptResult;
|
|
6563
|
+
return __generator(this, function (_a) {
|
|
6564
|
+
switch (_a.label) {
|
|
6565
|
+
case 0: return [4 /*yield*/, this.makeConnection()];
|
|
6566
|
+
case 1:
|
|
6567
|
+
socket = _a.sent();
|
|
6568
|
+
if (this.options.isAnonymous) {
|
|
6569
|
+
socket.emit('request', {
|
|
6570
|
+
llmToolsConfiguration: this.options.llmToolsConfiguration,
|
|
6571
|
+
prompt: prompt,
|
|
6572
|
+
// <- TODO: [🛫] `prompt` is NOT fully serializable as JSON, it contains functions which are not serializable
|
|
6573
|
+
});
|
|
6574
|
+
}
|
|
6575
|
+
else {
|
|
6576
|
+
socket.emit('request', {
|
|
6577
|
+
clientId: this.options.clientId,
|
|
6578
|
+
prompt: prompt,
|
|
6579
|
+
// <- TODO: [🛫] `prompt` is NOT fully serializable as JSON, it contains functions which are not serializable
|
|
6580
|
+
});
|
|
6581
|
+
}
|
|
6582
|
+
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
6583
|
+
socket.on('response', function (response) {
|
|
6584
|
+
resolve(response.promptResult);
|
|
6585
|
+
socket.disconnect();
|
|
6586
|
+
});
|
|
6587
|
+
socket.on('error', function (error) {
|
|
6588
|
+
reject(new PipelineExecutionError(error.errorMessage));
|
|
6589
|
+
socket.disconnect();
|
|
6590
|
+
});
|
|
6591
|
+
})];
|
|
6592
|
+
case 2:
|
|
6593
|
+
promptResult = _a.sent();
|
|
6594
|
+
socket.disconnect();
|
|
6595
|
+
return [2 /*return*/, promptResult];
|
|
6596
|
+
}
|
|
6597
|
+
});
|
|
6598
|
+
});
|
|
6599
|
+
};
|
|
6600
|
+
/**
|
|
6601
|
+
* List all available models that can be used
|
|
6602
|
+
*/
|
|
6603
|
+
RemoteLlmExecutionTools.prototype.listModels = function () {
|
|
6604
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6605
|
+
return __generator(this, function (_a) {
|
|
6606
|
+
return [2 /*return*/, [
|
|
6607
|
+
/* !!! */
|
|
6608
|
+
]];
|
|
6609
|
+
});
|
|
6610
|
+
});
|
|
6611
|
+
};
|
|
6612
|
+
return RemoteLlmExecutionTools;
|
|
6613
|
+
}());
|
|
6614
|
+
/**
|
|
6615
|
+
* TODO: [🍜] !!!!!! Default remote remoteUrl and path for anonymous server
|
|
6616
|
+
* TODO: [🍓] Allow to list compatible models with each variant
|
|
6617
|
+
* TODO: [🗯] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable
|
|
6618
|
+
* TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
6619
|
+
* TODO: [🧠] Maybe remove `@promptbook/remote-client` and just use `@promptbook/core`
|
|
6620
|
+
*/
|
|
6621
|
+
|
|
6480
6622
|
/**
|
|
6481
6623
|
* Helper of usage compute
|
|
6482
6624
|
*
|
|
@@ -6606,6 +6748,7 @@ var ANTHROPIC_CLAUDE_MODELS = [
|
|
|
6606
6748
|
* Execution Tools for calling Anthropic Claude API.
|
|
6607
6749
|
*
|
|
6608
6750
|
* @public exported from `@promptbook/anthropic-claude`
|
|
6751
|
+
* @deprecated use `createAnthropicClaudeExecutionTools` instead
|
|
6609
6752
|
*/
|
|
6610
6753
|
var AnthropicClaudeExecutionTools = /** @class */ (function () {
|
|
6611
6754
|
/**
|
|
@@ -6614,11 +6757,12 @@ var AnthropicClaudeExecutionTools = /** @class */ (function () {
|
|
|
6614
6757
|
* @param options which are relevant are directly passed to the Anthropic Claude client
|
|
6615
6758
|
*/
|
|
6616
6759
|
function AnthropicClaudeExecutionTools(options) {
|
|
6617
|
-
if (options === void 0) { options = {}; }
|
|
6760
|
+
if (options === void 0) { options = { isProxied: false }; }
|
|
6618
6761
|
this.options = options;
|
|
6619
6762
|
// Note: Passing only Anthropic Claude relevant options to Anthropic constructor
|
|
6620
6763
|
var anthropicOptions = __assign({}, options);
|
|
6621
6764
|
delete anthropicOptions.isVerbose;
|
|
6765
|
+
delete anthropicOptions.isProxied;
|
|
6622
6766
|
this.client = new Anthropic(anthropicOptions);
|
|
6623
6767
|
}
|
|
6624
6768
|
Object.defineProperty(AnthropicClaudeExecutionTools.prototype, "title", {
|
|
@@ -6821,8 +6965,32 @@ var AnthropicClaudeExecutionTools = /** @class */ (function () {
|
|
|
6821
6965
|
* TODO: Maybe Create some common util for callChatModel and callCompletionModel
|
|
6822
6966
|
* TODO: Maybe make custom OpenaiError
|
|
6823
6967
|
* TODO: [🧠][🈁] Maybe use `isDeterministic` from options
|
|
6824
|
-
* TODO: [🍜] Auto use anonymous server in browser
|
|
6968
|
+
* TODO: [🍜] !!!!!! Auto use anonymous server in browser
|
|
6825
6969
|
* TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
6970
|
+
* TODO: [📅] Maybe instead of `RemoteLlmExecutionToolsOptions` use `proxyWithAnonymousRemoteServer` (if implemented)
|
|
6971
|
+
*/
|
|
6972
|
+
|
|
6973
|
+
/**
|
|
6974
|
+
* Execution Tools for calling Anthropic Claude API.
|
|
6975
|
+
*
|
|
6976
|
+
* @public exported from `@promptbook/anthropic-claude`
|
|
6977
|
+
*/
|
|
6978
|
+
function createAnthropicClaudeExecutionTools(options) {
|
|
6979
|
+
if (options.isProxied) {
|
|
6980
|
+
return new RemoteLlmExecutionTools(__assign(__assign({}, options), { isAnonymous: true, llmToolsConfiguration: [
|
|
6981
|
+
{
|
|
6982
|
+
title: 'Anthropic Claude (proxied)',
|
|
6983
|
+
packageName: '@promptbook/anthropic-claude',
|
|
6984
|
+
className: 'AnthropicClaudeExecutionTools',
|
|
6985
|
+
options: __assign(__assign({}, options), { isProxied: false }),
|
|
6986
|
+
},
|
|
6987
|
+
] }));
|
|
6988
|
+
}
|
|
6989
|
+
return new AnthropicClaudeExecutionTools(options);
|
|
6990
|
+
}
|
|
6991
|
+
/**
|
|
6992
|
+
* TODO: !!!!!! Make this with all LLM providers
|
|
6993
|
+
* TODO: !!!!!! Maybe change all `new AnthropicClaudeExecutionTools` -> `createAnthropicClaudeExecutionTools` in manual
|
|
6826
6994
|
*/
|
|
6827
6995
|
|
|
6828
6996
|
/**
|
|
@@ -7764,15 +7932,50 @@ var OpenAiExecutionTools = /** @class */ (function () {
|
|
|
7764
7932
|
* TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
7765
7933
|
*/
|
|
7766
7934
|
|
|
7935
|
+
/**
|
|
7936
|
+
* @public exported from `@promptbook/core`
|
|
7937
|
+
*/
|
|
7938
|
+
var LLM_CONFIGURATION_BOILERPLATES = [
|
|
7939
|
+
{
|
|
7940
|
+
title: 'Open AI',
|
|
7941
|
+
packageName: '@promptbook/openai',
|
|
7942
|
+
className: 'OpenAiExecutionTools',
|
|
7943
|
+
options: {
|
|
7944
|
+
apiKey: 'sk-',
|
|
7945
|
+
},
|
|
7946
|
+
},
|
|
7947
|
+
{
|
|
7948
|
+
title: 'Anthropic Claude',
|
|
7949
|
+
packageName: '@promptbook/anthropic-claude',
|
|
7950
|
+
className: 'AnthropicClaudeExecutionTools',
|
|
7951
|
+
options: {
|
|
7952
|
+
apiKey: 'sk-ant-api03-',
|
|
7953
|
+
isProxied: true,
|
|
7954
|
+
remoteUrl: 'https://!!!!!!',
|
|
7955
|
+
path: '/socket.io!!!!!!',
|
|
7956
|
+
},
|
|
7957
|
+
},
|
|
7958
|
+
{
|
|
7959
|
+
title: 'Azure Open AI',
|
|
7960
|
+
packageName: '@promptbook/azure-openai',
|
|
7961
|
+
className: 'AzureOpenAiExecutionTools',
|
|
7962
|
+
options: {
|
|
7963
|
+
// TODO: !!!> resourceName
|
|
7964
|
+
// TODO: !!!> deploymentName
|
|
7965
|
+
apiKey: 'sk-',
|
|
7966
|
+
},
|
|
7967
|
+
},
|
|
7968
|
+
// <- Note: [🦑] Add here new LLM provider
|
|
7969
|
+
];
|
|
7767
7970
|
/**
|
|
7768
7971
|
* @private internal type for `createLlmToolsFromConfiguration`
|
|
7769
7972
|
*/
|
|
7770
7973
|
var EXECUTION_TOOLS_CLASSES = {
|
|
7771
|
-
|
|
7974
|
+
createOpenAiExecutionTools: function (options) {
|
|
7772
7975
|
return new OpenAiExecutionTools(__assign(__assign({}, options), { dangerouslyAllowBrowser: true /* <- TODO: [🧠] !!! Some mechanism for auto-detection of browser, maybe hide in `OpenAiExecutionTools` */ }));
|
|
7773
7976
|
},
|
|
7774
|
-
|
|
7775
|
-
|
|
7977
|
+
createAnthropicClaudeExecutionTools: createAnthropicClaudeExecutionTools,
|
|
7978
|
+
createAzureOpenAiExecutionTools: function (options) { return new AzureOpenAiExecutionTools(options); },
|
|
7776
7979
|
// <- Note: [🦑] Add here new LLM provider
|
|
7777
7980
|
};
|
|
7778
7981
|
/**
|
|
@@ -7793,7 +7996,7 @@ function createLlmToolsFromConfiguration(configuration, options) {
|
|
|
7793
7996
|
var _a = options.isVerbose, isVerbose = _a === void 0 ? false : _a;
|
|
7794
7997
|
dotenv.config();
|
|
7795
7998
|
var llmTools = configuration.map(function (llmConfiguration) {
|
|
7796
|
-
return EXECUTION_TOOLS_CLASSES["
|
|
7999
|
+
return EXECUTION_TOOLS_CLASSES["create".concat(llmConfiguration.className)](__assign({ isVerbose: isVerbose }, llmConfiguration.options));
|
|
7797
8000
|
});
|
|
7798
8001
|
return joinLlmExecutionTools.apply(void 0, __spreadArray([], __read(llmTools), false));
|
|
7799
8002
|
}
|
|
@@ -8379,5 +8582,5 @@ function executionReportJsonToString(executionReportJson, options) {
|
|
|
8379
8582
|
* TODO: [🧠] Should be in generated file GENERATOR_WARNING
|
|
8380
8583
|
*/
|
|
8381
8584
|
|
|
8382
|
-
export { BlockTypes, CLAIM, CallbackInterfaceTools, CollectionError, EXECUTIONS_CACHE_DIRNAME, EXPECTATION_UNITS, EnvironmentMismatchError, ExecutionReportStringOptionsDefaults, LimitReachedError, MAX_EXECUTION_ATTEMPTS, MAX_FILENAME_LENGTH, MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH, MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL, MAX_PARALLEL_COUNT, MODEL_VARIANTS, MemoryStorage, NotFoundError, NotYetImplementedError, PIPELINE_COLLECTION_BASE_FILENAME, PROMPTBOOK_VERSION, ParsingError, PipelineExecutionError, PipelineLogicError, PrefixStorage, RESERVED_PARAMETER_NAMES, ReferenceError$1 as ReferenceError, UnexpectedError, VersionMismatchError, ZERO_USAGE, addUsage, assertsExecutionSuccessful, cacheLlmTools, collectionToJson, countTotalUsage, createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createLlmToolsFromConfiguration, createPipelineExecutor, createSubcollection, embeddingVectorToString, executionReportJsonToString, isPassingExpectations, isPipelinePrepared, joinLlmExecutionTools, limitTotalUsage, pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, prepareKnowledgeFromMarkdown, prepareKnowledgePieces, preparePersona, preparePipeline, prepareTemplates, prettifyPipelineString, stringifyPipelineJson, unpreparePipeline, usageToHuman, usageToWorktime, validatePipeline };
|
|
8585
|
+
export { BlockTypes, CLAIM, CallbackInterfaceTools, CollectionError, EXECUTIONS_CACHE_DIRNAME, EXPECTATION_UNITS, EnvironmentMismatchError, ExecutionReportStringOptionsDefaults, LLM_CONFIGURATION_BOILERPLATES, LimitReachedError, MAX_EXECUTION_ATTEMPTS, MAX_FILENAME_LENGTH, MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH, MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL, MAX_PARALLEL_COUNT, MODEL_VARIANTS, MemoryStorage, NotFoundError, NotYetImplementedError, PIPELINE_COLLECTION_BASE_FILENAME, PROMPTBOOK_VERSION, ParsingError, PipelineExecutionError, PipelineLogicError, PrefixStorage, RESERVED_PARAMETER_NAMES, ReferenceError$1 as ReferenceError, UnexpectedError, VersionMismatchError, ZERO_USAGE, addUsage, assertsExecutionSuccessful, cacheLlmTools, collectionToJson, countTotalUsage, createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createLlmToolsFromConfiguration, createPipelineExecutor, createSubcollection, embeddingVectorToString, executionReportJsonToString, isPassingExpectations, isPipelinePrepared, joinLlmExecutionTools, limitTotalUsage, pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, prepareKnowledgeFromMarkdown, prepareKnowledgePieces, preparePersona, preparePipeline, prepareTemplates, prettifyPipelineString, stringifyPipelineJson, unpreparePipeline, usageToHuman, usageToWorktime, validatePipeline };
|
|
8383
8586
|
//# sourceMappingURL=index.es.js.map
|