Dependency Injection for AI Components
Register .NET AI clients, tools, prompts, and retrieval services with explicit lifetimes, safe request state, and clear disposal ownership.
Register .NET AI clients, tools, prompts, and retrieval services with explicit lifetimes, safe request state, and clear disposal ownership.
A C# implementation for keeping provider coupling at explicit boundaries while making model capabilities and provider-specific behavior visible.
How to generate text embeddings with Microsoft.Extensions.AI and keep the model, dimensions, comparison metric, and indexing behavior compatible.
How to place model access, prompts, retrieval, tools, and application policy behind a maintainable use-case boundary in a .NET application.
How Microsoft.Extensions.AI keeps provider SDKs at the edge of .NET applications through shared abstractions, dependency injection, and middleware.
Use HybridCache to avoid duplicate AI model calls, with a cached summarization example and deliberate cache-key design.