From fd463f36dffd56c0c1eb2a4bc04a57b5c2f458cc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 17:57:47 +0000 Subject: [PATCH 1/3] Initial plan From 8872c92a0fbc54eb575287db9f56ffdbd70c8da5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 18:10:45 +0000 Subject: [PATCH 2/3] Set default value for image_tag parameter to "2025-05-08" Co-authored-by: nagkumar91 <4727422+nagkumar91@users.noreply.github.com> --- .../ai/evaluation/_aoai/python_grader.py | 2 +- .../unittests/test_aoai_python_grader.py | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_aoai/python_grader.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_aoai/python_grader.py index ccc1d87fb639..208bc08f329c 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_aoai/python_grader.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_aoai/python_grader.py @@ -63,7 +63,7 @@ def __init__( name: str, pass_threshold: float, source: str, - image_tag: Optional[str] = None, + image_tag: Optional[str] = "2025-05-08", credential: Optional[TokenCredential] = None, **kwargs: Any, ): diff --git a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_aoai_python_grader.py b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_aoai_python_grader.py index 48e69a0ac14f..ad5aeded70a5 100644 --- a/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_aoai_python_grader.py +++ b/sdk/evaluation/azure-ai-evaluation/tests/unittests/test_aoai_python_grader.py @@ -52,3 +52,28 @@ def test_invalid_pass_threshold(self): pass_threshold=1.5, source=source_code, ) + + def test_default_image_tag(self): + """Test that image_tag has a default value of '2025-05-08'.""" + model_config = AzureOpenAIModelConfiguration( + azure_endpoint="https://test.openai.azure.com", + api_key="test-key", + azure_deployment="test-deployment", + ) + + source_code = """ +def grade(sample: dict, item: dict) -> float: + return 1.0 +""" + + # Create grader without specifying image_tag + grader = AzureOpenAIPythonGrader( + model_config=model_config, + name="python_test", + pass_threshold=0.5, + source=source_code, + ) + + # Verify the grader was created successfully + assert grader.pass_threshold == 0.5 + assert grader.id == "azureai://built-in/evaluators/azure-openai/python_grader" From b9cdf34b987ab33b073552c2e7d07ef726f800d1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 18:12:31 +0000 Subject: [PATCH 3/3] Update docstring to reflect default value for image_tag Co-authored-by: nagkumar91 <4727422+nagkumar91@users.noreply.github.com> --- .../azure/ai/evaluation/_aoai/python_grader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_aoai/python_grader.py b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_aoai/python_grader.py index 208bc08f329c..f5884a7ec2a8 100644 --- a/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_aoai/python_grader.py +++ b/sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_aoai/python_grader.py @@ -30,8 +30,8 @@ class AzureOpenAIPythonGrader(AzureOpenAIGrader): ~azure.ai.evaluation.OpenAIModelConfiguration] :param name: The name of the grader. :type name: str - :param image_tag: The image tag for the Python execution environment. - :type image_tag: str + :param image_tag: The image tag for the Python execution environment. Defaults to "2025-05-08". + :type image_tag: Optional[str] :param pass_threshold: Score threshold for pass/fail classification. Scores >= threshold are considered passing. :type pass_threshold: float :param source: Python source code containing the grade function.