Skip to content

Design DI extension methods for AI service registration #32544

@mattleibow

Description

@mattleibow

Description

Design IServiceCollection extension methods that enable easy registration of AI services in .NET MAUI applications with dependency injection.

Goals

  • Make it trivial to add AI to a MAUI app (1-2 lines in MauiProgram.cs)
  • Support progressive disclosure (simple by default, powerful when needed)
  • Follow .NET DI conventions
  • Enable platform-agnostic code while allowing platform-specific overrides

Design Proposal

Proposal PR can be found here: #32545

Discussion Points

  1. Which API style should we use?
  2. Should platform detection be compile-time or runtime?
  3. Should we expose platform-specific methods (e.g., AddAppleIntelligenceChatClient())?
  4. How should we structure configuration options?
  5. What service lifetime should be used (Singleton recommended)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions