en un clic
dotnet-microsoft-extensions-ai
// Build provider-agnostic .NET AI integrations with `Microsoft.Extensions.AI`, `IChatClient`, embeddings, middleware, structured output, vector search, and evaluation.
// Build provider-agnostic .NET AI integrations with `Microsoft.Extensions.AI`, `IChatClient`, embeddings, middleware, structured output, vector search, and evaluation.
| name | dotnet-microsoft-extensions-ai |
| version | 1.2.1 |
| category | AI |
| description | Build provider-agnostic .NET AI integrations with `Microsoft.Extensions.AI`, `IChatClient`, embeddings, middleware, structured output, vector search, and evaluation. |
| compatibility | Requires `Microsoft.Extensions.AI` or a .NET AI application that needs model, embedding, tool-calling, or evaluation composition without full agent orchestration. |
.NET code that uses Microsoft.Extensions.AI, Microsoft.Extensions.AI.Abstractions, IChatClient, IEmbeddingGenerator, ChatOptions, or AIFunctionMicrosoft.Extensions.VectorData, Microsoft.Extensions.DataIngestion, MCP tooling, or evaluation packages around a provider-agnostic AI appMicrosoft.Extensions.AI for application and service code that needs provider-agnostic chat, embeddings, middleware, structured output, and testability.Microsoft.Extensions.AI.Abstractions directly only when authoring provider libraries or lower-level reusable integration packages.IChatClient and IEmbeddingGenerator composition explicitly in DI. Keep options, caching, telemetry, logging, and tool invocation inspectable in the pipeline.ConversationId rather than assuming all providers behave the same way.Microsoft.Extensions.VectorData and Microsoft.Extensions.DataIngestion as adjacent building blocks for RAG instead of hand-rolling store abstractions prematurely.dotnet-microsoft-agent-framework when the requirement becomes agent threads, multi-agent orchestration, higher-order workflows, durable execution, or remote agent hosting.flowchart LR
A["Task"] --> B{"Need agent threads, multi-agent orchestration, or remote agent hosting?"}
B -->|Yes| C["Use Microsoft Agent Framework on top of `Microsoft.Extensions.AI.Abstractions`"]
B -->|No| D{"Need provider-agnostic chat, embeddings, tools, typed output, or evaluation?"}
D -->|Yes| E["Use `Microsoft.Extensions.AI`"]
E --> F["Compose `IChatClient` / `IEmbeddingGenerator` in DI"]
F --> G["Add caching, telemetry, tools, vector data, and evaluation deliberately"]
D -->|No| H["Use plain provider SDKs or deterministic .NET code"]
Microsoft.Extensions.AI.Abstractions contains the core exchange contracts such as IChatClient, IEmbeddingGenerator<TInput, TEmbedding>, message/content types, and tool abstractions.Microsoft.Extensions.AI adds the higher-level application surface: middleware builders, automatic function invocation, caching, logging, and OpenTelemetry integration.Microsoft.Extensions.AI; provider and connector libraries usually reference only the abstractions package.IChatClient centers on GetResponseAsync and GetStreamingResponseAsync. The returned ChatResponse or ChatResponseUpdate objects carry messages, tool-related content, metadata, and optional conversation identifiers.ChatOptions is the normal control plane for model ID, temperature, tools, AdditionalProperties, and provider-specific raw options.AIFunction, AIFunctionFactory, and FunctionInvokingChatClient. Ambient data can flow through closures, AdditionalProperties, AIFunctionArguments.Context, or DI.IEmbeddingGenerator is the standard abstraction for semantic search, vector indexing, similarity, and cache-key generation. Pair it with Microsoft.Extensions.VectorData.Abstractions for vector store operations.Microsoft.Extensions.AI.Evaluation.* gives you quality, NLP, safety, caching, and reporting layers for regression checks and CI gates.Microsoft Agent Framework builds on these abstractions. Use it when you need autonomous orchestration, threads, workflows, hosting, or multi-agent collaboration instead of just model composition.| If you need | Default choice | Why |
|---|---|---|
| App-level provider abstraction with middleware | Microsoft.Extensions.AI | Highest leverage for apps and services |
| A reusable provider or connector library | Microsoft.Extensions.AI.Abstractions | Keeps your package at the contract layer |
| Typed chat or UI streaming | IChatClient with GetResponseAsync / GetStreamingResponseAsync | Common request/response shape across providers |
| Tool calling from .NET methods | AIFunction + FunctionInvokingChatClient | Native function metadata and invocation pipeline |
| Typed structured output | IChatClient.GetResponseAsync<T> extensions | Keeps schema intent in code instead of prompt parsing |
| Vector search or RAG | IEmbeddingGenerator + Microsoft.Extensions.VectorData.Abstractions | Standardizes embeddings and store access |
| Evaluation and regression gates | Microsoft.Extensions.AI.Evaluation.* | Relevance, safety, task adherence, caching, reports |
| Agent threads or multi-step autonomous orchestration | dotnet-microsoft-agent-framework | This is beyond plain provider abstraction |
Microsoft.Extensions.AI.Abstractions in an app and then rebuilding middleware, telemetry, or function invocation by hand.IChatClient as if it already gives you durable agent threads, orchestration, or hosted-agent semantics.IChatClient as if they were the same runtime contract.ConversationId flows.Abstractions only vs full Microsoft.Extensions.AIIChatClient / IEmbeddingGenerator composition strategyIChatClient integrationWhen exact wording, edge-case API behavior, or less-common examples matter, check the local official docs snapshot before relying on summaries.
.NET AI docs page plus API-reference pointersIChatClient, embeddings, DI pipelines, tool-calling, and Agent Framework escalation guidanceBuild .NET AI agents and multi-agent workflows with Microsoft Agent Framework using the right agent type, threads, tools, workflows, hosting protocols, and enterprise guardrails.
Build or review distributed .NET applications with Orleans grains, silos, persistence, streaming, reminders, placement, testing, and cloud-native hosting.
Design or refine CI/CD workflows, quality gates, release flow, and safe AI-assisted pipeline authoring. Use when adding or changing build pipelines, release stages, IaC-driven environments, or deployment rollback policy.
Set up or refine solution-level governance for MCAF repositories: root and project-local `AGENTS.md`, rule precedence, solution topology, skill routing, and maintainability-limit policy placement. Use when bootstrapping a repo, restructuring a multi-project solution, or tightening agent rules.
Add or update automated tests for a change using the repository’s verification rules in `AGENTS.md`. Use when implementing a feature, bugfix, refactor, or regression test; prefer stable integration/API/UI coverage and pull deeper test strategy from the bundled references.