Skip to main content

Agent.listTools()

.listTools() 方法获取为代理配置的工具,如果这些工具是函数,则会解析它们。这些工具扩展了代理的功能,使其能够执行特定操作或访问外部系统。

🌐 The .listTools() method retrieves the tools configured for an agent, resolving them if they're a function. These tools extend the agent's capabilities, allowing it to perform specific actions or access external systems.

使用示例
Direct link to 使用示例

🌐 Usage example

await agent.listTools();

参数
Direct link to 参数

🌐 Parameters

options?:

{ requestContext?: RequestContext }
= {}
Optional configuration object containing request context.

返回
Direct link to 返回

🌐 Returns

tools:

TTools | Promise<TTools>
The tools configured for the agent, either as a direct object or a promise that resolves to the tools.

扩展使用示例
Direct link to 扩展使用示例

🌐 Extended usage example

await agent.listTools({
requestContext: new RequestContext(),
});

选项参数
Direct link to 选项参数

🌐 Options parameters

requestContext?:

RequestContext
= new RequestContext()
Request Context for dependency injection and contextual information.

🌐 Related