feat: Add ignore_args option to tool trajectory evaluation#4795
feat: Add ignore_args option to tool trajectory evaluation#4795abhinavmaddineni wants to merge 2 commits intogoogle:mainfrom
Conversation
Allow bypassing argument matching in trajectory evaluation by setting ignore_args=True on ToolTrajectoryCriterion. Works with all match types (EXACT, IN_ORDER, ANY_ORDER). Closes google#4794
Summary of ChangesHello, 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 enhances the flexibility of tool trajectory evaluation by introducing an option to disregard tool arguments during the matching process. This allows for more lenient comparisons where only the sequence or presence of tool names is relevant, streamlining evaluation for scenarios that do not require strict argument fidelity. 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. Changelog
Activity
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
|
|
When evaluating agent tool trajectories, there are common cases where the exact arguments passed to tools are non-deterministic or simply irrelevant to what you're testing — e.g., generated search queries, timestamps, or complex objects with minor formatting differences. In these scenarios, the current evaluator produces false negatives because it enforces strict argument equality even when you only care that the agent called the right tools in the right sequence. This PR adds an |
There was a problem hiding this comment.
Code Review
This pull request introduces an ignore_args option to the ToolTrajectoryCriterion, allowing for more flexible tool trajectory evaluations by comparing only tool names. The implementation is well-executed across all three match types (EXACT, IN_ORDER, ANY_ORDER), and the logic is sound. The addition of 13 new tests ensures comprehensive coverage for the new functionality. I have one minor suggestion to improve code maintainability by reducing some duplication.
Summary
ignore_argsboolean field toToolTrajectoryCriterion(defaults toFalse)True, trajectory evaluation compares only tool names, skipping argument matchingEXACT,IN_ORDER,ANY_ORDERCloses #4794
Usage
{ "tool_trajectory_avg_score": { "threshold": 0.8, "match_type": "IN_ORDER", "ignore_args": true } }Test plan
ignore_args=Trueacross all match typesscripts/unittests.sh --version 3.12)