Skip to content

feat(agents): add initialization_parameters to evaluator YAML config - #9472

Open
Ilya Matiach (imatiach-msft) wants to merge 1 commit into
Azure:mainfrom
imatiach-msft:feat/agents-evaluator-init-params-pr
Open

feat(agents): add initialization_parameters to evaluator YAML config#9472
Ilya Matiach (imatiach-msft) wants to merge 1 commit into
Azure:mainfrom
imatiach-msft:feat/agents-evaluator-init-params-pr

Conversation

@imatiach-msft

Copy link
Copy Markdown
Contributor

Problem

Evaluators that require configuration parameters (e.g. builtin.regex_match which requires patterns) couldn't be fully specified from the optimize YAML config. EvaluatorRef only had name and version.

Change

Add initialization_parameters field to EvaluatorRef (YAML-only, not serialized per-evaluator in the API evaluators array) and wire it through to EvaluatorInitParamsMap as a top-level field in OptimizeRequest.

The C# API already accepts evaluatorInitParamsMap in the request body and stores it in Cosmos. The Python optimizer reads it via cosmos_loader._resolve_evaluator_init_params_map to supply required init params when building testing criteria.

Usage

evaluators:

  • name: builtin.regex_match
    version: 4
    initialization_parameters:
    patterns:
    - (?i)Answer:\s*{{ground_truth}}

Tests

4 new tests: YAML parsing, YAML omission, ToRequest forwarding, ToRequest nil when absent.

Enables evaluators that require configuration (e.g. builtin.regex_match
patterns) to be fully specified in the optimize YAML config.

Add initialization_parameters field to EvaluatorRef (YAML only,
not serialized per-evaluator in the API array) and wire it through to
EvaluatorInitParamsMap in the OptimizeRequest top-level field.
The C# API stores this in Cosmos; the Python optimizer reads it via
cosmos_loader._resolve_evaluator_init_params_map.

Usage:
  evaluators:
    - name: builtin.regex_match
      version: 4
      initialization_parameters:
        patterns:
          - (?i)Answer:\s*GT
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
19 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

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.

2 participants