[azure-ai-projects] evaluators.create_version for a code evaluator needs the Evaluations=V1Preview header and allow_preview=True does not add it
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 57/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- azure, python
- Domain
- backend-api-design
Research direction
Start by tracing how client.evaluators.create_version is generated and how preview feature headers are added through azure/ai/projects/models/_patch.py and the beta sub-client proxy. Compare the top-level call with client.beta.evaluators and check the allow_preview documentation. Reproduce with a code evaluator and confirm the expected header behavior; the issue also accepts documenting the requirement.
Written by the indexing model from the issue text.
Description
- Package Name: azure-ai-projects
- Package Version: 2.9.0
- Operating System: Windows 11 and Ubuntu (GitHub-hosted runner), same behavior in both
- Python Version: 3.13
Describe the bug
Creating an evaluator version whose definition type is code with client.evaluators.create_version(...) fails with:
azure.core.exceptions.HttpResponseError: (UserError) This operation requires the following opt-in preview feature(s): Evaluations=V1Preview. Include the 'Foundry-Features: Evaluations=V1Preview' header in your request.
AIProjectClient(..., allow_preview=True) does not change the result. In the installed package, the Foundry-Features value for evaluators is registered in _BETA_OPERATION_FEATURE_HEADERS["evaluators"] (azure/ai/projects/models/_patch.py) and is injected only through the client.beta sub-client proxy. In 2.9.0 client.beta.evaluators has no create_version, and the top-level client.evaluators.create_version does not add the header, with or without allow_preview=True. So no SDK-native path sends the opt-in header for this call.
Creating an evaluator version with a rubric definition through the same client.evaluators.create_version call succeeded without the header in the same project, so the requirement seems to apply to the code definition type.
Passing the header explicitly works:
client.evaluators.create_version(
name=name,
evaluator_version=version,
headers={"Foundry-Features": "Evaluations=V1Preview"},
)
To Reproduce
Steps to reproduce the behavior:
- Create
AIProjectClient(endpoint=..., credential=..., allow_preview=True). - Call
client.evaluators.create_version(name="my-code-evaluator", evaluator_version={...})withcategories=[EvaluatorCategory.QUALITY], adisplay_name, adescriptionand adefinitionoftype=EvaluatorDefinitionType.CODEwithcode_text(a short function that turns one input column into a score),init_parameters,metricsanddata_schema. - The call raises the
HttpResponseErrorabove. - Repeat with
headers={"Foundry-Features": "Evaluations=V1Preview"}: the evaluator is created.
Expected behavior
One of these: allow_preview=True adds the Foundry-Features: Evaluations=V1Preview header to client.evaluators.create_version for definition types that need it, the method adds it by itself like the beta sub-client methods do, or the docstring of create_version and allow_preview states the requirement. The allow_preview docstring currently lists only workflow agents and human evaluation rule actions.
Screenshots
Not applicable.
Additional context
- This regressed for us when moving to 2.9.0 from 2.7.0, where the same call went through
client.beta.evaluators.create_version; the same code evaluator was created successfully before the move. - I can provide more information if needed.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 3.4k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 189
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/azure-sdk-for-python
-
needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Azure/azure-sdk-for-python#50155 · 1 reaction ·
Maintainers usually reply within 1 day
-
[Teams Chatbot]: next-mypy install 404s should point to CFS auth or --pypi workaroundPossibly taken @jianingwang123 claimed this 16 days ago. Openneeds-triage
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
Azure/azure-sdk-for-python#49886 · 1 comment · 2 reactions · 2 assignees ·
Maintainers usually reply within 1 day
-
[AI Projects] AIProjectInstrumentor: non-streamed responses.create raises AttributeError ('NonRecordingSpan' object has no attribute 'attributes') when the span is not sampledPossibly taken @14H034160212 claimed this 19 days ago. OpenAI Projects Client customer-reported question
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Azure/azure-sdk-for-python#49854 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
azure-eventhub migration guide: legacy checkpoint sample writes "None" metadata for partitions that were never checkpointedPossibly taken @hidingmyname claimed this 27 days ago. OpenClient customer-reported Event Hubs needs-team-attention question Service Attention
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Azure/azure-sdk-for-python#49723 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Scheduled test pipelines fail at the Analyze_Test stage due to date formattingPossibly taken A pull request linked to this issue is open or already merged. OpenEngSys
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Azure/azure-sdk-for-python#49614 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
All issues in Azure/azure-sdk-for-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
vllm-project/vllm#70030 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
TigreGotico/tugaphone#408 ·
Maintainers usually reply within 1 day
-
t: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
bug (unverified)
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
scikit-hep/awkward#4581 · 1 comment ·
Maintainers usually reply within 1 day