FieldCure.AssistStudio.Controls.WinUI.Anthropic
0.2.0-preview.4
dotnet add package FieldCure.AssistStudio.Controls.WinUI.Anthropic --version 0.2.0-preview.4
NuGet\Install-Package FieldCure.AssistStudio.Controls.WinUI.Anthropic -Version 0.2.0-preview.4
<PackageReference Include="FieldCure.AssistStudio.Controls.WinUI.Anthropic" Version="0.2.0-preview.4" />
<PackageVersion Include="FieldCure.AssistStudio.Controls.WinUI.Anthropic" Version="0.2.0-preview.4" />
<PackageReference Include="FieldCure.AssistStudio.Controls.WinUI.Anthropic" />
paket add FieldCure.AssistStudio.Controls.WinUI.Anthropic --version 0.2.0-preview.4
#r "nuget: FieldCure.AssistStudio.Controls.WinUI.Anthropic, 0.2.0-preview.4"
#:package FieldCure.AssistStudio.Controls.WinUI.Anthropic@0.2.0-preview.4
#addin nuget:?package=FieldCure.AssistStudio.Controls.WinUI.Anthropic&version=0.2.0-preview.4&prerelease
#tool nuget:?package=FieldCure.AssistStudio.Controls.WinUI.Anthropic&version=0.2.0-preview.4&prerelease
FieldCure.AssistStudio.Controls.WinUI.Anthropic
WinUI 3 ChatPanel integration for the Anthropic SDK — Stream Claude responses directly into a production-ready chat UI with minimal code.
Features
BeginAnthropicTurn— Creates an assistant message bubble and starts streaming with one call.StreamAnthropicAsync— PipesRawMessageStreamEventinto ChatPanel rendering (text, thinking blocks, usage tracking).GetConversationAsAnthropicMessages— Converts the current conversation to Anthropic SDKMessageParamformat for the next API call.- Automatic lifecycle —
AssistantTurnHandleisIAsyncDisposable. Useawait usingfor guaranteed finalization (message rendering, input restoration).
Scope note. This package is a thin streaming bridge: raw Anthropic SDK events → ChatPanel rendering. Tool-use dispatch, sub-agent
delegate_taskfan-out, parallel pulse placeholders, and truncation-aware recovery are features of ChatPanel's built-in send flow (whenProvideris set directly). When you drive Claude through this adapter withDisableInternalSendFlow="True", those behaviors are the caller's responsibility — you handletool_useblocks and decide whether to retry onstop_reason=max_tokens.
Install
dotnet add package FieldCure.AssistStudio.Controls.WinUI.Anthropic
This transitively brings in FieldCure.AssistStudio.Anthropic (mapper + converter) and FieldCure.AssistStudio.Controls.WinUI (ChatPanel).
Quick Start
XAML:
<controls:ChatPanel x:Name="ChatPanel" DisableInternalSendFlow="True" />
Code-behind:
using FieldCure.AssistStudio.Controls.Anthropic;
var client = new AnthropicClient { ApiKey = "sk-..." };
ChatPanel.UserMessageSubmitted += async (s, e) =>
{
await using var handle = ChatPanel.BeginAnthropicTurn("Claude", "claude-sonnet-4-6");
var conv = ChatPanel.GetConversationAsAnthropicMessages();
var stream = client.Messages.CreateStreaming(new()
{
Model = "claude-sonnet-4-6",
System = conv.SystemPrompt is not null ? new(conv.SystemPrompt) : null,
Messages = conv.Messages,
MaxTokens = 4096,
});
await handle.StreamAnthropicAsync(stream);
};
Dependencies
| Package | Version |
|---|---|
| FieldCure.AssistStudio.Anthropic | >= 0.1.0 |
| FieldCure.AssistStudio.Controls.WinUI | (transitive) |
| Microsoft.WindowsAppSDK | >= 1.7 |
Related Packages
| Package | Description |
|---|---|
| FieldCure.AssistStudio.Anthropic | Platform-agnostic mapper + converter (no WinUI dependency) |
| FieldCure.AssistStudio.Controls.WinUI | The ChatPanel control |
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows10.0.19041 is compatible. net9.0-windows was computed. net10.0-windows was computed. net10.0-windows10.0.19041 is compatible. |
-
net10.0-windows10.0.19041
- FieldCure.AssistStudio.Anthropic (>= 0.2.0-preview.4)
- FieldCure.AssistStudio.Controls.WinUI (>= 0.22.0)
- Microsoft.Windows.SDK.BuildTools (>= 10.0.28000.1839)
- Microsoft.WindowsAppSDK (>= 2.0.1)
-
net8.0-windows10.0.19041
- FieldCure.AssistStudio.Anthropic (>= 0.2.0-preview.4)
- FieldCure.AssistStudio.Controls.WinUI (>= 0.22.0)
- Microsoft.Windows.SDK.BuildTools (>= 10.0.28000.1839)
- Microsoft.WindowsAppSDK (>= 2.0.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.2.0-preview.4 | 56 | 5/25/2026 |
| 0.1.0-preview.3 | 58 | 5/4/2026 |
| 0.1.0-preview.2 | 60 | 4/27/2026 |
| 0.1.0-preview.1 | 61 | 4/21/2026 |
v0.2.0-preview.4: BuildAnthropicParams gains an optional tools list (IList<IAssistTool>? tools) — each tool's ParameterSchema is parsed once and forwarded as the SDK's InputSchema.FromRawUnchecked, so consumers can wire IAssistTool implementations into Anthropic turns without writing the SDK Tool param shape themselves. The companion ChatPanel.AppendToolRoundAsync (in Controls.WinUI 0.22.0) records each multi-round result against the active assistant turn so the SDK-driven flow shows the same inline tool blocks as the internal one. WindowsAppSDK 1.7.* → 2.0.* (floating). Multi-target: net9 dropped (STS EOL 2026-05-12), net10 added — now net8.0-windows + net10.0-windows. Rebuilt against AssistStudio.Anthropic 0.2.0-preview.4, Controls.WinUI 0.22.0 (ChatPanel : IToolContext, AppendToolRoundAsync, pre-init send queue, Plotly inline rendering, ElicitationFieldInfo ns move), Ai.Providers 0.8.0, Core 0.20.0. Canonical reference: in-repo samples/AnthropicSdkSample (now demonstrates 3-tool flow: fetch + schedule_reminder + ask_user).