countToolUses static method

int countToolUses(
  1. RenderableMessage msg
)

Count the number of tool uses in a message.

Implementation

static int countToolUses(RenderableMessage msg) {
  if (msg.type == 'grouped_tool_use' && msg.messages != null) {
    return msg.messages!.length;
  }
  return 1;
}