Framework Integrations
TokenSense provides native callback handlers for both LangChain and LlamaIndex. Instead of wrapping your LLM client withobserve(), you simply attach the respective TokenSense callback handler to your LLM configuration. This provides full observability into complex agentic workflows, RAG pipelines, and multi-step reasoning chains.
LangChain
ImportTokenSenseCallbackHandler and pass it into the callbacks list when invoking your LangChain models.
LlamaIndex
ImportTokenSenseLlamaIndexCallback and add it to your global CallbackManager before running your query engines or agents.
