compass.utilities.costs.compute_total_tokens_from_totals#

compute_total_tokens_from_totals(totals)[source]#

Compute total prompt/response token counts from tracked usage

Parameters:

totals (dict) – Same shape as compute_cost_from_totals(): maps model name to a dict with "prompt_tokens" and "response_tokens".

Returns:

dict{"prompt_tokens": int, "response_tokens": int} summed across all models in totals.