LangChain
To integrate our tracing features with LangChain, you simply need to use a callback handler,BaserunCallbackHandler, which you can pass when creating a client object or a chain.
Currently, only our Python SDK supports integration with LangChain.
Tracing a client
If you use theBaserunCallbackHandler you do not need to use @baserun.trace- the handler does it for you.
python
Tracing a chain
To trace a chain, pass in theBaserunCallbackHandler to the callbacks parameter of LLMChain.
python
Tracing an agent
To trace an agent, pass in theBaserunCallbackHandler to the callback_manager parameter of initialize_agent.
python