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
<PackageReference Include="FieldCure.Ai.Providers" Version="0.7.2" />
<PackageVersion Include="FieldCure.Ai.Providers" Version="0.7.2" />
<PackageReference Include="FieldCure.Ai.Providers" />
paket add FieldCure.Ai.Providers --version 0.7.2
#r "nuget: FieldCure.Ai.Providers, 0.7.2"
#:package FieldCure.Ai.Providers@0.7.2
#addin nuget:?package=FieldCure.Ai.Providers&version=0.7.2
#tool nuget:?package=FieldCure.Ai.Providers&version=0.7.2
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.RegisterCustomProviderwithCustomProviderConfig(BaseUrl, DisplayName). - Image Compression —
ImageCompressorautomatically compresses and resizes large images (JPEG, via SkiaSharp) before sending to providers, reducing token usage and API costs. - Multimedia Tool Results —
IMultiContentToolinterface for tools returning structured multimedia content (images, audio, video) alongside text viaToolExecutionResult. - Media Persistence —
ChatMessage.MediaItemsstores media attachments with conversation messages for save/load in.astxfiles. - Thinking / Reasoning — Structured
reasoning_detailsparsing,<think>tag streaming extraction viaThinkTagParser, and Ollama nativethinkingfield support.
Models
Core models
ChatMessage,ChatRole— conversation messages (withMediaItemsfor media persistence)AiRequest,AiResponse— LLM request/responseAiResponse.IsTruncated—truewhen the provider stopped because it hit themax_tokenscap (Claudestop_reason=max_tokens, OpenAIfinish_reason=length, GeminiMAX_TOKENS, Ollamadone_reason=length). Consumers should treat the response as incomplete rather than a graceful completion.ProviderModel— provider configuration (renamed fromProviderPresetin v0.7.0)CustomProviderConfig— custom OpenAI-compatible provider registration (Id, DisplayName, BaseUrl)
Tool calling
ToolCall,IAssistTool— function calling interface with optional confirmationIMultiContentTool— tools returning multimedia content alongside textToolExecutionResult— 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 toIAssistToolwith multimedia content block support
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 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. |
-
net8.0
- FieldCure.DocumentParsers (>= 2.0.1)
- SkiaSharp (>= 3.119.2)
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.
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.