Skip to content

Introduce some helpers that perform heuristic matches to detect well known model hosts#6751

Merged
shyamnamboodiripad merged 1 commit intodotnet:mainfrom
shyamnamboodiripad:provider
Aug 28, 2025
Merged

Introduce some helpers that perform heuristic matches to detect well known model hosts#6751
shyamnamboodiripad merged 1 commit intodotnet:mainfrom
shyamnamboodiripad:provider

Conversation

@shyamnamboodiripad
Copy link
Copy Markdown
Contributor

@shyamnamboodiripad shyamnamboodiripad commented Aug 27, 2025

Microsoft Reviewers: Open in CodeFlow

Copilot AI review requested due to automatic review settings August 27, 2025 08:16
@shyamnamboodiripad shyamnamboodiripad requested a review from a team as a code owner August 27, 2025 08:17
@github-actions github-actions bot added the area-ai-eval Microsoft.Extensions.AI.Evaluation and related label Aug 27, 2025

This comment was marked as outdated.

@peterwald
Copy link
Copy Markdown
Member

LGTM, modulo offline comments.

@shyamnamboodiripad shyamnamboodiripad force-pushed the provider branch 3 times, most recently from 61877ad to e1cf2d6 Compare August 28, 2025 00:34
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 ModelInfo utility 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.

@shyamnamboodiripad shyamnamboodiripad force-pushed the provider branch 2 times, most recently from 327471f to ded879f Compare August 28, 2025 00:47
@shyamnamboodiripad shyamnamboodiripad enabled auto-merge (squash) August 28, 2025 02:44
@shyamnamboodiripad shyamnamboodiripad merged commit ec3b31d into dotnet:main Aug 28, 2025
6 checks passed
@shyamnamboodiripad shyamnamboodiripad deleted the provider branch August 28, 2025 06:20
@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ai-eval Microsoft.Extensions.AI.Evaluation and related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants