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
As a Strands Agent SDK user I'd like to have usage statistic for current execution loop via event.agent.event_loop_metrics.latest_agent_invocation property.
But according to the current implementation, the hook is invoked before the statistic is updated:
hook invocation:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
As a Strands Agent SDK user I'd like to have usage statistic for current execution loop via
event.agent.event_loop_metrics.latest_agent_invocationproperty.But according to the current implementation, the hook is invoked before the statistic is updated:
hook invocation:
sdk-python/src/strands/event_loop/event_loop.py
Lines 346 to 355 in e7d3eb9
usage update:
sdk-python/src/strands/event_loop/event_loop.py
Lines 412 to 414 in e7d3eb9
Question
Is there a way to access used tokens count of the current loop from the callback?
Beta Was this translation helpful? Give feedback.
All reactions