[azure-ai-projects] evaluators.create_version for a code evaluator needs the Evaluations=V1Preview header and allow_preview=True does not add it

Abierto
#49,925 2 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
57/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
azure, python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

AI Projects Client customer-reported needs-team-attention question Service Attention
  • 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:

  1. Create AIProjectClient(endpoint=..., credential=..., allow_preview=True).
  2. Call client.evaluators.create_version(name="my-code-evaluator", evaluator_version={...}) with categories=[EvaluatorCategory.QUALITY], a display_name, a description and a definition of type=EvaluatorDefinitionType.CODE with code_text (a short function that turns one input column into a score), init_parameters, metrics and data_schema.
  3. The call raises the HttpResponseError above.
  4. 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.
Lenguaje dominante
Python
Estrellas
5.6k
Forks
3.4k
Merge medio
1 d 22 h
PR fusionados (30 d)
189

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/azure-sdk-for-python

Todos los issues de Azure/azure-sdk-for-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.