@langchain/community
Version:
Third-party integrations for LangChain.js
1 lines • 1.53 kB
Source Map (JSON)
{"version":3,"file":"index.cjs","names":["Toolkit"],"sources":["../../../../src/agents/toolkits/connery/index.ts"],"sourcesContent":["import { Tool, ToolInterface } from \"@langchain/core/tools\";\nimport { Toolkit } from \"@langchain/core/indexing\";\nimport { ConneryService } from \"../../../tools/connery.js\";\n\n/**\n * ConneryToolkit provides access to all the available actions from the Connery Runner.\n * @extends Toolkit\n */\nexport class ConneryToolkit extends Toolkit {\n tools: ToolInterface[];\n\n /**\n * Creates a ConneryToolkit instance based on the provided ConneryService instance.\n * It populates the tools property of the ConneryToolkit instance with the list of\n * available tools from the Connery Runner.\n * @param conneryService The ConneryService instance.\n * @returns A Promise that resolves to a ConneryToolkit instance.\n */\n static async createInstance(\n conneryService: ConneryService\n ): Promise<ConneryToolkit> {\n const toolkit = new ConneryToolkit();\n toolkit.tools = [];\n\n const actions = await conneryService.listActions();\n toolkit.tools.push(...(actions as unknown as Tool[])); // This is a hack to make TypeScript happy, as TypeScript doesn't know that ConneryAction (StructuredTool) extends Tool.\n return toolkit;\n }\n}\n"],"mappings":";;;;;;;;;AAQA,IAAa,iBAAb,MAAa,uBAAuBA,yBAAAA,QAAQ;CAC1C;;;;;;;;CASA,aAAa,eACX,gBACyB;EACzB,MAAM,UAAU,IAAI,gBAAgB;AACpC,UAAQ,QAAQ,EAAE;EAElB,MAAM,UAAU,MAAM,eAAe,aAAa;AAClD,UAAQ,MAAM,KAAK,GAAI,QAA8B;AACrD,SAAO"}