Skip to content

Conversation

@ahibrahimm
Copy link
Contributor

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings November 5, 2025 13:11
@ahibrahimm ahibrahimm requested a review from a team as a code owner November 5, 2025 13:11
@github-actions github-actions bot added the Evaluation Issues related to the client library for Azure AI Evaluation label Nov 5, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the context validation logic in the GroundednessEvaluator by extracting it into a separate _validate_context method and conditionally applying file search result filtering based on context validity.

  • Extracts context validation logic from _has_context into a reusable _validate_context method
  • Adds conditional filtering: only filters file search results when context is valid

@ahibrahimm ahibrahimm changed the title [Groundedness] handle string response with no context [Groundedness] Handle edge cases Nov 10, 2025
)
self._flow = AsyncPrompty.load(source=self._prompty_file, model=prompty_model_config)
self._flow = AsyncPrompty.load(
source=self._prompty_file, model=prompty_model_config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you add credential and is_reasoning_model to args here?

Copy link
Contributor

@m7md7sien m7md7sien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

else:
return EVALUATION_PASS_FAIL_MAPPING[False]

@override
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for override tag


@override
async def _do_eval(self, eval_input: Dict) -> Dict[str, Union[float, str]]: # type: ignore[override]
async def _do_eval_wflow(self, eval_input: Dict, flow) -> Dict[str, Union[float, str]]: # type: ignore[override]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the comment "# type: ignore[override]" is needed too


@override
async def _do_eval(self, eval_input: Dict) -> Dict[str, Union[float, str]]: # type: ignore[override]
async def _do_eval_wflow(self, eval_input: Dict, flow) -> Dict[str, Union[float, str]]: # type: ignore[override]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: It's better to add type for flow argument. And can you change the name to _with_flow

whatever inputs are needed for the _flow method, including context
and other fields depending on the child class.
:type eval_input: Dict
:return: The evaluation result.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add documentation for flow param

:return: The evaluation result.
:rtype: Dict
"""

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: Remove redundant new line after doc string.

self._prompty_file = None

self._flow_wquery = self._load_flow(self._PROMPTY_FILE_WITH_QUERY, credential=credential)
self._flow_woquery = self._load_flow(self._PROMPTY_FILE_NO_QUERY, credential=credential)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: Can you rename it to with_query and _flow_without_query?

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

Labels

Evaluation Issues related to the client library for Azure AI Evaluation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants