gather_usage_summary
autogen.gather_usage_summary #
Gather usage summary from all agents.
PARAMETER | DESCRIPTION |
---|---|
agents | (list): List of agents. |
RETURNS | DESCRIPTION |
---|---|
dictionary | A dictionary containing two keys: - "usage_including_cached_inference": Cost information on the total usage, including the tokens in cached inference. - "usage_excluding_cached_inference": Cost information on the usage of tokens, excluding the tokens in cache. No larger than "usage_including_cached_inference". TYPE: |
Example:
{
"usage_including_cached_inference": {
"total_cost": 0.0006090000000000001,
"gpt-35-turbo": {
"cost": 0.0006090000000000001,
"prompt_tokens": 242,
"completion_tokens": 123,
"total_tokens": 365,
},
},
"usage_excluding_cached_inference": {
"total_cost": 0.0006090000000000001,
"gpt-35-turbo": {
"cost": 0.0006090000000000001,
"prompt_tokens": 242,
"completion_tokens": 123,
"total_tokens": 365,
},
},
}
Note: If none of the agents incurred any cost (not having a client), then the usage_including_cached_inference and usage_excluding_cached_inference will be {'total_cost': 0}
.