[Agentic Evaluators]: Accept input string as is#45159
Open
[Agentic Evaluators]: Accept input string as is#45159
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates several agentic evaluators to accept plain string inputs (for query, response, tool_calls, and/or tool_definitions) and forward them to the LLM without attempting structured parsing/reformatting/cross-validation intended for message-list inputs.
Changes:
- Allow
tool_calls/tool_definitions/responseto be passed through as strings across multiple tool-related evaluators. - Skip tool-definition filtering and conversation/response reformatting when inputs are already strings (notably in Tool Output Utilization).
- Add a groundedness short-circuit for string
responseinputs in agent-response mode.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_tool_selection/_tool_selection.py | Accept string tool calls/definitions; skip extraction/validation steps when strings are provided. |
| sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_tool_output_utilization/_tool_output_utilization.py | Conditionally skip filtering/reformatting when query/response/tool_definitions are strings. |
| sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_tool_input_accuracy/_tool_input_accuracy.py | Allow response/tool calls to pass through as strings and bypass structured cross-validation. |
| sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_tool_call_success/_tool_call_success.py | Avoid tool-call/result reformatting when response is a string; pass string tool definitions through. |
| sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_tool_call_accuracy/_tool_call_accuracy.py | Allow string tool calls/definitions; bypass structured cross-validation. |
| sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_groundedness/_groundedness.py | Add early return for string response in agent-response mode to avoid context extraction/parsing. |
Comments suppressed due to low confidence (1)
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_tool_selection/_tool_selection.py:180
tool_namescan now be astr(whentool_callsis a string), but the name and the inline comment imply it’s a list of tool names. This is easy to misread later; consider renaming the variable / clarifying the comment to reflect that it may be a raw string forwarded to the LLM.
# Extract only tool names from tool calls, removing parameters and results (skip for strings)
tool_names = tool_calls if isinstance(tool_calls, str) else self._extract_tool_names_from_calls(tool_calls)
return {
"query": query,
"tool_calls": tool_names, # Only tool names, no parameters
"tool_definitions": needed_tool_definitions,
...ure-ai-evaluation/azure/ai/evaluation/_evaluators/_tool_call_accuracy/_tool_call_accuracy.py
Show resolved
Hide resolved
...valuation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_groundedness/_groundedness.py
Show resolved
Hide resolved
...ure-ai-evaluation/azure/ai/evaluation/_evaluators/_tool_call_accuracy/_tool_call_accuracy.py
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Updates agentic evaluators to accept string inputs directly without requiring structured (list/dict) format. When response, query, tool_calls, or tool_definitions are passed as plain strings, evaluators now forward them to the LLM as-is, skipping parsing, reformatting, and cross-validation steps that only apply to structured conversation objects.
Changed evaluators:
Groundedness, Tool Call Accuracy, Tool Call Success, Tool Input Accuracy, Tool Output Utilization, and Tool Selection.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines