operator + method

UsageInfo operator +(
  1. UsageInfo other
)

Adds two UsageInfo instances together for token usage accumulation

Implementation

UsageInfo operator +(UsageInfo other) {
  return UsageInfo(
    promptTokens: (promptTokens ?? 0) + (other.promptTokens ?? 0),
    completionTokens: (completionTokens ?? 0) + (other.completionTokens ?? 0),
    totalTokens: (totalTokens ?? 0) + (other.totalTokens ?? 0),
    reasoningTokens: (reasoningTokens ?? 0) + (other.reasoningTokens ?? 0),
  );
}