- DATE:
- AUTHOR:
- The LangChain Team
LangChain
Universal token counting callback for LangChain Python
DATE:
AUTHOR:
The LangChain Team
We've added a new callback/context manager that tracks token usage across all major LangChain chat models, including support for:
Cached tokens
Multi-modal token counting
Works with all major LangChain chat models
Docs: https://python.langchain.com/docs/how_to/chat_token_usage_tracking/#using-callbacks