-
Notifications
You must be signed in to change notification settings - Fork 12
docs: add docs/integration/langfuse.md #31
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
docs: add docs/integration/langfuse.md #31
Conversation
Summary of ChangesHello @helloml0326, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant new documentation section that details the integration of OpenJudge with Langfuse. The primary goal is to empower users to create robust external evaluation pipelines for their LLM applications, offering enhanced flexibility and a wider range of evaluation dimensions. The added content provides practical, code-driven guidance on setting up this integration, from fetching traces to processing evaluations and reporting scores back to Langfuse. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds comprehensive documentation for integrating OpenJudge with Langfuse. The tutorial is well-structured and provides useful code examples for fetching traces, running evaluations with single and multiple graders, and sending scores back to Langfuse.
I've provided a couple of suggestions to improve the consistency and robustness of the Python code snippets in the documentation. Specifically, I've recommended aligning the trace fetching logic and ensuring comments sent to Langfuse are truncated to prevent potential errors.
Overall, this is a great addition to the documentation that will be very helpful for users looking to build external evaluation pipelines.
| result.append({ | ||
| "id": trace.id, | ||
| "input": trace.input, | ||
| "output": trace.output, | ||
| "metadata": trace.metadata or {}, | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with fetch_traces_for_evaluation and to support graders that require an expected output (like CorrectnessGrader), this function should also extract the expected field from the trace metadata if it's available. The batch evaluation example code later relies on this field being present.
| result.append({ | |
| "id": trace.id, | |
| "input": trace.input, | |
| "output": trace.output, | |
| "metadata": trace.metadata or {}, | |
| }) | |
| trace_dict = { | |
| "id": trace.id, | |
| "input": trace.input, | |
| "output": trace.output, | |
| "metadata": trace.metadata or {}, | |
| } | |
| # Add expected output if available in metadata | |
| if trace.metadata and "expected" in trace.metadata: | |
| trace_dict["expected"] = trace.metadata["expected"] | |
| result.append(trace_dict) |
| trace_id=trace["id"], | ||
| name="relevance", | ||
| value=result.score, | ||
| comment=result.reason, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason from a grader can sometimes be very long. To prevent potential API errors, it's a good practice to truncate the comment, similar to how it's handled in the send_result_to_langfuse function. This also makes the examples in the documentation more consistent.
| comment=result.reason, | |
| comment=result.reason[:500] if result.reason else "", |
No description provided.