Skip to content

Conversation

@helloml0326
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 Documentation Page: A new documentation page, docs/integrations/langfuse.md, has been added, providing a comprehensive tutorial on integrating OpenJudge with Langfuse.
  • External Evaluation Pipelines: The new tutorial guides users through building external evaluation pipelines for Langfuse, leveraging OpenJudge's capabilities for automated quality evaluation of LLM applications.
  • Step-by-Step Integration Guide: The documentation includes detailed steps and Python code examples for fetching traces from Langfuse, evaluating them using various OpenJudge graders (both single and batch evaluation), and sending the evaluation scores back to Langfuse.
  • Navigation Update: The mkdocs.yml configuration has been updated to include the new Langfuse integration guide under a dedicated 'Integrations' section in the documentation navigation.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines +187 to +192
result.append({
"id": trace.id,
"input": trace.input,
"output": trace.output,
"metadata": trace.metadata or {},
})

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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,

Choose a reason for hiding this comment

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

medium

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.

Suggested change
comment=result.reason,
comment=result.reason[:500] if result.reason else "",

@helloml0326 helloml0326 merged commit 52ceed1 into modelscope:main Jan 6, 2026
1 check passed
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.

2 participants