For the complete documentation index, see llms.txt. This page is also available as Markdown.

LangChain

LangChain integration — emit Stratix traces from LangChain chains.

Wrap your chain with a Stratix callback. See the cookbook recipe.

from layerlens import Stratix
from langchain_core.callbacks import BaseCallbackHandler

client = Stratix()

class StratixCallback(BaseCallbackHandler):
 def on_chain_end(self, outputs, **kwargs):
 client.traces.create(...)

chain.invoke(input, config={"callbacks": [StratixCallback()]})

See also

Last updated

Was this helpful?