Add BYO (admin-connected) judge behavioral tests for built-in evaluators - #5240
Merged
Conversation
m7md7sien
reviewed
Jul 29, 2026
m7md7sien
approved these changes
Jul 29, 2026
posaninagendra
approved these changes
Jul 29, 2026
posaninagendra
approved these changes
Jul 29, 2026
The built-in prompty judges are thin pass-throughs over azure-ai-evaluation; all admin-connected (BYO) routing lives in the SDK. These tests guard the asset's contract so a future asset change can't silently break BYO for the built-in evaluators: - TestIsByoModelConfigContract: the BYO-detection contract the evaluators rely on (both byo_model + project_endpoint markers required, as non-empty strings). - TestByoConfigForwarding: each shipped judge (coherence/relevance/fluency/groundedness) accepts a BYO config and forwards it intact so the SDK detects it as BYO (and omits azure_endpoint/azure_deployment). - TestByoRoutingEndToEnd: with the network mocked, a judge call routes through the BYO project-Responses client (AsyncByoProjectResponsesClient) built from the connection/ deployment + project endpoint, and the mocked judge output parses to a passing score. 18 tests, all passing on azure-ai-evaluation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b11202e6-6a52-4777-bed1-9c48730a63c3
The standalone test_byo_judge_behavior.py is not referenced by any evaluator's asset.yaml (each evaluator runs only its own test_<name>_evaluator_behavior.py), so the BYO tests never ran when an evaluator's code changed. Extract the per-evaluator BYO guard into ByoJudgeBehaviorMixin (byo_judge_behavior_mixin.py) and mix it into BaseEvaluatorBehaviorTest, which every built-in prompty evaluator's behavior suite already inherits. Now est_accepts_and_forwards_byo_model_config runs against each prompty evaluator's own class whenever that evaluator's code is touched, guarding that the evaluator accepts an admin-connected (BYO) model_config and forwards it so the SDK detects it as BYO. The guard is input-independent (construct + inspect the forwarded flow configuration), so it works uniformly across evaluators. test_byo_judge_behavior.py keeps the two cross-cutting guards that are not per-evaluator: the SDK BYO-detection contract, and an end-to-end judge call routed through the project-Responses client (network mocked) over a representative set of core judges. Its now-redundant 4-judge forwarding class is removed and its shared helpers move to the mixin module. Verified: the forwarding guard passes for all 8 prompty evaluators that inherit BaseEvaluatorBehaviorTest (coherence, customer_satisfaction, deflection_rate, fluency, groundedness, quality_grader, relevance, tool_output_utilization); full coherence behavior suite 146 passed; pydocstyle clean. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b11202e6-6a52-4777-bed1-9c48730a63c3
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.
The built-in prompty judges are thin pass-throughs over azure-ai-evaluation; all admin-connected (BYO) routing lives in the SDK. These tests guard the asset's contract so a future asset change can't silently break BYO for the built-in evaluators: