FieldCure.Ai.Providers 0.7.2

dotnet add package FieldCure.Ai.Providers --version 0.7.2
                    
NuGet\Install-Package FieldCure.Ai.Providers -Version 0.7.2
                    
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.Ai.Providers" Version="0.7.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FieldCure.Ai.Providers" Version="0.7.2" />
                    
Directory.Packages.props
<PackageReference Include="FieldCure.Ai.Providers" />
                    
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.Ai.Providers --version 0.7.2
                    
#r "nuget: FieldCure.Ai.Providers, 0.7.2"
                    
#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.Ai.Providers@0.7.2
                    
#: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.Ai.Providers&version=0.7.2
                    
Install as a Cake Addin
#tool nuget:?package=FieldCure.Ai.Providers&version=0.7.2
                    
Install as a Cake Tool

FieldCure.Ai.Providers

AI provider clients for Claude, OpenAI, Gemini, Ollama, and Groq with shared models and streaming support.

Providers

Provider Transport Streaming
Claude (Anthropic) HTTP SSE
OpenAI / Groq HTTP SSE
Gemini (Google) HTTP SSE
Ollama HTTP NDJSON
Custom (OpenAI-compatible) HTTP SSE
Mock In-memory Sync

Quick Start

using FieldCure.Ai.Providers.Models;
using FieldCure.Ai.Providers;

var model = new ProviderModel
{
    ProviderType = "Claude",
    ApiKey = "sk-...",
    ModelId = "claude-sonnet-4-6",
};

var provider = ProviderFactory.Create(model);

var request = new AiRequest
{
    Messages = [new ChatMessage(ChatRole.User, "Hello!")],
};

var response = await provider.CompleteAsync(request);
Console.WriteLine(response.Content);

Features

  • Custom Providers — Register any OpenAI-compatible endpoint via ProviderFactory.RegisterCustomProvider with CustomProviderConfig (BaseUrl, DisplayName).
  • Image CompressionImageCompressor automatically compresses and resizes large images (JPEG, via SkiaSharp) before sending to providers, reducing token usage and API costs.
  • Multimedia Tool ResultsIMultiContentTool interface for tools returning structured multimedia content (images, audio, video) alongside text via ToolExecutionResult.
  • Media PersistenceChatMessage.MediaItems stores media attachments with conversation messages for save/load in .astx files.
  • Thinking / Reasoning — Structured reasoning_details parsing, <think> tag streaming extraction via ThinkTagParser, and Ollama native thinking field support.

Models

Core models

  • ChatMessage, ChatRole — conversation messages (with MediaItems for media persistence)
  • AiRequest, AiResponse — LLM request/response
  • AiResponse.IsTruncatedtrue when the provider stopped because it hit the max_tokens cap (Claude stop_reason=max_tokens, OpenAI finish_reason=length, Gemini MAX_TOKENS, Ollama done_reason=length). Consumers should treat the response as incomplete rather than a graceful completion.
  • ProviderModel — provider configuration (renamed from ProviderPreset in v0.7.0)
  • CustomProviderConfig — custom OpenAI-compatible provider registration (Id, DisplayName, BaseUrl)

Tool calling

  • ToolCall, IAssistTool — function calling interface with optional confirmation
  • IMultiContentTool — tools returning multimedia content alongside text
  • ToolExecutionResult — combined text + media content return type

Media

  • MediaContent — typed media payload (MimeType, Base64Data, FileName)
  • ImageCompressor — JPEG compression and resize helper (via SkiaSharp)

Streaming

  • StreamEvent — discriminated union: TextDelta, ThinkingDelta, ToolCallStart, ToolCallDelta, Usage, StreamCompleted

Adapters

  • McpToolAdapter — bridges MCP tools to IAssistTool with multimedia content block support

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 was computed.  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 (3)

Showing the top 3 NuGet packages that depend on FieldCure.Ai.Providers:

Package Downloads
FieldCure.AssistStudio.Core

App-level helpers and models for AssistStudio — MCP server management, tool orchestration, workspace context, and conversation persistence. AI providers are in FieldCure.Ai.Providers.

FieldCure.Ai.Execution

Agent loop and sub-agent execution engine. Provides IAgentLoop for autonomous LLM tool-use loops and ISubAgentExecutor for isolated sub-agent sessions.

FieldCure.AssistStudio.Anthropic

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

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.2 117 5/5/2026
0.7.1 148 5/4/2026
0.7.0 123 5/4/2026
0.6.0 138 4/27/2026
0.5.0 161 4/21/2026
0.4.0 142 4/14/2026
0.3.0 122 4/10/2026
0.2.0 122 4/7/2026
0.1.0 182 3/31/2026

v0.7.2: Fixes Claude Opus 4.7+ extended-thinking requests. The legacy thinking.type=enabled + budget_tokens shape is rejected by Opus 4.7 with "thinking.type.enabled is not supported for this model". ClaudeProvider now emits thinking.type=adaptive paired with output_config.effort (low/medium/high derived from the existing ThinkingBudget token count) for Opus 4.7 and newer; older Claude models keep the legacy shape. No public API changes.