GroqToolItem class
Represents an individual tool that can be registered and used with Groq API.
Each tool consists of a name, description, a list of parameters, and a function that implements the tool's functionality.
- Available extensions
Constructors
-
GroqToolItem({required String functionName, required String functionDescription, required List<
GroqToolParameter> parameters, required dynamic function(Map<String, dynamic> args)}) - Creates a GroqToolItem with a name, description, parameters, and function.
Properties
-
function
→ dynamic Function(Map<
String, dynamic> args) -
The function to be executed. It takes a map of arguments as input and returns a dynamic value.
final
- functionDescription → String
-
A brief description of the function's purpose.
final
- functionName → String
-
The unique name of the function (must be ≤ 64 characters).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
parameters
→ List<
GroqToolParameter> -
A list of parameters required by the function.
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
-
toChatJson(
) → Map< String, dynamic> -
Available on GroqToolItem, provided by the GroqToolUseExtension extension
-
toJson(
) → Map< String, dynamic> -
Available on GroqToolItem, provided by the GroqToolUseExtension extension
-
toString(
) → String -
A string representation of this object.
inherited
-
validateAndGetCallable(
Map< String, dynamic> arguments) → Function -
Validates and returns the registered tool function with the given arguments.
arguments
: A map where keys are parameter names and values are their corresponding arguments. The names must match the parameter names of the function. Example:
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited