Skip to content

Conversation

@shijinpjlab
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @shijinpjlab, 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 substantial update to the Gradio interface, enhancing the flexibility and user-friendliness of configuring evaluation pipelines. It transitions from a rigid set of individual input fields to dynamic gr.Dataframe components for managing data field mappings and LLM evaluator settings. This change aims to provide a more structured and adaptable way for users to define their evaluation parameters, aligning with modern UI/UX principles for complex configurations.

Highlights

  • Gradio Interface Refactoring: The Gradio user interface has undergone a significant overhaul, moving from individual input fields for LLM parameters and data columns to more flexible and dynamic gr.Dataframe components for configuration.
  • Structured Configuration Inputs: The dingo_demo function now accepts structured inputs for fields_data, llm_list, and llm_config_data, replacing the previous disparate parameters like column_id, model, key, and api_url.
  • Dynamic Field Mapping and LLM Configuration: New functions generate_llm_config_dataframe and suggest_fields_dataframe have been introduced to dynamically generate and suggest required field mappings and LLM configurations based on the selected evaluators, enhancing user guidance.
  • Removal of Legacy Prompt/Scene Logic: The concepts of scene_list and prompt_list have been removed, streamlining the evaluation setup process by focusing on rule_list and llm_list.
  • Minor Code Style Adjustments: Small formatting changes were applied to f-strings in llm_rag_context_precision.py and llm_rag_context_recall.py for consistency.
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
Contributor

@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 introduces a significant refactoring of the Gradio application, moving towards a more flexible and scalable configuration model using dataframes for field mappings and evaluator parameters. The changes greatly improve the user interface and the underlying configuration structure.

My review includes a few points for improvement:

  • There is a high-severity issue with silent error handling when parsing JSON parameters, which could hide configuration errors from the user.
  • Several large blocks of commented-out code related to rule configurations should be removed to improve code clarity.
  • The logic for determining required data fields for LLMs is based on string matching, which is fragile. I've suggested a more robust, class-based approach for better maintainability.

Comment on lines +59 to +101
# if rule_config_data is not None and len(rule_config_data) > 0:
# for row in rule_config_data.values.tolist():
# if len(row) >= 6 and row[0]: # Rule name exists
# rule_name = row[0]
# config = {}
#
# # threshold
# if row[1] is not None and str(row[1]).strip():
# try:
# config['threshold'] = float(row[1])
# except:
# pass
#
# # pattern
# if row[2] and str(row[2]).strip():
# config['pattern'] = str(row[2])
#
# # key_list
# if row[3] and str(row[3]).strip():
# try:
# val = str(row[3])
# config['key_list'] = json.loads(val) if val.startswith('[') else [k.strip() for k in val.split(',') if k.strip()]
# except:
# config['key_list'] = [k.strip() for k in str(row[3]).split(',') if k.strip()]
#
# # refer_path
# if row[4] and str(row[4]).strip():
# try:
# val = str(row[4])
# config['refer_path'] = json.loads(val) if val.startswith('[') else [p.strip() for p in val.split(',') if p.strip()]
# except:
# config['refer_path'] = [p.strip() for p in str(row[4]).split(',') if p.strip()]
#
# # parameters
# if row[5] and str(row[5]).strip():
# try:
# config['parameters'] = json.loads(str(row[5]))
# except:
# pass
#
# if config:
# rule_configs[rule_name] = config

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There are several large blocks of commented-out code related to rule_config_data and generate_rule_config_dataframe (e.g., here, and at lines 216-226, 404-414, 453-457). If this functionality is not yet implemented or has been deferred, it would be better to remove the commented-out code to improve readability and reduce clutter. Dead code can be confusing for future maintainers. If this is intended for future work, consider moving it to a separate feature branch or documenting it in an issue tracker.

Comment on lines +301 to +309
for llm_name in llm_list:
# Specify different field requirements based on specific LLM type
if 'VLM' in llm_name or 'Image' in llm_name:
mapping[llm_name] = ['content', 'image']
elif 'Relevant' in llm_name:
mapping[llm_name] = ['prompt', 'content']
else:
mapping[llm_name] = ['content']
return mapping
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The logic for determining required fields for an LLM relies on checking for substrings like 'VLM', 'Image', or 'Relevant' in the LLM's name. This approach is fragile and not easily extensible. If a new model is added that requires specific fields but doesn't have these keywords in its name, this logic will fail to assign the correct fields.

A more robust approach would be to define these requirements as a property of the model class itself. For example, you could add a required_fields class attribute to each LLM model class. This would make the system more modular and easier to maintain.

Example of a more robust approach:

# In the model definition (e.g., dingo/model/llm/vlm_model.py)
class MyVLMModel(BaseLLM):
    required_fields = ['content', 'image']
    ...

# In app_gradio/app.py
def get_llm_column_mapping():
    """Get column mapping required by each LLM from the model class."""
    llm_name_map = Model.get_llm_name_map()
    mapping = {}
    for llm_name, llm_class in llm_name_map.items():
        # Default to ['content'] if not specified
        mapping[llm_name] = getattr(llm_class, 'required_fields', ['content'])
    return mapping

shijinpjlab and others added 5 commits December 19, 2025 10:14
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@shijinpjlab shijinpjlab merged commit 1fb877a into MigoXLab:dev Dec 19, 2025
2 checks 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.

1 participant