Skip to content

Conversation

@kauabh
Copy link

@kauabh kauabh commented Jan 29, 2026

Change user_content initialization from empty string to None for better clarity. Added condition to skip evaluation when user input is None, as this is required for Evaluation. This closes issue #3760

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

  • Closes: 3760
  • Related: #issue_number

Please describe the tests that you ran to verify your changes. This is required
for all PRs that are not small documentation or typo fixes.

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Please include a summary of passed pytest results.

Manual End-to-End (E2E) Tests:

I created a simple Root agent. Executed this adk web. After one interaction I chnaged "user" role from store database to "model". Without the proposed changes it code was failing as expected while creating evaluation set, after code changes it was running fine.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

Add any other context or screenshots about the feature request here.

Change user_content initialization from empty string to None for better clarity.
Added condition to skip evaluation when user input is None, as this is required for Evaluation
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kauabh, 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 refines the evaluation generation process by improving how absent user input is handled. It changes the default initialization of user_content to None for better semantic representation and introduces a mechanism to bypass evaluation for invocations lacking user input, thereby preventing irrelevant test cases and enhancing the robustness of the evaluation system.

Highlights

  • Improved Clarity for User Content Initialization: The user_content variable is now initialized to None instead of an empty string, providing clearer semantics for cases where user input is absent.
  • Skipping Irrelevant Evaluations: A new condition has been added to skip the generation of evaluation cases when user_content is None, as such cases are generally not useful for testing or grading.
  • Issue Resolution: This change addresses and closes issue Evaluation Invocation.user_content ValidationError when session has invocations without user events #3760, which likely involved scenarios where an empty string for user_content caused unexpected behavior or was semantically incorrect.

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

@kauabh
Copy link
Author

kauabh commented Jan 29, 2026

/gemini

@adk-bot adk-bot added the eval [Component] This issue is related to evaluation label Jan 29, 2026
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 correctly refactors the user_content initialization to use None instead of an empty string, which improves type safety and code clarity. Additionally, it introduces a necessary check to skip evaluation for invocations lacking user input, preventing potential errors and focusing evaluations on meaningful interactions. The changes are sound. My review includes a minor style suggestion to remove an unnecessary whitespace-only line, in accordance with PEP 8.

@gemini-code-assist
Copy link
Contributor

It looks like you might have tried to invoke a command. The available commands are /gemini review, /gemini summary, and /gemini help. If you intended to use one of these, please try again with the correct command. If you were trying to get a general response, please specify your question or request.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@kauabh
Copy link
Author

kauabh commented Jan 29, 2026

/gemini review

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

The pull request updates the initialization of user_content to None for improved clarity and introduces a condition to skip evaluation when user input is absent. This change addresses the stated goal of handling cases without user input for evaluation purposes. A potential improvement has been identified regarding the handling of empty Content objects.

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

Labels

eval [Component] This issue is related to evaluation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evaluation Invocation.user_content ValidationError when session has invocations without user events

2 participants