From ag-ui-dotnet
Attaches images, audio, PDFs, and other binary content to AG-UI chat messages for multimodal models using DataContent or UriContent.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ag-ui-dotnet:agui-dotnet-multimodalThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Goal: include an image (or other binary content) in a turn so a multimodal model can describe or reason about it.
Goal: include an image (or other binary content) in a turn so a multimodal model can describe or reason about it.
A multimodal message is an ordinary Microsoft.Extensions.AI ChatMessage whose Contents mixes a TextContent with one or more binary parts. AGUIChatClient carries those parts across the AG-UI wire; the server streams the model's reply as usual.
dotnet add package AGUI.Client
Microsoft.Extensions.AI supplies ChatMessage, TextContent, DataContent, and UriContent.
Use DataContent(bytes, mediaType) to embed the data directly in the message:
using AGUI.Client;
using Microsoft.Extensions.AI;
byte[] imageBytes = await File.ReadAllBytesAsync("photo.png");
var messages = new List<ChatMessage>
{
new(ChatRole.User,
[
new TextContent("Describe this image"),
new DataContent(imageBytes, "image/png"),
]),
};
await foreach (var update in client.GetStreamingResponseAsync(messages))
{
Console.Write(update.Text);
}
The media type must match the bytes (image/png, image/jpeg, audio/wav, application/pdf, …) so the model decodes them correctly.
When the asset already lives at a URL, use UriContent(uri, mediaType) instead — the bytes never pass through your process:
new ChatMessage(ChatRole.User,
[
new TextContent("What's in this picture?"),
new UriContent("https://example.com/cat.jpg", "image/jpeg"),
]);
Prefer UriContent to reference an asset already hosted at a URL; use DataContent for local bytes the model host can't reach by URL.
DataContent. Inline binary is base64-encoded into the request, inflating it ~33% and forcing the whole payload through memory on both ends. For anything sizable that is reachable by URL, send UriContent and let the model host fetch it.IChatClient at a vision-capable model/deployment.npx claudepluginhub ag-ui-protocol/ag-ui --plugin ag-ui-dotnetBootstraps an AG-UI .NET streaming-chat client and server. Installs NuGet packages, configures AGUIChatClient or a hosted endpoint, and runs multi-turn conversations with stateless or session-persisted agents.
Creates and manages persistent AI agents in .NET using Azure SDK for threads, messages, runs, tools, function calling, file search, and code interpreter.
Low-level .NET SDK for creating and managing persistent Azure AI agents with threads, messages, runs, and tools.