-
Notifications
You must be signed in to change notification settings - Fork 841
Fix EquivalenceEvaluator MaxOutputTokens to meet Azure OpenAI minimum requirement #6948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… requirement Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
stephentoub
reviewed
Oct 22, 2025
src/Libraries/Microsoft.Extensions.AI.Evaluation.Quality/EquivalenceEvaluator.cs
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this 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 fixes a validation error in the EquivalenceEvaluator by updating the MaxOutputTokens value from 5 to 16 to comply with Azure OpenAI's minimum token requirement. This prevents a 400 Bad Request error when using the evaluator with Azure OpenAI models.
Key changes:
- Updated MaxOutputTokens from 5 to 16 in EquivalenceEvaluator
- Updated the comment to document the Azure OpenAI minimum requirement
src/Libraries/Microsoft.Extensions.AI.Evaluation.Quality/EquivalenceEvaluator.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix invalid MaxOutputTokens for EquivalenceEvaluator
Fix EquivalenceEvaluator MaxOutputTokens to meet Azure OpenAI minimum requirement
Oct 22, 2025
Copilot finished work on behalf of
stephentoub
October 22, 2025 13:34
…alenceEvaluator.cs
stephentoub
approved these changes
Oct 22, 2025
peterwald
approved these changes
Oct 22, 2025
This was referenced Nov 11, 2025
Merged
Merged
This was referenced Nov 13, 2025
Open
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When using the
EquivalenceEvaluatorwith Azure OpenAI models, users encounter a 400 Bad Request error:The
EquivalenceEvaluatorwas configured withMaxOutputTokens = 5, which is below Azure OpenAI's minimum requirement of 16 tokens for themax_completion_tokensparameter.Solution
Updated
MaxOutputTokensfrom 5 to 16 in theEquivalenceEvaluatorclass to comply with Azure OpenAI's API requirements.Changed file:
src/Libraries/Microsoft.Extensions.AI.Evaluation.Quality/EquivalenceEvaluator.csChange details:
Impact
Fixes #[issue_number]
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
securitytools.pkgs.visualstudio.comIf you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #6945
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Microsoft Reviewers: Open in CodeFlow