Introduce some helpers that perform heuristic matches to detect well known model hosts#6751
Merged
shyamnamboodiripad merged 1 commit intodotnet:mainfrom Aug 28, 2025
Merged
Conversation
src/Libraries/Microsoft.Extensions.AI.Evaluation/Utilities/ModelTelemetryUtilities.cs
Outdated
Show resolved
Hide resolved
Member
|
LGTM, modulo offline comments. |
peterwald
approved these changes
Aug 27, 2025
61877ad to
e1cf2d6
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces utility helpers for performing heuristic matches to detect well-known model hosts. The implementation adds a new ModelInfo class that can identify hosting services (like Azure OpenAI, GitHub Models, local instances) based on URI patterns and provides standardized model/provider constants.
Key changes:
- Added
ModelInfoutility class with host detection logic using URI pattern matching - Introduced constants for known models, providers, and host monikers
- Updated chat clients to use the new model provider detection instead of simple metadata lookups
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/Libraries/Microsoft.Extensions.AI.Evaluation/Utilities/ModelInfo.cs |
Core utility class implementing host detection logic and constants |
test/Libraries/Microsoft.Extensions.AI.Evaluation.Tests/ModelInfoTests.cs |
Comprehensive test suite for the ModelInfo functionality |
src/Libraries/Microsoft.Extensions.AI.Evaluation.Safety/ContentSafetyChatClient.cs |
Updated to use ModelInfo constants and improved metadata handling |
src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/CSharp/SimpleChatClient.cs |
Modified to use ModelInfo.GetModelProvider for enhanced provider detection |
src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/CSharp/ResponseCachingChatClient.cs |
Updated to use ModelInfo.GetModelProvider for consistent provider identification |
| Multiple integration test files | Minor reordering of variables and addition of ModelInfo constants |
| Multiple project files | Added ModelInfo.cs as linked compilation unit |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
327471f to
ded879f
Compare
…known model hosts
ded879f to
5654790
Compare
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Microsoft Reviewers: Open in CodeFlow