Token counting in AgentWorkflows #18493
Replies: 1 comment 3 replies
-
To implement a Here's a general approach you can take:
By using the For more details on the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
What is the best way of implementing a TokenCounter for an
AgentWorkflow
. My idea was to add a token counter to each agent and try to sum the counts in the end but that doesn't seem possible when I'm not the one calling the agent - the Workflow is.It is also not possible to add
TokenCountingHandler
to theAgentWorkflow
.If anyone implemented this already, feel free to share your solution :)
Beta Was this translation helpful? Give feedback.
All reactions