@typia/langchain 13.0.0 → 13.0.1
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/lib/index.mjs +17 -3
- package/lib/index.mjs.map +1 -1
- package/lib/internal/LangChainToolsRegistrar.mjs +89 -3
- package/lib/internal/LangChainToolsRegistrar.mjs.map +1 -1
- package/package.json +7 -11
- package/lib/_virtual/LangChainToolsRegistrar.mjs +0 -4
- package/lib/_virtual/LangChainToolsRegistrar.mjs.map +0 -1
- package/lib/_virtual/_commonjsHelpers.mjs +0 -31
- package/lib/_virtual/_commonjsHelpers.mjs.map +0 -1
- package/lib/_virtual/index.mjs +0 -4
- package/lib/_virtual/index.mjs.map +0 -1
- package/lib/_virtual/tools.mjs +0 -7
- package/lib/_virtual/tools.mjs.map +0 -1
- package/lib/index2.mjs +0 -25
- package/lib/index2.mjs.map +0 -1
- package/lib/internal/LangChainToolsRegistrar2.mjs +0 -131
- package/lib/internal/LangChainToolsRegistrar2.mjs.map +0 -1
package/lib/index.mjs
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { LangChainToolsRegistrar } from "./internal/LangChainToolsRegistrar.mjs";
|
|
2
|
+
//#region src/index.ts
|
|
3
|
+
function toLangChainTools(input, options) {
|
|
4
|
+
return LangChainToolsRegistrar.convert(normalizeLangChainToolsProps(input, options));
|
|
5
|
+
}
|
|
6
|
+
const normalizeLangChainToolsProps = (input, options) => {
|
|
7
|
+
if (isLangChainToolsProps(input)) return input;
|
|
8
|
+
return {
|
|
9
|
+
controllers: Array.isArray(input) ? input : [input],
|
|
10
|
+
prefix: options?.prefix
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
const isLangChainToolsProps = (input) => Array.isArray(input) === false && typeof input === "object" && input !== null && "controllers" in input;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { toLangChainTools };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index.mjs.map
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { DynamicStructuredTool } from \"@langchain/core/tools\";\nimport { IHttpLlmController, ILlmController } from \"@typia/interface\";\n\nimport { LangChainToolsRegistrar } from \"./internal/LangChainToolsRegistrar\";\n\ntype ILangChainController = ILlmController | IHttpLlmController;\n\ninterface ILangChainToolsOptions {\n /**\n * Whether to add controller name as prefix to tool names.\n *\n * If `true`, tool names become `{controllerName}_{methodName}`. If `false`,\n * tool names are just `{methodName}`.\n *\n * @default false\n */\n prefix?: boolean | undefined;\n}\n\ninterface ILangChainToolsProps extends ILangChainToolsOptions {\n /**\n * List of controllers to convert to LangChain tools.\n *\n * - {@link ILlmController}: from `typia.llm.controller<Class>()`, converts all\n * methods of the class to tools\n * - {@link IHttpLlmController}: from `HttpLlm.controller()`, converts all\n * operations from OpenAPI document to tools\n */\n controllers: ILangChainController[];\n}\n\n/**\n * Convert typia controllers to LangChain tools.\n *\n * Converts TypeScript class methods via `typia.llm.controller<Class>()` or\n * OpenAPI operations via `HttpLlm.controller()` to LangChain tools.\n *\n * Every tool call is validated by typia. If LLM provides invalid arguments,\n * returns validation error formatted by {@link LlmJson.stringify} so that LLM\n * can correct them automatically.\n *\n * @example\n * ```typescript\n * import { initChatModel } from \"langchain/chat_models/universal\";\n * import typia from \"typia\";\n * import { toLangChainTools } from \"@typia/langchain\";\n *\n * class Calculator {\n * add(input: { a: number; b: number }): { value: number } {\n * return { value: input.a + input.b };\n * }\n * }\n *\n * const controller = typia.llm.controller<Calculator>(\n * \"calculator\",\n * new Calculator(),\n * );\n * const tools = toLangChainTools(controller);\n *\n * const llm = await initChatModel();\n * const modelWithTools = llm.bindTools(tools);\n * const result = await modelWithTools.invoke(\"What is 10 + 5?\");\n * ```;\n *\n * @param input Controller, controller list, or conversion properties\n * @param options Conversion options when `input` is not a properties object\n * @returns Array of LangChain DynamicStructuredTool\n */\nexport function toLangChainTools(\n controller: ILangChainController,\n options?: ILangChainToolsOptions | undefined,\n): DynamicStructuredTool[];\nexport function toLangChainTools(\n controllers: ILangChainController[],\n options?: ILangChainToolsOptions | undefined,\n): DynamicStructuredTool[];\nexport function toLangChainTools(\n props: ILangChainToolsProps,\n): DynamicStructuredTool[];\nexport function toLangChainTools(\n input: ILangChainController | ILangChainController[] | ILangChainToolsProps,\n options?: ILangChainToolsOptions | undefined,\n): DynamicStructuredTool[] {\n return LangChainToolsRegistrar.convert(\n normalizeLangChainToolsProps(input, options),\n );\n}\n\nconst normalizeLangChainToolsProps = (\n input: ILangChainController | ILangChainController[] | ILangChainToolsProps,\n options?: ILangChainToolsOptions | undefined,\n): ILangChainToolsProps => {\n if (isLangChainToolsProps(input)) return input;\n return {\n controllers: Array.isArray(input) ? input : [input],\n prefix: options?.prefix,\n };\n};\n\nconst isLangChainToolsProps = (\n input: ILangChainController | ILangChainController[] | ILangChainToolsProps,\n): input is ILangChainToolsProps =>\n Array.isArray(input) === false &&\n typeof input === \"object\" &&\n input !== null &&\n \"controllers\" in input;\n"],"mappings":";;AA+EA,SAAgB,iBACd,OACA,SACyB;CACzB,OAAO,wBAAwB,QAC7B,6BAA6B,OAAO,OAAO,CAC7C;AACF;AAEA,MAAM,gCACJ,OACA,YACyB;CACzB,IAAI,sBAAsB,KAAK,GAAG,OAAO;CACzC,OAAO;EACL,aAAa,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;EAClD,QAAQ,SAAS;CACnB;AACF;AAEA,MAAM,yBACJ,UAEA,MAAM,QAAQ,KAAK,MAAM,SACzB,OAAO,UAAU,YACjB,UAAU,QACV,iBAAiB"}
|
|
@@ -1,3 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//#
|
|
1
|
+
import { ToolInputParsingException, tool } from "@langchain/core/tools";
|
|
2
|
+
import { HttpLlm, LlmJson } from "@typia/utils";
|
|
3
|
+
//#region src/internal/LangChainToolsRegistrar.ts
|
|
4
|
+
let LangChainToolsRegistrar;
|
|
5
|
+
(function(_LangChainToolsRegistrar) {
|
|
6
|
+
_LangChainToolsRegistrar.convert = (props) => {
|
|
7
|
+
const prefix = props.prefix ?? false;
|
|
8
|
+
const tools = [];
|
|
9
|
+
if (prefix === false && props.controllers.length >= 2) {
|
|
10
|
+
const names = /* @__PURE__ */ new Map();
|
|
11
|
+
const duplicates = [];
|
|
12
|
+
for (const controller of props.controllers) for (const func of controller.application.functions) {
|
|
13
|
+
const existing = names.get(func.name);
|
|
14
|
+
if (existing !== void 0) duplicates.push(`"${func.name}" in "${controller.name}" (conflicts with "${existing}")`);
|
|
15
|
+
else names.set(func.name, controller.name);
|
|
16
|
+
}
|
|
17
|
+
if (duplicates.length > 0) throw new Error(`Duplicate tool names found:\n - ${duplicates.join("\n - ")}`);
|
|
18
|
+
}
|
|
19
|
+
for (const controller of props.controllers) if (controller.protocol === "class") convertClassController(tools, controller, prefix);
|
|
20
|
+
else convertHttpController(tools, controller, prefix);
|
|
21
|
+
return tools;
|
|
22
|
+
};
|
|
23
|
+
const convertClassController = (tools, controller, prefix) => {
|
|
24
|
+
const execute = controller.execute;
|
|
25
|
+
for (const func of controller.application.functions) {
|
|
26
|
+
const toolName = prefix ? `${controller.name}_${func.name}` : func.name;
|
|
27
|
+
const method = execute[func.name];
|
|
28
|
+
if (typeof method !== "function") throw new Error(`Method "${func.name}" not found on controller "${controller.name}"`);
|
|
29
|
+
tools.push(createTool({
|
|
30
|
+
name: toolName,
|
|
31
|
+
function: func,
|
|
32
|
+
execute: async (args) => method.call(execute, args)
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const convertHttpController = (tools, controller, prefix) => {
|
|
37
|
+
const application = controller.application;
|
|
38
|
+
const connection = controller.connection;
|
|
39
|
+
for (const func of application.functions) {
|
|
40
|
+
const toolName = prefix ? `${controller.name}_${func.name}` : func.name;
|
|
41
|
+
tools.push(createTool({
|
|
42
|
+
name: toolName,
|
|
43
|
+
function: func,
|
|
44
|
+
execute: async (args) => {
|
|
45
|
+
if (controller.execute !== void 0) return (await controller.execute({
|
|
46
|
+
connection,
|
|
47
|
+
application,
|
|
48
|
+
function: func,
|
|
49
|
+
arguments: args
|
|
50
|
+
})).body;
|
|
51
|
+
return HttpLlm.execute({
|
|
52
|
+
application,
|
|
53
|
+
function: func,
|
|
54
|
+
connection,
|
|
55
|
+
input: args
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const createTool = (entry) => tool(async (args) => {
|
|
62
|
+
const valid = LlmJson.validateArguments(entry.function, args ?? {});
|
|
63
|
+
if (valid.success === false) throw new ToolInputParsingException(`Type errors in "${entry.name}" arguments:\n\n\`\`\`json\n${LlmJson.stringify(valid)}\n\`\`\``, JSON.stringify(args ?? {}));
|
|
64
|
+
try {
|
|
65
|
+
const result = await entry.execute(valid.data);
|
|
66
|
+
if (result === void 0) return entry.function.output === void 0 ? { success: true } : {
|
|
67
|
+
success: false,
|
|
68
|
+
error: `Function "${entry.name}" returned undefined despite declaring an output schema`
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
success: true,
|
|
72
|
+
data: result
|
|
73
|
+
};
|
|
74
|
+
} catch (error) {
|
|
75
|
+
return {
|
|
76
|
+
success: false,
|
|
77
|
+
error: error instanceof Error ? `${error.name}: ${error.message}` : String(error)
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
name: entry.name,
|
|
82
|
+
description: entry.function.description ?? "",
|
|
83
|
+
schema: entry.function.parameters
|
|
84
|
+
});
|
|
85
|
+
})(LangChainToolsRegistrar || (LangChainToolsRegistrar = {}));
|
|
86
|
+
//#endregion
|
|
87
|
+
export { LangChainToolsRegistrar };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=LangChainToolsRegistrar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LangChainToolsRegistrar.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"LangChainToolsRegistrar.mjs","names":[],"sources":["../../src/internal/LangChainToolsRegistrar.ts"],"sourcesContent":["import {\n DynamicStructuredTool,\n ToolInputParsingException,\n tool,\n} from \"@langchain/core/tools\";\nimport {\n IHttpLlmController,\n IHttpLlmFunction,\n ILlmController,\n ILlmFunction,\n IValidation,\n} from \"@typia/interface\";\nimport { HttpLlm, LlmJson } from \"@typia/utils\";\n\nexport namespace LangChainToolsRegistrar {\n export const convert = (props: {\n controllers: Array<ILlmController | IHttpLlmController>;\n prefix?: boolean | undefined;\n }): DynamicStructuredTool[] => {\n const prefix: boolean = props.prefix ?? false;\n const tools: DynamicStructuredTool[] = [];\n\n // check duplicate tool names\n if (prefix === false && props.controllers.length >= 2) {\n const names: Map<string, string> = new Map();\n const duplicates: string[] = [];\n for (const controller of props.controllers) {\n for (const func of controller.application.functions) {\n const existing: string | undefined = names.get(func.name);\n if (existing !== undefined)\n duplicates.push(\n `\"${func.name}\" in \"${controller.name}\" (conflicts with \"${existing}\")`,\n );\n else names.set(func.name, controller.name);\n }\n }\n if (duplicates.length > 0)\n throw new Error(\n `Duplicate tool names found:\\n - ${duplicates.join(\"\\n - \")}`,\n );\n }\n\n // convert controllers to tools\n for (const controller of props.controllers) {\n if (controller.protocol === \"class\") {\n convertClassController(tools, controller, prefix);\n } else {\n convertHttpController(tools, controller, prefix);\n }\n }\n\n return tools;\n };\n\n const convertClassController = (\n tools: DynamicStructuredTool[],\n controller: ILlmController,\n prefix: boolean,\n ): void => {\n const execute: Record<string, unknown> = controller.execute;\n\n for (const func of controller.application.functions) {\n const toolName: string = prefix\n ? `${controller.name}_${func.name}`\n : func.name;\n\n const method: unknown = execute[func.name];\n if (typeof method !== \"function\") {\n throw new Error(\n `Method \"${func.name}\" not found on controller \"${controller.name}\"`,\n );\n }\n\n tools.push(\n createTool({\n name: toolName,\n function: func,\n execute: async (args: unknown) => method.call(execute, args),\n }),\n );\n }\n };\n\n const convertHttpController = (\n tools: DynamicStructuredTool[],\n controller: IHttpLlmController,\n prefix: boolean,\n ): void => {\n const application = controller.application;\n const connection = controller.connection;\n\n for (const func of application.functions) {\n const toolName: string = prefix\n ? `${controller.name}_${func.name}`\n : func.name;\n\n tools.push(\n createTool({\n name: toolName,\n function: func,\n execute: async (args: unknown) => {\n if (controller.execute !== undefined) {\n const response = await controller.execute({\n connection,\n application,\n function: func,\n arguments: args as object,\n });\n return response.body;\n }\n return HttpLlm.execute({\n application,\n function: func,\n connection,\n input: args as object,\n });\n },\n }),\n );\n }\n };\n\n const createTool = (entry: {\n name: string;\n function: ILlmFunction | IHttpLlmFunction;\n execute: (args: unknown) => Promise<unknown>;\n }): DynamicStructuredTool =>\n tool(\n async (args: unknown): Promise<unknown> => {\n const valid: IValidation<unknown> = LlmJson.validateArguments(\n entry.function,\n args ?? {},\n );\n if (valid.success === false)\n throw new ToolInputParsingException(\n `Type errors in \"${entry.name}\" arguments:\\n\\n` +\n `\\`\\`\\`json\\n${LlmJson.stringify(valid)}\\n\\`\\`\\``,\n JSON.stringify(args ?? {}),\n );\n try {\n const result: unknown = await entry.execute(valid.data);\n if (result === undefined) {\n return entry.function.output === undefined\n ? ({ success: true } satisfies ITryResult)\n : ({\n success: false,\n error: `Function \"${entry.name}\" returned undefined despite declaring an output schema`,\n } satisfies ITryResult);\n }\n return { success: true, data: result } satisfies ITryResult;\n } catch (error) {\n return {\n success: false,\n error:\n error instanceof Error\n ? `${error.name}: ${error.message}`\n : String(error),\n } satisfies ITryResult;\n }\n },\n {\n name: entry.name,\n description: entry.function.description ?? \"\",\n schema: entry.function.parameters,\n },\n );\n}\n\ntype ITryResult =\n | { success: true; data?: unknown | undefined }\n | { success: false; error: string };\n"],"mappings":";;;AAcO,IAAA;;qCACmB,UAGO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KAAK,GAAG,KAAK,SAC3B,KAAK;GAET,MAAM,KACJ,WAAW;IACT,MAAM;IACN,UAAU;IACV,SAAS,OAAO,SAAkB;KAChC,IAAI,WAAW,YAAY,KAAA,GAOzB,QAAO,MANgB,WAAW,QAAQ;MACxC;MACA;MACA,UAAU;MACV,WAAW;KACb,CAAC,EAAA,CACe;KAElB,OAAO,QAAQ,QAAQ;MACrB;MACA,UAAU;MACV;MACA,OAAO;KACT,CAAC;IACH;GACF,CAAC,CACH;EACF;CACF;CAEA,MAAM,cAAc,UAKlB,KACE,OAAO,SAAoC;EACzC,MAAM,QAA8B,QAAQ,kBAC1C,MAAM,UACN,QAAQ,CAAC,CACX;EACA,IAAI,MAAM,YAAY,OACpB,MAAM,IAAI,0BACR,mBAAmB,MAAM,KAAK,8BACb,QAAQ,UAAU,KAAK,EAAE,WAC1C,KAAK,UAAU,QAAQ,CAAC,CAAC,CAC3B;EACF,IAAI;GACF,MAAM,SAAkB,MAAM,MAAM,QAAQ,MAAM,IAAI;GACtD,IAAI,WAAW,KAAA,GACb,OAAO,MAAM,SAAS,WAAW,KAAA,IAC5B,EAAE,SAAS,KAAK,IAChB;IACC,SAAS;IACT,OAAO,aAAa,MAAM,KAAK;GACjC;GAEN,OAAO;IAAE,SAAS;IAAM,MAAM;GAAO;EACvC,SAAS,OAAO;GACd,OAAO;IACL,SAAS;IACT,OACE,iBAAiB,QACb,GAAG,MAAM,KAAK,IAAI,MAAM,YACxB,OAAO,KAAK;GACpB;EACF;CACF,GACA;EACE,MAAM,MAAM;EACZ,aAAa,MAAM,SAAS,eAAe;EAC3C,QAAQ,MAAM,SAAS;CACzB,CACF;GACH,4BAAA,0BAAA,CAAA,EAAD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typia/langchain",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.1",
|
|
4
4
|
"description": "LangChain.js integration for typia",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -22,23 +22,19 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://typia.io",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@typia/interface": "^13.0.
|
|
26
|
-
"@typia/utils": "^13.0.
|
|
25
|
+
"@typia/interface": "^13.0.1",
|
|
26
|
+
"@typia/utils": "^13.0.1"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@langchain/core": ">=1.0.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@langchain/core": "^1.1.31",
|
|
33
|
-
"@rollup/plugin-commonjs": "^29.0.0",
|
|
34
|
-
"@rollup/plugin-esm-shim": "^0.1.8",
|
|
35
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
36
|
-
"typescript": "^7.0.2",
|
|
37
33
|
"rimraf": "^6.1.2",
|
|
38
|
-
"
|
|
39
|
-
"rollup-plugin-node-externals": "^8.1.2",
|
|
34
|
+
"rolldown": "^1.1.5",
|
|
40
35
|
"tinyglobby": "^0.2.12",
|
|
41
|
-
"ttsc": "^0.17.3"
|
|
36
|
+
"ttsc": "^0.17.3",
|
|
37
|
+
"typescript": "^7.0.2"
|
|
42
38
|
},
|
|
43
39
|
"sideEffects": false,
|
|
44
40
|
"files": [
|
|
@@ -64,7 +60,7 @@
|
|
|
64
60
|
"access": "public"
|
|
65
61
|
},
|
|
66
62
|
"scripts": {
|
|
67
|
-
"build": "rimraf lib && ttsc &&
|
|
63
|
+
"build": "rimraf lib && ttsc && rolldown -c",
|
|
68
64
|
"dev": "ttsc --watch"
|
|
69
65
|
},
|
|
70
66
|
"module": "lib/index.mjs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LangChainToolsRegistrar.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
function getAugmentedNamespace(n) {
|
|
2
|
-
if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
|
|
3
|
-
var f = n.default;
|
|
4
|
-
if (typeof f == "function") {
|
|
5
|
-
var a = function a () {
|
|
6
|
-
var isInstance = false;
|
|
7
|
-
try {
|
|
8
|
-
isInstance = this instanceof a;
|
|
9
|
-
} catch {}
|
|
10
|
-
if (isInstance) {
|
|
11
|
-
return Reflect.construct(f, arguments, this.constructor);
|
|
12
|
-
}
|
|
13
|
-
return f.apply(this, arguments);
|
|
14
|
-
};
|
|
15
|
-
a.prototype = f.prototype;
|
|
16
|
-
} else a = {};
|
|
17
|
-
Object.defineProperty(a, '__esModule', {value: true});
|
|
18
|
-
Object.keys(n).forEach(function (k) {
|
|
19
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
20
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () {
|
|
23
|
-
return n[k];
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
return a;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { getAugmentedNamespace };
|
|
31
|
-
//# sourceMappingURL=_commonjsHelpers.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_commonjsHelpers.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/_virtual/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/lib/_virtual/tools.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/lib/index2.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { __exports as lib } from './_virtual/index.mjs';
|
|
2
|
-
import './internal/LangChainToolsRegistrar2.mjs';
|
|
3
|
-
import { __exports as LangChainToolsRegistrar } from './_virtual/LangChainToolsRegistrar.mjs';
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(lib, "__esModule", { value: true });
|
|
6
|
-
var toLangChainTools_1 = lib.toLangChainTools = toLangChainTools;
|
|
7
|
-
const LangChainToolsRegistrar_1 = LangChainToolsRegistrar;
|
|
8
|
-
function toLangChainTools(input, options) {
|
|
9
|
-
return LangChainToolsRegistrar_1.LangChainToolsRegistrar.convert(normalizeLangChainToolsProps(input, options));
|
|
10
|
-
}
|
|
11
|
-
const normalizeLangChainToolsProps = (input, options) => {
|
|
12
|
-
if (isLangChainToolsProps(input))
|
|
13
|
-
return input;
|
|
14
|
-
return {
|
|
15
|
-
controllers: Array.isArray(input) ? input : [input],
|
|
16
|
-
prefix: options === null || options === void 0 ? void 0 : options.prefix,
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
const isLangChainToolsProps = (input) => Array.isArray(input) === false &&
|
|
20
|
-
typeof input === "object" &&
|
|
21
|
-
input !== null &&
|
|
22
|
-
"controllers" in input;
|
|
23
|
-
|
|
24
|
-
export { lib as default, toLangChainTools_1 as toLangChainTools };
|
|
25
|
-
//# sourceMappingURL=index2.mjs.map
|
package/lib/index2.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index2.mjs","sources":["index.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toLangChainTools = toLangChainTools;\nconst LangChainToolsRegistrar_1 = require(\"./internal/LangChainToolsRegistrar\");\nfunction toLangChainTools(input, options) {\n return LangChainToolsRegistrar_1.LangChainToolsRegistrar.convert(normalizeLangChainToolsProps(input, options));\n}\nconst normalizeLangChainToolsProps = (input, options) => {\n if (isLangChainToolsProps(input))\n return input;\n return {\n controllers: Array.isArray(input) ? input : [input],\n prefix: options === null || options === void 0 ? void 0 : options.prefix,\n };\n};\nconst isLangChainToolsProps = (input) => Array.isArray(input) === false &&\n typeof input === \"object\" &&\n input !== null &&\n \"controllers\" in input;\n//# sourceMappingURL=index.js.map"],"names":["require$$0"],"mappings":";;;;AACA,MAAM,CAAC,cAAc,CAAC,GAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,IAAA,kBAAA,GAAA,GAAA,CAAA,gBAAwB,GAAG;AAC3B,MAAM,yBAAyB,GAAGA,uBAA6C;AAC/E,SAAS,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE;AAC1C,IAAI,OAAO,yBAAyB,CAAC,uBAAuB,CAAC,OAAO,CAAC,4BAA4B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAClH;AACA,MAAM,4BAA4B,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK;AACzD,IAAI,IAAI,qBAAqB,CAAC,KAAK,CAAC;AACpC,QAAQ,OAAO,KAAK;AACpB,IAAI,OAAO;AACX,QAAQ,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC;AAC3D,QAAQ,MAAM,EAAE,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM;AAChF,KAAK;AACL,CAAC;AACD,MAAM,qBAAqB,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK;AACvE,IAAI,OAAO,KAAK,KAAK,QAAQ;AAC7B,IAAI,KAAK,KAAK,IAAI;AAClB,IAAI,aAAa,IAAI,KAAK;;;;"}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { __exports as LangChainToolsRegistrar$1 } from '../_virtual/LangChainToolsRegistrar.mjs';
|
|
2
|
-
import require$$0 from '../_virtual/tools.mjs';
|
|
3
|
-
import require$$1 from '@typia/utils';
|
|
4
|
-
|
|
5
|
-
var __awaiter = (LangChainToolsRegistrar$1 && LangChainToolsRegistrar$1.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(LangChainToolsRegistrar$1, "__esModule", { value: true });
|
|
15
|
-
var LangChainToolsRegistrar_2 = LangChainToolsRegistrar$1.LangChainToolsRegistrar = void 0;
|
|
16
|
-
const tools_1 = require$$0;
|
|
17
|
-
const utils_1 = require$$1;
|
|
18
|
-
var LangChainToolsRegistrar;
|
|
19
|
-
(function (LangChainToolsRegistrar) {
|
|
20
|
-
LangChainToolsRegistrar.convert = (props) => {
|
|
21
|
-
var _a;
|
|
22
|
-
const prefix = (_a = props.prefix) !== null && _a !== void 0 ? _a : false;
|
|
23
|
-
const tools = [];
|
|
24
|
-
// check duplicate tool names
|
|
25
|
-
if (prefix === false && props.controllers.length >= 2) {
|
|
26
|
-
const names = new Map();
|
|
27
|
-
const duplicates = [];
|
|
28
|
-
for (const controller of props.controllers) {
|
|
29
|
-
for (const func of controller.application.functions) {
|
|
30
|
-
const existing = names.get(func.name);
|
|
31
|
-
if (existing !== undefined)
|
|
32
|
-
duplicates.push(`"${func.name}" in "${controller.name}" (conflicts with "${existing}")`);
|
|
33
|
-
else
|
|
34
|
-
names.set(func.name, controller.name);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (duplicates.length > 0)
|
|
38
|
-
throw new Error(`Duplicate tool names found:\n - ${duplicates.join("\n - ")}`);
|
|
39
|
-
}
|
|
40
|
-
// convert controllers to tools
|
|
41
|
-
for (const controller of props.controllers) {
|
|
42
|
-
if (controller.protocol === "class") {
|
|
43
|
-
convertClassController(tools, controller, prefix);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
convertHttpController(tools, controller, prefix);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return tools;
|
|
50
|
-
};
|
|
51
|
-
const convertClassController = (tools, controller, prefix) => {
|
|
52
|
-
const execute = controller.execute;
|
|
53
|
-
for (const func of controller.application.functions) {
|
|
54
|
-
const toolName = prefix
|
|
55
|
-
? `${controller.name}_${func.name}`
|
|
56
|
-
: func.name;
|
|
57
|
-
const method = execute[func.name];
|
|
58
|
-
if (typeof method !== "function") {
|
|
59
|
-
throw new Error(`Method "${func.name}" not found on controller "${controller.name}"`);
|
|
60
|
-
}
|
|
61
|
-
tools.push(createTool({
|
|
62
|
-
name: toolName,
|
|
63
|
-
function: func,
|
|
64
|
-
execute: (args) => __awaiter(this, void 0, void 0, function* () { return method.call(execute, args); }),
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
const convertHttpController = (tools, controller, prefix) => {
|
|
69
|
-
const application = controller.application;
|
|
70
|
-
const connection = controller.connection;
|
|
71
|
-
for (const func of application.functions) {
|
|
72
|
-
const toolName = prefix
|
|
73
|
-
? `${controller.name}_${func.name}`
|
|
74
|
-
: func.name;
|
|
75
|
-
tools.push(createTool({
|
|
76
|
-
name: toolName,
|
|
77
|
-
function: func,
|
|
78
|
-
execute: (args) => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
if (controller.execute !== undefined) {
|
|
80
|
-
const response = yield controller.execute({
|
|
81
|
-
connection,
|
|
82
|
-
application,
|
|
83
|
-
function: func,
|
|
84
|
-
arguments: args,
|
|
85
|
-
});
|
|
86
|
-
return response.body;
|
|
87
|
-
}
|
|
88
|
-
return utils_1.HttpLlm.execute({
|
|
89
|
-
application,
|
|
90
|
-
function: func,
|
|
91
|
-
connection,
|
|
92
|
-
input: args,
|
|
93
|
-
});
|
|
94
|
-
}),
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const createTool = (entry) => { var _a; return (0, tools_1.tool)((args) => __awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
const valid = utils_1.LlmJson.validateArguments(entry.function, args !== null && args !== void 0 ? args : {});
|
|
100
|
-
if (valid.success === false)
|
|
101
|
-
throw new tools_1.ToolInputParsingException(`Type errors in "${entry.name}" arguments:\n\n` +
|
|
102
|
-
`\`\`\`json\n${utils_1.LlmJson.stringify(valid)}\n\`\`\``, JSON.stringify(args !== null && args !== void 0 ? args : {}));
|
|
103
|
-
try {
|
|
104
|
-
const result = yield entry.execute(valid.data);
|
|
105
|
-
if (result === undefined) {
|
|
106
|
-
return entry.function.output === undefined
|
|
107
|
-
? { success: true }
|
|
108
|
-
: {
|
|
109
|
-
success: false,
|
|
110
|
-
error: `Function "${entry.name}" returned undefined despite declaring an output schema`,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
return { success: true, data: result };
|
|
114
|
-
}
|
|
115
|
-
catch (error) {
|
|
116
|
-
return {
|
|
117
|
-
success: false,
|
|
118
|
-
error: error instanceof Error
|
|
119
|
-
? `${error.name}: ${error.message}`
|
|
120
|
-
: String(error),
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
}), {
|
|
124
|
-
name: entry.name,
|
|
125
|
-
description: (_a = entry.function.description) !== null && _a !== void 0 ? _a : "",
|
|
126
|
-
schema: entry.function.parameters,
|
|
127
|
-
}); };
|
|
128
|
-
})(LangChainToolsRegistrar || (LangChainToolsRegistrar_2 = LangChainToolsRegistrar$1.LangChainToolsRegistrar = LangChainToolsRegistrar = {}));
|
|
129
|
-
|
|
130
|
-
export { LangChainToolsRegistrar_2 as LangChainToolsRegistrar, LangChainToolsRegistrar$1 as default };
|
|
131
|
-
//# sourceMappingURL=LangChainToolsRegistrar2.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LangChainToolsRegistrar2.mjs","sources":["LangChainToolsRegistrar.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LangChainToolsRegistrar = void 0;\nconst tools_1 = require(\"@langchain/core/tools\");\nconst utils_1 = require(\"@typia/utils\");\nvar LangChainToolsRegistrar;\n(function (LangChainToolsRegistrar) {\n LangChainToolsRegistrar.convert = (props) => {\n var _a;\n const prefix = (_a = props.prefix) !== null && _a !== void 0 ? _a : false;\n const tools = [];\n // check duplicate tool names\n if (prefix === false && props.controllers.length >= 2) {\n const names = new Map();\n const duplicates = [];\n for (const controller of props.controllers) {\n for (const func of controller.application.functions) {\n const existing = names.get(func.name);\n if (existing !== undefined)\n duplicates.push(`\"${func.name}\" in \"${controller.name}\" (conflicts with \"${existing}\")`);\n else\n names.set(func.name, controller.name);\n }\n }\n if (duplicates.length > 0)\n throw new Error(`Duplicate tool names found:\\n - ${duplicates.join(\"\\n - \")}`);\n }\n // convert controllers to tools\n for (const controller of props.controllers) {\n if (controller.protocol === \"class\") {\n convertClassController(tools, controller, prefix);\n }\n else {\n convertHttpController(tools, controller, prefix);\n }\n }\n return tools;\n };\n const convertClassController = (tools, controller, prefix) => {\n const execute = controller.execute;\n for (const func of controller.application.functions) {\n const toolName = prefix\n ? `${controller.name}_${func.name}`\n : func.name;\n const method = execute[func.name];\n if (typeof method !== \"function\") {\n throw new Error(`Method \"${func.name}\" not found on controller \"${controller.name}\"`);\n }\n tools.push(createTool({\n name: toolName,\n function: func,\n execute: (args) => __awaiter(this, void 0, void 0, function* () { return method.call(execute, args); }),\n }));\n }\n };\n const convertHttpController = (tools, controller, prefix) => {\n const application = controller.application;\n const connection = controller.connection;\n for (const func of application.functions) {\n const toolName = prefix\n ? `${controller.name}_${func.name}`\n : func.name;\n tools.push(createTool({\n name: toolName,\n function: func,\n execute: (args) => __awaiter(this, void 0, void 0, function* () {\n if (controller.execute !== undefined) {\n const response = yield controller.execute({\n connection,\n application,\n function: func,\n arguments: args,\n });\n return response.body;\n }\n return utils_1.HttpLlm.execute({\n application,\n function: func,\n connection,\n input: args,\n });\n }),\n }));\n }\n };\n const createTool = (entry) => { var _a; return (0, tools_1.tool)((args) => __awaiter(this, void 0, void 0, function* () {\n const valid = utils_1.LlmJson.validateArguments(entry.function, args !== null && args !== void 0 ? args : {});\n if (valid.success === false)\n throw new tools_1.ToolInputParsingException(`Type errors in \"${entry.name}\" arguments:\\n\\n` +\n `\\`\\`\\`json\\n${utils_1.LlmJson.stringify(valid)}\\n\\`\\`\\``, JSON.stringify(args !== null && args !== void 0 ? args : {}));\n try {\n const result = yield entry.execute(valid.data);\n if (result === undefined) {\n return entry.function.output === undefined\n ? { success: true }\n : {\n success: false,\n error: `Function \"${entry.name}\" returned undefined despite declaring an output schema`,\n };\n }\n return { success: true, data: result };\n }\n catch (error) {\n return {\n success: false,\n error: error instanceof Error\n ? `${error.name}: ${error.message}`\n : String(error),\n };\n }\n }), {\n name: entry.name,\n description: (_a = entry.function.description) !== null && _a !== void 0 ? _a : \"\",\n schema: entry.function.parameters,\n }); };\n})(LangChainToolsRegistrar || (exports.LangChainToolsRegistrar = LangChainToolsRegistrar = {}));\n//# sourceMappingURL=LangChainToolsRegistrar.js.map"],"names":["this","LangChainToolsRegistrar_1"],"mappings":";;;;AACA,IAAI,SAAS,GAAG,CAACA,yBAAI,IAAIA,yBAAI,CAAC,SAAS,KAAK,UAAU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