FieldCure.AssistStudio.Anthropic
0.1.0-preview.3
dotnet add package FieldCure.AssistStudio.Anthropic --version 0.1.0-preview.3
NuGet\Install-Package FieldCure.AssistStudio.Anthropic -Version 0.1.0-preview.3
<PackageReference Include="FieldCure.AssistStudio.Anthropic" Version="0.1.0-preview.3" />
<PackageVersion Include="FieldCure.AssistStudio.Anthropic" Version="0.1.0-preview.3" />
<PackageReference Include="FieldCure.AssistStudio.Anthropic" />
paket add FieldCure.AssistStudio.Anthropic --version 0.1.0-preview.3
#r "nuget: FieldCure.AssistStudio.Anthropic, 0.1.0-preview.3"
#:package FieldCure.AssistStudio.Anthropic@0.1.0-preview.3
#addin nuget:?package=FieldCure.AssistStudio.Anthropic&version=0.1.0-preview.3&prerelease
#tool nuget:?package=FieldCure.AssistStudio.Anthropic&version=0.1.0-preview.3&prerelease
FieldCure.AssistStudio.Anthropic
Platform-agnostic Anthropic SDK adapter for the AssistStudio ecosystem. Maps Anthropic streaming events to StreamEvent and converts ChatMessage to SDK MessageParam.
Features
- AnthropicStreamEventMapper — Stateful, per-stream mapper that converts
RawMessageStreamEventtoIAsyncEnumerable<StreamEvent>. Handles text deltas, thinking deltas, usage, truncation, and unknown block types gracefully. - AnthropicMessageConverter — Converts
ChatMessagelists to AnthropicMessageParamformat. Extracts system prompts, handles image/text attachments, and groups messages by role. - Platform-agnostic — Targets
net8.0andnet9.0. No WinUI, no Windows dependency. Use in console apps, ASP.NET, MAUI, or any .NET host.
Install
dotnet add package FieldCure.AssistStudio.Anthropic
Usage
Stream mapping
using FieldCure.AssistStudio.Anthropic;
var mapper = new AnthropicStreamEventMapper();
var sdkStream = client.Messages.CreateStreaming(params);
await foreach (var evt in mapper.MapAsync(sdkStream))
{
switch (evt)
{
case StreamEvent.TextDelta td:
Console.Write(td.Text);
break;
case StreamEvent.ThinkingDelta tk:
// extended thinking content
break;
case StreamEvent.Usage u:
Console.WriteLine($"Tokens: {u.TokenUsage.TotalTokens}");
break;
case StreamEvent.StreamCompleted sc:
Console.WriteLine(sc.IsTruncated ? "(truncated)" : "(done)");
break;
}
}
Message conversion
var result = AnthropicMessageConverter.Convert(messages);
var response = await client.Messages.Create(new()
{
Model = "claude-sonnet-4-6",
System = result.SystemPrompt is not null
? new(result.SystemPrompt) : null,
Messages = result.Messages,
MaxTokens = 4096,
});
Dependencies
| Package | Version |
|---|---|
| Anthropic | >= 12.13.0 |
| FieldCure.Ai.Providers | (transitive) |
Related Packages
| Package | Description |
|---|---|
| FieldCure.AssistStudio.Controls.WinUI.Anthropic | WinUI 3 ChatPanel integration — extension methods to stream Anthropic responses directly into the chat UI |
| FieldCure.AssistStudio.Controls.WinUI | The ChatPanel control itself |
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Anthropic (>= 12.16.0)
- FieldCure.Ai.Providers (>= 0.7.1)
-
net9.0
- Anthropic (>= 12.16.0)
- FieldCure.Ai.Providers (>= 0.7.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FieldCure.AssistStudio.Anthropic:
| Package | Downloads |
|---|---|
|
FieldCure.AssistStudio.Controls.WinUI.Anthropic
WinUI 3 ChatPanel integration for the Anthropic SDK. Provides extension methods to stream Anthropic responses into ChatPanel. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.3 | 61 | 5/4/2026 |
| 0.1.0-preview.2 | 55 | 4/27/2026 |
| 0.1.0-preview.1 | 52 | 4/21/2026 |
v0.1.0-preview.3: Rebuilt against Ai.Providers 0.7.0 (ProviderPreset → ProviderModel rename) and AssistStudio.Core 0.19.0 (Profile.PreferredModelName). No public API changes. Internal: ConvertAssistantMessage <remarks> documents the thinking-block drop rule (text-only multi-turn vs. tool_use 422) and the deferred signature-round-trip plan.