@promptbook/core 0.65.0-2 → 0.65.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/esm/index.es.js +212 -11
- 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 +215 -32
- 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,7 +3,7 @@ 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';
|
|
@@ -14,7 +14,7 @@ import moment from 'moment';
|
|
|
14
14
|
/**
|
|
15
15
|
* The version of the Promptbook library
|
|
16
16
|
*/
|
|
17
|
-
var PROMPTBOOK_VERSION = '0.65.0-
|
|
17
|
+
var PROMPTBOOK_VERSION = '0.65.0-3';
|
|
18
18
|
// TODO: !!!! List here all the versions and annotate + put into script
|
|
19
19
|
|
|
20
20
|
/*! *****************************************************************************
|
|
@@ -1629,7 +1629,7 @@ function forEachAsync(array, options, callbackfunction) {
|
|
|
1629
1629
|
});
|
|
1630
1630
|
}
|
|
1631
1631
|
|
|
1632
|
-
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.65.0-
|
|
1632
|
+
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.65.0-3",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-3",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-3",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-3",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
1633
|
|
|
1634
1634
|
var defaultDiacriticsRemovalMap = [
|
|
1635
1635
|
{
|
|
@@ -6477,6 +6477,147 @@ var CallbackInterfaceTools = /** @class */ (function () {
|
|
|
6477
6477
|
return CallbackInterfaceTools;
|
|
6478
6478
|
}());
|
|
6479
6479
|
|
|
6480
|
+
/**
|
|
6481
|
+
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
6482
|
+
*
|
|
6483
|
+
* You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
|
|
6484
|
+
* This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
|
|
6485
|
+
*
|
|
6486
|
+
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
6487
|
+
* @public exported from `@promptbook/remote-client`
|
|
6488
|
+
*/
|
|
6489
|
+
var RemoteLlmExecutionTools = /** @class */ (function () {
|
|
6490
|
+
function RemoteLlmExecutionTools(options) {
|
|
6491
|
+
this.options = options;
|
|
6492
|
+
}
|
|
6493
|
+
Object.defineProperty(RemoteLlmExecutionTools.prototype, "title", {
|
|
6494
|
+
get: function () {
|
|
6495
|
+
// TODO: [🧠] Maybe fetch title+description from the remote server (as well as if model methods are defined)
|
|
6496
|
+
return 'Remote server';
|
|
6497
|
+
},
|
|
6498
|
+
enumerable: false,
|
|
6499
|
+
configurable: true
|
|
6500
|
+
});
|
|
6501
|
+
Object.defineProperty(RemoteLlmExecutionTools.prototype, "description", {
|
|
6502
|
+
get: function () {
|
|
6503
|
+
return 'Use all models by your remote server';
|
|
6504
|
+
},
|
|
6505
|
+
enumerable: false,
|
|
6506
|
+
configurable: true
|
|
6507
|
+
});
|
|
6508
|
+
/**
|
|
6509
|
+
* Creates a connection to the remote proxy server.
|
|
6510
|
+
*/
|
|
6511
|
+
RemoteLlmExecutionTools.prototype.makeConnection = function () {
|
|
6512
|
+
var _this = this;
|
|
6513
|
+
return new Promise(function (resolve, reject) {
|
|
6514
|
+
var socket = io(_this.options.remoteUrl, {
|
|
6515
|
+
path: _this.options.path,
|
|
6516
|
+
// path: `${this.remoteUrl.pathname}/socket.io`,
|
|
6517
|
+
transports: [/*'websocket', <- TODO: [🌬] Make websocket transport work */ 'polling'],
|
|
6518
|
+
});
|
|
6519
|
+
// console.log('Connecting to', this.options.remoteUrl.href, { socket });
|
|
6520
|
+
socket.on('connect', function () {
|
|
6521
|
+
resolve(socket);
|
|
6522
|
+
});
|
|
6523
|
+
setTimeout(function () {
|
|
6524
|
+
reject(new Error("Timeout while connecting to ".concat(_this.options.remoteUrl)));
|
|
6525
|
+
}, 60000 /* <- TODO: Timeout to config */);
|
|
6526
|
+
});
|
|
6527
|
+
};
|
|
6528
|
+
/**
|
|
6529
|
+
* Calls remote proxy server to use a chat model
|
|
6530
|
+
*/
|
|
6531
|
+
RemoteLlmExecutionTools.prototype.callChatModel = function (prompt) {
|
|
6532
|
+
if (this.options.isVerbose) {
|
|
6533
|
+
console.info("\uD83D\uDD8B Remote callChatModel call");
|
|
6534
|
+
}
|
|
6535
|
+
return /* not await */ this.callCommonModel(prompt);
|
|
6536
|
+
};
|
|
6537
|
+
/**
|
|
6538
|
+
* Calls remote proxy server to use a completion model
|
|
6539
|
+
*/
|
|
6540
|
+
RemoteLlmExecutionTools.prototype.callCompletionModel = function (prompt) {
|
|
6541
|
+
if (this.options.isVerbose) {
|
|
6542
|
+
console.info("\uD83D\uDCAC Remote callCompletionModel call");
|
|
6543
|
+
}
|
|
6544
|
+
return /* not await */ this.callCommonModel(prompt);
|
|
6545
|
+
};
|
|
6546
|
+
/**
|
|
6547
|
+
* Calls remote proxy server to use a embedding model
|
|
6548
|
+
*/
|
|
6549
|
+
RemoteLlmExecutionTools.prototype.callEmbeddingModel = function (prompt) {
|
|
6550
|
+
if (this.options.isVerbose) {
|
|
6551
|
+
console.info("\uD83D\uDCAC Remote callEmbeddingModel call");
|
|
6552
|
+
}
|
|
6553
|
+
return /* not await */ this.callCommonModel(prompt);
|
|
6554
|
+
};
|
|
6555
|
+
// <- Note: [🤖] callXxxModel
|
|
6556
|
+
/**
|
|
6557
|
+
* Calls remote proxy server to use both completion or chat model
|
|
6558
|
+
*/
|
|
6559
|
+
RemoteLlmExecutionTools.prototype.callCommonModel = function (prompt) {
|
|
6560
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6561
|
+
var socket, promptResult;
|
|
6562
|
+
return __generator(this, function (_a) {
|
|
6563
|
+
switch (_a.label) {
|
|
6564
|
+
case 0: return [4 /*yield*/, this.makeConnection()];
|
|
6565
|
+
case 1:
|
|
6566
|
+
socket = _a.sent();
|
|
6567
|
+
if (this.options.isAnonymous) {
|
|
6568
|
+
socket.emit('request', {
|
|
6569
|
+
llmToolsConfiguration: this.options.llmToolsConfiguration,
|
|
6570
|
+
prompt: prompt,
|
|
6571
|
+
// <- TODO: [🛫] `prompt` is NOT fully serializable as JSON, it contains functions which are not serializable
|
|
6572
|
+
});
|
|
6573
|
+
}
|
|
6574
|
+
else {
|
|
6575
|
+
socket.emit('request', {
|
|
6576
|
+
clientId: this.options.clientId,
|
|
6577
|
+
prompt: prompt,
|
|
6578
|
+
// <- TODO: [🛫] `prompt` is NOT fully serializable as JSON, it contains functions which are not serializable
|
|
6579
|
+
});
|
|
6580
|
+
}
|
|
6581
|
+
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
6582
|
+
socket.on('response', function (response) {
|
|
6583
|
+
resolve(response.promptResult);
|
|
6584
|
+
socket.disconnect();
|
|
6585
|
+
});
|
|
6586
|
+
socket.on('error', function (error) {
|
|
6587
|
+
reject(new PipelineExecutionError(error.errorMessage));
|
|
6588
|
+
socket.disconnect();
|
|
6589
|
+
});
|
|
6590
|
+
})];
|
|
6591
|
+
case 2:
|
|
6592
|
+
promptResult = _a.sent();
|
|
6593
|
+
socket.disconnect();
|
|
6594
|
+
return [2 /*return*/, promptResult];
|
|
6595
|
+
}
|
|
6596
|
+
});
|
|
6597
|
+
});
|
|
6598
|
+
};
|
|
6599
|
+
/**
|
|
6600
|
+
* List all available models that can be used
|
|
6601
|
+
*/
|
|
6602
|
+
RemoteLlmExecutionTools.prototype.listModels = function () {
|
|
6603
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6604
|
+
return __generator(this, function (_a) {
|
|
6605
|
+
return [2 /*return*/, [
|
|
6606
|
+
/* !!! */
|
|
6607
|
+
]];
|
|
6608
|
+
});
|
|
6609
|
+
});
|
|
6610
|
+
};
|
|
6611
|
+
return RemoteLlmExecutionTools;
|
|
6612
|
+
}());
|
|
6613
|
+
/**
|
|
6614
|
+
* TODO: [🍜] !!!!!! Default remote remoteUrl and path for anonymous server
|
|
6615
|
+
* TODO: [🍓] Allow to list compatible models with each variant
|
|
6616
|
+
* TODO: [🗯] RemoteLlmExecutionTools should extend Destroyable and implement IDestroyable
|
|
6617
|
+
* TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
6618
|
+
* TODO: [🧠] Maybe remove `@promptbook/remote-client` and just use `@promptbook/core`
|
|
6619
|
+
*/
|
|
6620
|
+
|
|
6480
6621
|
/**
|
|
6481
6622
|
* Helper of usage compute
|
|
6482
6623
|
*
|
|
@@ -6606,6 +6747,7 @@ var ANTHROPIC_CLAUDE_MODELS = [
|
|
|
6606
6747
|
* Execution Tools for calling Anthropic Claude API.
|
|
6607
6748
|
*
|
|
6608
6749
|
* @public exported from `@promptbook/anthropic-claude`
|
|
6750
|
+
* @deprecated use `createAnthropicClaudeExecutionTools` instead
|
|
6609
6751
|
*/
|
|
6610
6752
|
var AnthropicClaudeExecutionTools = /** @class */ (function () {
|
|
6611
6753
|
/**
|
|
@@ -6614,11 +6756,12 @@ var AnthropicClaudeExecutionTools = /** @class */ (function () {
|
|
|
6614
6756
|
* @param options which are relevant are directly passed to the Anthropic Claude client
|
|
6615
6757
|
*/
|
|
6616
6758
|
function AnthropicClaudeExecutionTools(options) {
|
|
6617
|
-
if (options === void 0) { options = {}; }
|
|
6759
|
+
if (options === void 0) { options = { isProxied: false }; }
|
|
6618
6760
|
this.options = options;
|
|
6619
6761
|
// Note: Passing only Anthropic Claude relevant options to Anthropic constructor
|
|
6620
6762
|
var anthropicOptions = __assign({}, options);
|
|
6621
6763
|
delete anthropicOptions.isVerbose;
|
|
6764
|
+
delete anthropicOptions.isProxied;
|
|
6622
6765
|
this.client = new Anthropic(anthropicOptions);
|
|
6623
6766
|
}
|
|
6624
6767
|
Object.defineProperty(AnthropicClaudeExecutionTools.prototype, "title", {
|
|
@@ -6821,8 +6964,32 @@ var AnthropicClaudeExecutionTools = /** @class */ (function () {
|
|
|
6821
6964
|
* TODO: Maybe Create some common util for callChatModel and callCompletionModel
|
|
6822
6965
|
* TODO: Maybe make custom OpenaiError
|
|
6823
6966
|
* TODO: [🧠][🈁] Maybe use `isDeterministic` from options
|
|
6824
|
-
* TODO: [🍜] Auto use anonymous server in browser
|
|
6967
|
+
* TODO: [🍜] !!!!!! Auto use anonymous server in browser
|
|
6825
6968
|
* TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
6969
|
+
* TODO: [📅] Maybe instead of `RemoteLlmExecutionToolsOptions` use `proxyWithAnonymousRemoteServer` (if implemented)
|
|
6970
|
+
*/
|
|
6971
|
+
|
|
6972
|
+
/**
|
|
6973
|
+
* Execution Tools for calling Anthropic Claude API.
|
|
6974
|
+
*
|
|
6975
|
+
* @public exported from `@promptbook/anthropic-claude`
|
|
6976
|
+
*/
|
|
6977
|
+
function createAnthropicClaudeExecutionTools(options) {
|
|
6978
|
+
if (options.isProxied) {
|
|
6979
|
+
return new RemoteLlmExecutionTools(__assign(__assign({}, options), { isAnonymous: true, llmToolsConfiguration: [
|
|
6980
|
+
{
|
|
6981
|
+
title: 'Anthropic Claude (proxied)',
|
|
6982
|
+
packageName: '@promptbook/anthropic-claude',
|
|
6983
|
+
className: 'AnthropicClaudeExecutionTools',
|
|
6984
|
+
options: __assign(__assign({}, options), { isProxied: false }),
|
|
6985
|
+
},
|
|
6986
|
+
] }));
|
|
6987
|
+
}
|
|
6988
|
+
return new AnthropicClaudeExecutionTools(options);
|
|
6989
|
+
}
|
|
6990
|
+
/**
|
|
6991
|
+
* TODO: !!!!!! Make this with all LLM providers
|
|
6992
|
+
* TODO: !!!!!! Maybe change all `new AnthropicClaudeExecutionTools` -> `createAnthropicClaudeExecutionTools` in manual
|
|
6826
6993
|
*/
|
|
6827
6994
|
|
|
6828
6995
|
/**
|
|
@@ -7764,15 +7931,50 @@ var OpenAiExecutionTools = /** @class */ (function () {
|
|
|
7764
7931
|
* TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
7765
7932
|
*/
|
|
7766
7933
|
|
|
7934
|
+
/**
|
|
7935
|
+
* @public exported from `@promptbook/core`
|
|
7936
|
+
*/
|
|
7937
|
+
var LLM_CONFIGURATION_BOILERPLATES = [
|
|
7938
|
+
{
|
|
7939
|
+
title: 'Open AI',
|
|
7940
|
+
packageName: '@promptbook/openai',
|
|
7941
|
+
className: 'OpenAiExecutionTools',
|
|
7942
|
+
options: {
|
|
7943
|
+
apiKey: 'sk-',
|
|
7944
|
+
},
|
|
7945
|
+
},
|
|
7946
|
+
{
|
|
7947
|
+
title: 'Anthropic Claude',
|
|
7948
|
+
packageName: '@promptbook/anthropic-claude',
|
|
7949
|
+
className: 'AnthropicClaudeExecutionTools',
|
|
7950
|
+
options: {
|
|
7951
|
+
apiKey: 'sk-ant-api03-',
|
|
7952
|
+
isProxied: true,
|
|
7953
|
+
remoteUrl: 'https://!!!!!!',
|
|
7954
|
+
path: '/socket.io!!!!!!',
|
|
7955
|
+
},
|
|
7956
|
+
},
|
|
7957
|
+
{
|
|
7958
|
+
title: 'Azure Open AI',
|
|
7959
|
+
packageName: '@promptbook/azure-openai',
|
|
7960
|
+
className: 'AzureOpenAiExecutionTools',
|
|
7961
|
+
options: {
|
|
7962
|
+
// TODO: !!!> resourceName
|
|
7963
|
+
// TODO: !!!> deploymentName
|
|
7964
|
+
apiKey: 'sk-',
|
|
7965
|
+
},
|
|
7966
|
+
},
|
|
7967
|
+
// <- Note: [🦑] Add here new LLM provider
|
|
7968
|
+
];
|
|
7767
7969
|
/**
|
|
7768
7970
|
* @private internal type for `createLlmToolsFromConfiguration`
|
|
7769
7971
|
*/
|
|
7770
7972
|
var EXECUTION_TOOLS_CLASSES = {
|
|
7771
|
-
|
|
7973
|
+
createOpenAiExecutionTools: function (options) {
|
|
7772
7974
|
return new OpenAiExecutionTools(__assign(__assign({}, options), { dangerouslyAllowBrowser: true /* <- TODO: [🧠] !!! Some mechanism for auto-detection of browser, maybe hide in `OpenAiExecutionTools` */ }));
|
|
7773
7975
|
},
|
|
7774
|
-
|
|
7775
|
-
|
|
7976
|
+
createAnthropicClaudeExecutionTools: createAnthropicClaudeExecutionTools,
|
|
7977
|
+
createAzureOpenAiExecutionTools: function (options) { return new AzureOpenAiExecutionTools(options); },
|
|
7776
7978
|
// <- Note: [🦑] Add here new LLM provider
|
|
7777
7979
|
};
|
|
7778
7980
|
/**
|
|
@@ -7791,9 +7993,8 @@ var EXECUTION_TOOLS_CLASSES = {
|
|
|
7791
7993
|
function createLlmToolsFromConfiguration(configuration, options) {
|
|
7792
7994
|
if (options === void 0) { options = {}; }
|
|
7793
7995
|
var _a = options.isVerbose, isVerbose = _a === void 0 ? false : _a;
|
|
7794
|
-
dotenv.config();
|
|
7795
7996
|
var llmTools = configuration.map(function (llmConfiguration) {
|
|
7796
|
-
return EXECUTION_TOOLS_CLASSES["
|
|
7997
|
+
return EXECUTION_TOOLS_CLASSES["create".concat(llmConfiguration.className)](__assign({ isVerbose: isVerbose }, llmConfiguration.options));
|
|
7797
7998
|
});
|
|
7798
7999
|
return joinLlmExecutionTools.apply(void 0, __spreadArray([], __read(llmTools), false));
|
|
7799
8000
|
}
|
|
@@ -8379,5 +8580,5 @@ function executionReportJsonToString(executionReportJson, options) {
|
|
|
8379
8580
|
* TODO: [🧠] Should be in generated file GENERATOR_WARNING
|
|
8380
8581
|
*/
|
|
8381
8582
|
|
|
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 };
|
|
8583
|
+
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
8584
|
//# sourceMappingURL=index.es.js.map
|