Skip to content

Conversation

@scezen
Copy link
Member

@scezen scezen commented Dec 2, 2025

Ticket : DERCBOT-1746

Details

  • Migrated from deprecated langfuse.callback API to the new langfuse.langchain module.
  • Updated the LangfuseCallbackHandlerFactory to align with the new Langfuse V3 client.
  • Added internal caching for the Langfuse client to avoid repeated initializations.
  • Updated the observability service to use the new get_client() API and revised trace extraction logic.
  • Adjusted the RAG chain execution to pass metadata (user, session, tags) using the new supported mechanism.
  • Cleaned up unused parameters and removed unsupported kwargs that Langfuse no longer handles.

@scezen scezen marked this pull request as ready for review December 2, 2025 10:19
Copy link
Member

@Benvii Benvii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks small issue in get_observability_info.

list(kwargs.keys()),
)

return LangfuseCallbackHandler(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return LangfuseCallbackHandler(
# Langfuse SDK maintains an internal map / pool of clients based on there public key, that why the client isn't passed to the callbackhandler constructor.
return LangfuseCallbackHandler(

if trace_id is None:
return None

langfuse_client = get_client()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you are getting the right client here ?
You should be using the client public key to be sure at least.
You can access the client using observability_handler.client I think it's the easiest way.

This could lead to rights access errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants