GroqToolItem constructor

GroqToolItem({
  1. required String functionName,
  2. required String functionDescription,
  3. required List<GroqToolParameter> parameters,
  4. required dynamic function(
    1. Map<String, dynamic> args
    ),
})

Creates a GroqToolItem with a name, description, parameters, and function.

functionName: The name of the function (≤ 64 characters). functionDescription: A description of the function's purpose. parameters: A list of parameters required by the function. function: The function to execute, taking a map of arguments.

Implementation

GroqToolItem({
  required this.functionName,
  required this.functionDescription,
  required this.parameters,
  required this.function,
}) {
  assert(functionName.length <= 64,
      'Function name must be less than or equal to 64 characters');
  assert(parameters.length <= 128,
      'Function parameters must be less than or equal to 128 characters');
}