Пользовательский набор инструментов LangChain из нескольких инструментов
Как я могу объединить несколько инструментов LangChain в набор инструментов на TypeScript?
import { Toolkit } from 'langchain/agents';
import { DynamicTool, Tool } from 'langchain/tools';
export class CustomToolkit extends Toolkit {
tools: Tool[];
constructor() {
super();
this.tools = [
new DynamicTool({
name: 'FOO',
description:
'call this to get the value of foo. input should be an empty string.',
func: async () => 'baz'
}),
new DynamicTool({
name: 'BAR',
description:
'call this to get the value of bar. input should be an empty string.',
func: async () => 'baz1'
})
];
}
}
Когда я загружаю Toolkit в Агент, он сообщает мне следующее:Type 'CustomToolkit' is missing the following properties from type 'Tool': schema, call, lc_namespace, _call, and 11 more.ts(2740)