FunctionTool class

Function tool for calling custom functions.

Allows the assistant to call functions you define to interact with external systems, databases, or APIs.

Implemented types
Annotations
  • @immutable

Constructors

FunctionTool({required String name, String? description, Map<String, dynamic>? parameters, bool? strict})
Creates a FunctionTool.
const
FunctionTool.fromJson(Map<String, dynamic> json)
Creates a FunctionTool from JSON.
factory

Properties

description String?
A description of what the function does.
final
hashCode int
The hash code for this object.
no setteroverride
name String
The name of the function.
final
parameters Map<String, dynamic>?
The JSON schema for the function parameters.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
strict bool?
Whether to enable strict schema adherence.
final

Methods

copyWith({String? name, Object? description = unsetCopyWithValue, Object? parameters = unsetCopyWithValue, Object? strict = unsetCopyWithValue}) FunctionTool
Creates a copy with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts to JSON.
override
toString() String
A string representation of this object.
override

Operators

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