Skip to content

Add BYO (admin-connected) judge behavioral tests for built-in evaluators - #5240

Merged
shrutiyer merged 2 commits into
mainfrom
shruti/byo-evaluator-behavior-tests
Jul 29, 2026
Merged

Add BYO (admin-connected) judge behavioral tests for built-in evaluators#5240
shrutiyer merged 2 commits into
mainfrom
shruti/byo-evaluator-behavior-tests

Conversation

@shrutiyer

Copy link
Copy Markdown
Contributor

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.

@shrutiyer
shrutiyer requested review from a team as code owners July 28, 2026 21:13
Shruti Iyer and others added 2 commits July 29, 2026 17:50
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
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.

3 participants