Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(langchain): pass trace attributes on chain invocation #405

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

hassiebp
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Sep 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
langfuse-js ✅ Ready (Inspect) Visit Preview Sep 25, 2024 1:26pm

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Disclaimer: Experimental PR review

PR Summary

This pull request enhances the Langchain integration with Langfuse by adding functionality to pass trace attributes on chain invocation.

  • Implemented a new traceUpdates map in CallbackHandler to store userId, sessionId, and tags for top-level chain executions
  • Updated handleChainStart method to populate traceUpdates with metadata from chain invocations
  • Modified updateTrace method to use stored attributes when updating traces
  • Added integration tests to verify correct handling of new trace attributes
  • Enhanced test coverage by including assertions for userId, sessionId, and tags in trace updates

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@hassiebp hassiebp merged commit 7628235 into main Sep 25, 2024
9 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-943-langchain-parse-sessionId branch September 25, 2024 16:18
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.

#1918 #1918 #1918 #1918 #1918 #1918 feat: extract Langfuse tags and sessionId from langchain
1 participant