langchain-ai / langchain-aws

Build LangChain Applications on AWS
MIT License
63 stars 47 forks source link

Token Counts not used from Bedrock response. #41

Closed NAPTlME closed 1 month ago

NAPTlME commented 2 months ago

I would like to track the token counts (input/output) for my Bedrock calls in a similar fashion to this example for langchain-openai using callbacks.

These token counts are present in the header (or chunk data for streaming), but they are not captured by langchain-aws.

This PR addresses this issue.

Thanks.

3coins commented 1 month ago

Fixed in v0.1.5.