diff --git a/packages/components/nodes/agents/MRKLAgentLLM/MRKLAgentLLM.ts b/packages/components/nodes/agents/MRKLAgentLLM/MRKLAgentLLM.ts index 499b93834..f0bf54c00 100644 --- a/packages/components/nodes/agents/MRKLAgentLLM/MRKLAgentLLM.ts +++ b/packages/components/nodes/agents/MRKLAgentLLM/MRKLAgentLLM.ts @@ -26,7 +26,7 @@ class MRKLAgentLLM_Agents implements INode { { label: 'Allowed Tools', name: 'tools', - type: 'Tool', + type: 'Tool' || 'Tool[]', list: true }, { @@ -40,7 +40,7 @@ class MRKLAgentLLM_Agents implements INode { async init(nodeData: INodeData): Promise { const model = nodeData.inputs?.model as BaseLLM const tools = nodeData.inputs?.tools as Tool[] - + console.log(`something about tools: ${JSON.stringify(tools)}`) const executor = await initializeAgentExecutorWithOptions(tools, model, { agentType: 'zero-shot-react-description', verbose: true diff --git a/packages/components/nodes/tools/ZapierNLA/ZapierNLA.ts b/packages/components/nodes/tools/ZapierNLA/ZapierNLA.ts new file mode 100644 index 000000000..d38da20a5 --- /dev/null +++ b/packages/components/nodes/tools/ZapierNLA/ZapierNLA.ts @@ -0,0 +1,46 @@ +import { ZapierNLAWrapper, ZapiterNLAWrapperParams } from 'langchain/tools' +import { INode, INodeData, INodeParams } from '../../../src/Interface' +import { getBaseClasses } from '../../../src/utils' +import { ZapierToolKit, createSqlAgent } from 'langchain/agents' + +class ZapierNLA_Tools implements INode { + label: string + name: string + description: string + type: string + icon: string + category: string + baseClasses: string[] + inputs: INodeParams[] + + constructor() { + this.label = 'Zapier NLA' + this.name = 'zapierNLA' + this.type = 'ZapierNLA' + this.icon = 'zapier.png' + this.category = 'Tools' + this.description = 'Access to apps and actions on Zapier's platform through a natural language API interface' + this.inputs = [ + { + label: 'Zapier NLA Api Key', + name: 'apiKey', + type: 'password' + } + ] + this.baseClasses = [this.type, ...getBaseClasses(ZapierNLAWrapper)] + } + + async init(nodeData: INodeData): Promise { + const apiKey = nodeData.inputs?.apiKey as string + + const obj: Partial = { + apiKey + } + const zapier = new ZapierNLAWrapper(obj) + const toolkit = await ZapierToolKit.fromZapierNLAWrapper(zapier) + + return toolkit.tools + } +} + +module.exports = { nodeClass: ZapierNLA_Tools } diff --git a/packages/components/nodes/tools/ZapierNLA/zapier.png b/packages/components/nodes/tools/ZapierNLA/zapier.png new file mode 100644 index 000000000..769716faa Binary files /dev/null and b/packages/components/nodes/tools/ZapierNLA/zapier.png differ