trackToolUse method

void trackToolUse({
  1. required String toolName,
  2. required Duration duration,
  3. bool success = true,
  4. String? error,
})

Track tool usage with duration.

Implementation

void trackToolUse({
  required String toolName,
  required Duration duration,
  bool success = true,
  String? error,
}) {
  track(
    TelemetryEvent(
      name: 'tool_use',
      type: TelemetryEventType.toolUse,
      properties: {
        'tool': toolName,
        'durationMs': duration.inMilliseconds,
        'success': success,
        'error': ?error,
      },
    ),
  );
}