@dvina/agents 0.3.6 → 0.4.0
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/dist/chunk-LEEZCLZM.mjs +105 -0
- package/dist/chunk-LEEZCLZM.mjs.map +1 -0
- package/dist/eval/index.d.mts +109 -0
- package/dist/eval/index.d.ts +109 -0
- package/dist/eval/index.js +519 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/eval/index.mjs +412 -0
- package/dist/eval/index.mjs.map +1 -0
- package/dist/index.d.mts +7 -30
- package/dist/index.d.ts +7 -30
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -98
- package/dist/index.mjs.map +1 -1
- package/dist/model-resolver-BRAaBV9n.d.mts +15 -0
- package/dist/model-resolver-BRAaBV9n.d.ts +15 -0
- package/package.json +33 -4
package/dist/index.mjs
CHANGED
|
@@ -1,34 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
-
}) : x)(function(x) {
|
|
10
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
-
});
|
|
13
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
-
};
|
|
16
|
-
var __copyProps = (to, from, except, desc) => {
|
|
17
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
-
for (let key of __getOwnPropNames(from))
|
|
19
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
-
mod
|
|
31
|
-
));
|
|
1
|
+
import {
|
|
2
|
+
LangchainModelResolver,
|
|
3
|
+
__commonJS,
|
|
4
|
+
__require,
|
|
5
|
+
__toESM
|
|
6
|
+
} from "./chunk-LEEZCLZM.mjs";
|
|
32
7
|
|
|
33
8
|
// node_modules/braces/lib/utils.js
|
|
34
9
|
var require_utils = __commonJS({
|
|
@@ -21450,72 +21425,6 @@ var LangchainAgent = class {
|
|
|
21450
21425
|
}
|
|
21451
21426
|
};
|
|
21452
21427
|
|
|
21453
|
-
// src/runtime/langchain/model-resolver.ts
|
|
21454
|
-
import { AzureChatOpenAI, ChatOpenAI } from "@langchain/openai";
|
|
21455
|
-
var LangchainModelResolver = class {
|
|
21456
|
-
constructor(config) {
|
|
21457
|
-
this.config = config;
|
|
21458
|
-
}
|
|
21459
|
-
resolve(modelString, tags) {
|
|
21460
|
-
const parts = modelString.split(":");
|
|
21461
|
-
if (parts.length === 2) {
|
|
21462
|
-
const [provider, modelName] = parts;
|
|
21463
|
-
return this.resolveByProvider(provider, "default", modelName, tags);
|
|
21464
|
-
}
|
|
21465
|
-
if (parts.length === 3) {
|
|
21466
|
-
const [provider, configName, modelName] = parts;
|
|
21467
|
-
return this.resolveByProvider(provider, configName, modelName, tags);
|
|
21468
|
-
}
|
|
21469
|
-
throw new Error(
|
|
21470
|
-
'Model string must follow format "provider:modelName" (uses "default" config) or "provider:configName:modelName"'
|
|
21471
|
-
);
|
|
21472
|
-
}
|
|
21473
|
-
resolveByProvider(provider, configName, modelName, tags) {
|
|
21474
|
-
switch (provider) {
|
|
21475
|
-
case "openai":
|
|
21476
|
-
return this.resolveOpenAI(configName, modelName, tags);
|
|
21477
|
-
case "azure":
|
|
21478
|
-
return this.resolveAzure(configName, modelName, tags);
|
|
21479
|
-
default:
|
|
21480
|
-
throw new Error(`Unsupported model provider: ${provider}`);
|
|
21481
|
-
}
|
|
21482
|
-
}
|
|
21483
|
-
resolveOpenAI(configName, modelName, tags) {
|
|
21484
|
-
const providerConfig = this.config.openai?.[configName];
|
|
21485
|
-
if (!providerConfig) {
|
|
21486
|
-
throw new Error(`Configuration "${configName}" for provider "openai" is missing`);
|
|
21487
|
-
}
|
|
21488
|
-
return new ChatOpenAI({
|
|
21489
|
-
apiKey: providerConfig.apiKey,
|
|
21490
|
-
modelName,
|
|
21491
|
-
tags
|
|
21492
|
-
});
|
|
21493
|
-
}
|
|
21494
|
-
resolveAzure(configName, deploymentName, tags) {
|
|
21495
|
-
const providerConfig = this.config.azure?.[configName];
|
|
21496
|
-
if (!providerConfig) {
|
|
21497
|
-
throw new Error(`Configuration "${configName}" for provider "azure" is missing`);
|
|
21498
|
-
}
|
|
21499
|
-
return new AzureChatOpenAI({
|
|
21500
|
-
model: providerConfig.model,
|
|
21501
|
-
// shows (perhaps even uses) 3.5-turbo when not specifid
|
|
21502
|
-
azureOpenAIApiKey: providerConfig.apiKey,
|
|
21503
|
-
azureOpenAIApiInstanceName: this.extractInstanceName(providerConfig.endpoint),
|
|
21504
|
-
azureOpenAIApiDeploymentName: deploymentName,
|
|
21505
|
-
azureOpenAIApiVersion: providerConfig.apiVersion,
|
|
21506
|
-
tags
|
|
21507
|
-
});
|
|
21508
|
-
}
|
|
21509
|
-
extractInstanceName(endpoint) {
|
|
21510
|
-
try {
|
|
21511
|
-
const url = new URL(endpoint);
|
|
21512
|
-
return url.hostname.split(".")[0];
|
|
21513
|
-
} catch (e) {
|
|
21514
|
-
return endpoint;
|
|
21515
|
-
}
|
|
21516
|
-
}
|
|
21517
|
-
};
|
|
21518
|
-
|
|
21519
21428
|
// src/runtime/langchain/factory.ts
|
|
21520
21429
|
var LangchainAgentFactory = class {
|
|
21521
21430
|
constructor(modelConfig, saverConfig, storeConfig) {
|
|
@@ -21616,7 +21525,7 @@ ${memorySystemPrompt}` : memorySystemPrompt;
|
|
|
21616
21525
|
{
|
|
21617
21526
|
name: t.name,
|
|
21618
21527
|
description: t.description,
|
|
21619
|
-
schema: t.
|
|
21528
|
+
schema: t.inputSchema,
|
|
21620
21529
|
metadata: {
|
|
21621
21530
|
toolKit: t.toolKit,
|
|
21622
21531
|
toolKitIconUrl: t.toolKitIconUrl
|