shouldReplaceAgentUsageSnapshot function

bool shouldReplaceAgentUsageSnapshot(
  1. AgentUsageSnapshot? current,
  2. AgentUsageSnapshot next
)

Implementation

bool shouldReplaceAgentUsageSnapshot(AgentUsageSnapshot? current, AgentUsageSnapshot next) {
  if (current != null && current.contextUsedTokens > 0 && next.contextUsedTokens == 0 && next.usage.isEmpty) {
    return false;
  }
  return true;
}