AgentTool class

A tool that can be used by the agent.

工具的核心类型,包含元数据(name、description、parameters)和执行逻辑(execute)。 由各工具类(ReadTool、WriteTool 等)的 create() 方法返回,直接供 AgentLoop 使用。

Constructors

AgentTool({required String name, required String description, required String label, Map<String, dynamic> parameters = const {}, ToolExecMode executionMode = ToolExecMode.parallel, ToolCategory category = ToolCategory.commandExec, List<String> pathParams = const [], required Future<ToolResult> execute(Map<String, dynamic> params)})
const

Properties

category ToolCategory
final
description String
final
execute Future<ToolResult> Function(Map<String, dynamic> params)
final
executionMode ToolExecMode
final
hashCode int
The hash code for this object.
no setterinherited
label String
final
name String
final
parameters Map<String, dynamic>
final
pathParams List<String>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited