#LangchainCallbackHandler custom input/output?

1 messages · Page 1 of 1 (latest)

willow hemlock
#

Is there a way to set/override input/output when using the LangchainCallbackHandler similar to how the @observe() decorator allows updating observation context with custom inputs/outputs?

zinc elkBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

ivory skiff
#

Overriding single observation/span/generation outputs is tricky. You could fetch the trace via the fetch_* methods to then update it.

If you want to change the trace output you could wrap this with the decorator and handle the trace yourself. Details: https://langfuse.com/docs/integrations/langchain/tracing#interoperability

What do you try to achieve here? Maybe I can help in a better way with more context

Open source tracing and monitoring for your LangChain application. Python and JS/TS. Automatically capture rich traces and metrics and evaluate outputs.

zinc elkBOT
#

Thank you for marking this question as solved!

willow hemlock
#

I wanted to explore truncating the input/output to a certain length on certain conditions so we don't persist too much into the DB.