Skip to content

[Feature Request] Better token tracking mechanism for tools that call agents inside them (Particularly HybridBrowserToolkit.get_som_screenshot) #3220

@boerz-coding

Description

@boerz-coding

Required prerequisites

Motivation

Some tools will call ChatAgent inside themselves. For example, in the current implementation of HybridBrowserToolkit.get_som_screenshot, it calls astep of the original agent, inside the tool (Link). The problem is that when we are counting the token usage of the original ChatAgent.astep that calls this get_som_screenshot tool, we are not able to track the token cost of the inner astep called inside the tool.

Solution

We hope to have a mechanism to track the token usage from the inner astep, while we are only able to access the access the original outer ChatAgent response, as a user of Camel. @Wendong-Fan Said that Camel might need a good way for better tracking token usages in such cases.
cc @nitpicker55555

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

P1Task with middle level priorityenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions