toolCalls property

List<ChatToolCall> get toolCalls

All tool calls requested in this choice.

Implementation

List<ChatToolCall> get toolCalls {
  final calls = message?['tool_calls'];
  if (calls is! List) return const [];
  return calls
      .whereType<Map>()
      .map(ChatToolCall.fromOpenAI)
      .where((call) => call.name.isNotEmpty)
      .toList();
}