Skip to content

Conversation

@sebastienros
Copy link
Member

@sebastienros sebastienros commented Oct 17, 2025

Description

  • Add implicit usings to AI model enumerations
  • Improve GitHub model enumeration and use same logic as AI Foundry for generating names

Fixes #11742

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Copilot AI review requested due to automatic review settings October 17, 2025 00:59
@github-actions
Copy link
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12107

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12107"

Copy link
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 improves the GitHub Models and AI Foundry enumerations by refactoring the generation logic to produce consistent PascalCase method names and adding implicit usings for better developer experience.

Key Changes:

  • Updated the GitHubModel enumeration generator to use consistent PascalCase naming conventions
  • Added implicit usings for both GitHub Models and AI Foundry models
  • Refactored obsolete model references to use new naming conventions

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Aspire.Hosting.GitHub.Models/tools/GenModel.cs Replaces ToId method with ToPascalCase using regex patterns for better naming consistency
src/Aspire.Hosting.GitHub.Models/build/Aspire.Hosting.GitHub.Models.props Adds implicit using for GitHubModel with alias
src/Aspire.Hosting.GitHub.Models/GitHubModel.Obsolete.cs Creates obsolete wrapper properties for backward compatibility
src/Aspire.Hosting.GitHub.Models/GitHubModel.Generated.cs Updates generated code with new PascalCase naming and partial classes
src/Aspire.Hosting.Azure.AIFoundry/build/Aspire.Hosting.Azure.AIFoundry.props Adds implicit using for AIFoundryModel with alias
playground/GitHubModelsEndToEnd/GitHubModelsEndToEnd.AppHost/Program.cs Updates reference to use new PascalCase property name
playground/AzureAIFoundryEndToEnd/AzureAIFoundryEndToEnd.AppHost/Program.cs Removes unused variable declaration

{
/// <inheritdoc cref="Jais30bChat"/>
[Obsolete("Use Jais30bChat instead.")]
public static readonly GitHubModel JAIS30bChat = new() { Id = "core42/jais-30b-chat" };
Copy link
Member

Choose a reason for hiding this comment

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

Add [EditorBrowsable(EditorBrowsableState.Never)] to these fields?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, will also do it for foundry.

@sebastienros sebastienros merged commit f8ce715 into main Oct 17, 2025
303 checks passed
@sebastienros sebastienros deleted the sebros/ghmodel branch October 17, 2025 14:22
@dotnet-policy-service dotnet-policy-service bot added this to the 13.0 milestone Oct 17, 2025
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.

GitHubModel enum cannot use implicit using while builder method can

3 participants