recordInvokeAgentToolCalls function

void recordInvokeAgentToolCalls(
  1. String agentName,
  2. int count, {
  3. AdkMetricsRecorder? recorder,
})

Records the number of tool calls made directly within an agent invocation.

Implementation

void recordInvokeAgentToolCalls(
  String agentName,
  int count, {
  AdkMetricsRecorder? recorder,
}) {
  _record(
    recorder,
    AdkMetricRecord(
      name: genAiInvokeAgentToolCallsMetric,
      value: count,
      unit: '{tool_call}',
      description:
          'Tool calls made directly within an agent invocation, excluding sub-agents.',
      attributes: <String, Object?>{
        'gen_ai.operation.name': 'invoke_agent',
        'gen_ai.agent.name': agentName,
      },
      explicitBucketBoundariesAdvisory: callCountBucketBounds,
    ),
  );
}