You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
For cost/usage tracking it would be nice to be able to get the used input and output token count or even actual API usage expense.
Is this not possible with the current options.
It appears it may be possible to hook into the Monitor to get the token usage data or wrap it into the agent's run.
Describe alternatives you've considered
I looked into modifying the MultStepAgent.run function to bring in the token counts from the monitor.
ifstream:
# The steps are returned as they are executed through a generator to iterate on.returnself._run(task=self.task, images=images)
# Outputs are returned only at the end as a string. We only look at the last stepfinal_step=deque(self._run(task=self.task, images=images), maxlen=1)[0]
ifinclude_tokensandfinal_step.final_answerisnotNone:
token_counts=self.monitor.get_total_token_counts()
return {
"answer": final_step.final_answer,
"token_counts": token_counts
}
returnfinal_step
Additional context
Being able to get usage/cost data from API calls would help from a business perspective to track cost of execution and aid in iterating on agents to lower costs.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
For cost/usage tracking it would be nice to be able to get the used input and output token count or even actual API usage expense.
Is this not possible with the current options.
It appears it may be possible to hook into the Monitor to get the token usage data or wrap it into the agent's run.
Describe alternatives you've considered
I looked into modifying the MultStepAgent.run function to bring in the token counts from the monitor.
Additional context
Being able to get usage/cost data from API calls would help from a business perspective to track cost of execution and aid in iterating on agents to lower costs.
The text was updated successfully, but these errors were encountered: