UNPKG

@n8n/n8n-nodes-langchain

Version:

![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)

99 lines 3.54 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var AgentToolV3_node_exports = {}; __export(AgentToolV3_node_exports, { AgentToolV3: () => AgentToolV3 }); module.exports = __toCommonJS(AgentToolV3_node_exports); var import_n8n_workflow = require("n8n-workflow"); var import_descriptions = require("../../../../utils/descriptions"); var import_utils = require("../utils"); var import_description = require("../agents/ToolsAgent/V3/description"); var import_execute = require("../agents/ToolsAgent/V3/execute"); class AgentToolV3 { constructor(baseDescription) { this.description = { ...baseDescription, version: [3], defaults: { name: "AI Agent Tool", color: "#404040" }, inputs: `={{ ((hasOutputParser, needsFallback) => { ${import_utils.getInputs.toString()}; return getInputs(false, hasOutputParser, needsFallback) })($parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true, $parameter.needsFallback !== undefined && $parameter.needsFallback === true) }}`, outputs: [import_n8n_workflow.NodeConnectionTypes.AiTool], properties: [ import_descriptions.toolDescription, { ...import_descriptions.textInput }, { displayName: "Require Specific Output Format", name: "hasOutputParser", type: "boolean", default: false, noDataExpression: true }, { displayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${import_n8n_workflow.NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`, name: "notice", type: "notice", default: "", displayOptions: { show: { hasOutputParser: [true] } } }, { displayName: "Enable Fallback Model", name: "needsFallback", type: "boolean", default: false, noDataExpression: true }, { displayName: "Connect an additional language model on the canvas to use it as a fallback if the main model fails", name: "fallbackNotice", type: "notice", default: "", displayOptions: { show: { needsFallback: [true] } } }, import_description.toolsAgentProperties ] }; } // Automatically wrapped as a tool async execute(response) { return await import_execute.toolsAgentExecute.call(this, response); } } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { AgentToolV3 }); //# sourceMappingURL=AgentToolV3.node.js.map