Skip to content

Microsoft.Extensions.AI (MEAI) Overview

All tryAGI SDKs with MEAI support use Microsoft.Extensions.AI.Abstractions 10.4.0.

Quick reference

SDK IChatClient IEmbeddingGenerator ISpeechToTextClient AIFunction Namespace Conflict
Anthropic Y - - - No
Ollama Y Y - - No
OpenAI Y Y - - Yes
Google.Gemini Y Y - - No
Mistral Y - - - Yes
Cohere Y Y - - Yes
Together Y Y - - Yes
AI21 Y - - - No
Reka Y - Y - Yes
HuggingFace Y Y - - No
Jina - Y - - No
VoyageAI - Y - - No
ElevenLabs - - Y - No
AssemblyAI - - Y - No
Tavily - - - Y No

Additionally, 19 OpenAI-compatible providers get MEAI support via CustomProviders in tryAGI.OpenAI.

Interfaces

Interface Purpose Guide
IChatClient Chat completions — text, streaming, tool calling, images Chat Client
IEmbeddingGenerator<string, Embedding<float>> Text embeddings Embedding Generator
ISpeechToTextClient Speech-to-text transcription Speech to Text
AIFunction Tool/function wrappers for use with any IChatClient Tavily docs

Implementation pattern

MEAI implementations are hand-written partial classes in each SDK, located outside the Generated/ directory:

1
2
3
4
src/libs/{SdkName}/Extensions/
  {ClientName}.ChatClient.cs          # IChatClient
  {ClientName}.EmbeddingGenerator.cs  # IEmbeddingGenerator
  {ClientName}.SpeechToTextClient.cs  # ISpeechToTextClient

The reference implementation is AnthropicClient.ChatClient.cs.