groqToolItemFromChatJson static method
Implementation
static GroqToolItem groqToolItemFromChatJson(Map<String, dynamic> json,
Function(Map<String, dynamic>) Function(String) functionNameToFunction) {
return GroqToolItem(
function: functionNameToFunction(json['functionName'] as String),
functionName: json['functionName'] as String,
functionDescription: json['functionDescription'] as String,
parameters: (json['parameters'] as List)
.map((item) => GroqToolParameter(
parameterName: item['name'] as String,
parameterDescription: item['description'] as String,
parameterType:
groqToolParameterTypeFromString(item['type'] as String),
isRequired: item['isRequired'] as bool,
allowedValues: item['allowedValues'] as List<String>,
))
.toList(),
);
}