From ag-ui-dotnet
Distinguishes and renders reasoning model's intermediate thoughts from final answer using AG-UI .NET SDK by inspecting TextReasoningContent vs TextContent in ChatResponseUpdate stream.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ag-ui-dotnet:agui-dotnet-reasoningThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Goal: show a reasoning model's intermediate thoughts as they stream, kept visually separate from the final answer.
Goal: show a reasoning model's intermediate thoughts as they stream, kept visually separate from the final answer.
A reasoning model emits two kinds of text in the stream: its thinking and its answer. In Microsoft.Extensions.AI these arrive as different content types on each ChatResponseUpdate — TextReasoningContent for the thoughts, TextContent for the answer. update.Text only concatenates the answer parts, so to display thinking you inspect update.Contents.
Iterate update.Contents and branch on the content type instead of reading update.Text:
using Microsoft.Extensions.AI;
var messages = new List<ChatMessage>
{
new(ChatRole.User, "20 heads, 56 legs — how many chickens and rabbits? Show your reasoning."),
};
await foreach (var update in client.GetStreamingResponseAsync(messages))
{
foreach (var content in update.Contents)
{
switch (content)
{
case TextReasoningContent { Text: { Length: > 0 } thinking }:
RenderThinking(thinking); // e.g. a dimmed/collapsible panel
break;
case TextContent { Text: { Length: > 0 } answer }:
RenderAnswer(answer); // the user-facing reply
break;
}
}
}
Both stream incrementally and can interleave: thinking deltas arrive, then answer deltas. Render each as it comes rather than buffering, so the "thinking…" state is visible before the answer lands.
TextReasoningContent into the next request's messages bloats the prompt, and some providers reject prior reasoning as input. Carry forward only the assistant's answer.TextReasoningContent updates before the final TextContent answer.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.
Real-time and streaming text generation via Together AI's OpenAI-compatible chat/completions API, including multi-turn conversations, tool calling, structured JSON outputs, and reasoning models.
Implements the AG-UI protocol for agent-to-frontend communication via SSE events. Covers event types, state sync, tool calls, and human-in-the-loop flows for custom agent backends.