FieldCure.AssistStudio.Anthropic 0.1.0-preview.3

This is a prerelease version of FieldCure.AssistStudio.Anthropic.
dotnet add package FieldCure.AssistStudio.Anthropic --version 0.1.0-preview.3
                    
NuGet\Install-Package FieldCure.AssistStudio.Anthropic -Version 0.1.0-preview.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FieldCure.AssistStudio.Anthropic" Version="0.1.0-preview.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FieldCure.AssistStudio.Anthropic" Version="0.1.0-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="FieldCure.AssistStudio.Anthropic" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FieldCure.AssistStudio.Anthropic --version 0.1.0-preview.3
                    
#r "nuget: FieldCure.AssistStudio.Anthropic, 0.1.0-preview.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FieldCure.AssistStudio.Anthropic@0.1.0-preview.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FieldCure.AssistStudio.Anthropic&version=0.1.0-preview.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FieldCure.AssistStudio.Anthropic&version=0.1.0-preview.3&prerelease
                    
Install as a Cake Tool

FieldCure.AssistStudio.Anthropic

Platform-agnostic Anthropic SDK adapter for the AssistStudio ecosystem. Maps Anthropic streaming events to StreamEvent and converts ChatMessage to SDK MessageParam.

License: MIT

Features

  • AnthropicStreamEventMapper — Stateful, per-stream mapper that converts RawMessageStreamEvent to IAsyncEnumerable<StreamEvent>. Handles text deltas, thinking deltas, usage, truncation, and unknown block types gracefully.
  • AnthropicMessageConverter — Converts ChatMessage lists to Anthropic MessageParam format. Extracts system prompts, handles image/text attachments, and groups messages by role.
  • Platform-agnostic — Targets net8.0 and net9.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)
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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.