langfuse-python icon indicating copy to clipboard operation
langfuse-python copied to clipboard

Be able to inject trace_context into LangchainCallbackHandler

Open fhoering opened this issue 4 months ago • 2 comments

[!IMPORTANT] Add trace_context parameter to LangchainCallbackHandler to enable trace context injection for observations.

  • Behavior:
    • Add trace_context parameter to LangchainCallbackHandler constructor for injecting trace context.
    • Use trace_context in on_chain_start() to start observations with context when obs is an instance of Langfuse.
  • Imports:
    • Import TraceContext from langfuse.types.

This description was created by Ellipsis for 5982ac7962e19f36e63d1a52fd0658ff5d978e25. You can customize this summary. It will automatically update as commits are pushed.

fhoering avatar Oct 23 '25 11:10 fhoering

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Oct 23 '25 11:10 CLAassistant

Greptile encountered an error while reviewing this PR. Please reach out to [email protected] for assistance.

greptile-apps[bot] avatar Oct 23 '25 11:10 greptile-apps[bot]

Thanks a lot for your contribution @fhoering - will push this over the line in https://github.com/langfuse/langfuse-python/pull/1458

hassiebp avatar Dec 01 '25 16:12 hassiebp