Tool class base

A tool the model may invoke, with a JSON Schema for its parameters.

Ported from pi's Tool. pi carries a TypeBox schema; here parameters is the equivalent plain JSON Schema map. Declared base (rather than final) so the agent layer's AgentTool can extend it, mirroring pi's interface AgentTool extends Tool.

Implementers

Constructors

Tool({required String name, required String description, required Map<String, dynamic> parameters})
const
Tool.fromJson(Map<String, dynamic> json)
Deserializes from a JSON map produced by toJson.
factory

Properties

description String
Human- and model-readable description of what the tool does.
final
hashCode int
The hash code for this object.
no setterinherited
name String
The tool's name (what the model calls).
final
parameters Map<String, dynamic>
JSON Schema for the tool's arguments.
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
toJson() Map<String, dynamic>
Serializes to a JSON map.
toString() String
A string representation of this object.
inherited

Operators

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