FunctionTool class
One function the caller can execute, declared to the extractor.
The same shape OpenAI's tools array carries, so a schema written for the
official API works here unchanged.
Constructors
-
FunctionTool({required String name, String description = '', Map<
String, dynamic> parameters = const {'type' : 'object', 'properties' : <String, dynamic>{}}}) -
Creates a declaration.
const
-
FunctionTool.fromJson(Map<
String, dynamic> json) -
Reads a declaration in OpenAI's
toolsshape.factory
Properties
- description → String
-
What it does. The model reads this to decide whether it fits a request,
so it earns its keep — an empty description makes selection worse.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The function's name, as it comes back in a ToolCall.
final
-
parameters
→ Map<
String, dynamic> -
JSON Schema for the 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> - The manifest entry the extractor prompt carries.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited