In the documentation for invoke_agent, the response has this sub key called inputTokens and outputTokens. The said keys are supposed to be part of the trace, hence trace needs to be enabled. I’m not seeing the inputToken and outputToken as part of the event stream when I’m looping over it and print the whole thing. Has anyone faces this issue.
'modelInvocationOutput': {
'metadata': {
'usage': {
'inputTokens': 123,
'outputTokens': 123
}
},
Above metioned is the subdict i’m looking for
The primary problem I was trying to solve is calculate the token for invoke_agent called and estimate the cost. Please tell if there is a better way to do it (calculating the cost for bedrock agent? ).