PinkRooster.OpenAI.Reasoning
0.4.0-preview.1
dotnet add package PinkRooster.OpenAI.Reasoning --version 0.4.0-preview.1
NuGet\Install-Package PinkRooster.OpenAI.Reasoning -Version 0.4.0-preview.1
<PackageReference Include="PinkRooster.OpenAI.Reasoning" Version="0.4.0-preview.1" />
<PackageVersion Include="PinkRooster.OpenAI.Reasoning" Version="0.4.0-preview.1" />
<PackageReference Include="PinkRooster.OpenAI.Reasoning" />
paket add PinkRooster.OpenAI.Reasoning --version 0.4.0-preview.1
#r "nuget: PinkRooster.OpenAI.Reasoning, 0.4.0-preview.1"
#:package PinkRooster.OpenAI.Reasoning@0.4.0-preview.1
#addin nuget:?package=PinkRooster.OpenAI.Reasoning&version=0.4.0-preview.1&prerelease
#tool nuget:?package=PinkRooster.OpenAI.Reasoning&version=0.4.0-preview.1&prerelease
PinkRooster.OpenAI.Reasoning
Brings back the model's reasoning when you talk to an OpenAI-compatible server through Microsoft.Extensions.AI.OpenAI.
dotnet add package PinkRooster.OpenAI.Reasoning --prerelease
Needs the .NET 10 SDK and an OpenAI-compatible server, such as Ollama with the model pulled (ollama pull gpt-oss:20b for the example below). The package brings Microsoft.Extensions.AI.OpenAI with it.
Ollama and Groq send a reasoning model's thoughts in a reasoning field. The OpenAI adapter reads only reasoning_content, so
the thoughts are dropped. ReasoningFieldChatClient wraps any IChatClient and adds the field back as TextReasoningContent, in
both full and streamed responses. It adds nothing to a response that already carries reasoning, so an adapter that reads the
field itself is not doubled.
using System.ClientModel;
using Microsoft.Extensions.AI;
using OpenAI;
using PinkRooster.OpenAI.Reasoning;
IChatClient chatClient = new ReasoningFieldChatClient(
new OpenAIClient(new ApiKeyCredential("ollama"), new OpenAIClientOptions { Endpoint = new Uri("http://localhost:11434/v1") })
.GetChatClient("gpt-oss:20b")
.AsIChatClient());
Read the reasoning from a response (chatClient is the client above):
using Microsoft.Extensions.AI;
ChatResponse response = await chatClient.GetResponseAsync("A bat and a ball cost $1.10 together. The bat costs $1 more than the ball. What does the ball cost?");
foreach (TextReasoningContent thought in response.Messages.SelectMany(message => message.Contents).OfType<TextReasoningContent>())
{
Console.WriteLine(thought.Text);
}
With PinkRooster.Agents, the reasoning arrives as
ReasoningDelta and ReasoningCompleted events. The package depends only on Microsoft.Extensions.AI.OpenAI.
It reads the SDK's experimental JsonPatch (SCME0001), which is the SDK's only way to read a field it has no property for, so a
new SDK version may need a new release of this package.
Feedback and license
Report a bug or ask a question on GitHub Issues. The package is released under the MIT license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.AI.OpenAI (>= 10.10.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.4.0-preview.1 | 62 | 10/9/2026 |