Surface a reasoning/thinking model's intermediate thoughts separately from its final answer with the AG-UI .NET SDK — so a client can show the agent "thinking" before it responds, and handle that reasoning trace correctly across turns. USE FOR: distinguishing the model's reasoning trace from its answer on the client by matching TextReasoningContent vs TextContent in each ChatResponseUpdate's Contents; rendering thinking and answer in different ways as they stream; deciding whether to carry the reasoning text into later turns (whether to append/resend the model's reasoning back into conversation history). DO NOT USE FOR: plain text streaming with no reasoning display (use agui-dotnet-streaming-chat); tools, shared state, interrupts, multimodal, generative UI, or protobuf.
75
92%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
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.34c3e0c
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.