FieldCure.Ai.Providers
0.2.0
See the version list below for details.
dotnet add package FieldCure.Ai.Providers --version 0.2.0
NuGet\Install-Package FieldCure.Ai.Providers -Version 0.2.0
<PackageReference Include="FieldCure.Ai.Providers" Version="0.2.0" />
<PackageVersion Include="FieldCure.Ai.Providers" Version="0.2.0" />
<PackageReference Include="FieldCure.Ai.Providers" />
paket add FieldCure.Ai.Providers --version 0.2.0
#r "nuget: FieldCure.Ai.Providers, 0.2.0"
#:package FieldCure.Ai.Providers@0.2.0
#addin nuget:?package=FieldCure.Ai.Providers&version=0.2.0
#tool nuget:?package=FieldCure.Ai.Providers&version=0.2.0
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 |
| Mock | In-memory | Sync |
Quick Start
using FieldCure.Ai.Providers.Models;
using FieldCure.Ai.Providers;
var preset = new ProviderPreset
{
ProviderType = "Claude",
ApiKey = "sk-...",
ModelId = "claude-sonnet-4-20250514",
};
var provider = ProviderFactory.Create(preset);
var request = new AiRequest
{
Messages = [new ChatMessage(ChatRole.User, "Hello!")],
};
var response = await provider.CompleteAsync(request);
Console.WriteLine(response.Content);
Features
- 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.astdfiles. - Ollama Native Thinking — Support for Ollama native
thinkingfield in addition to<think>tag parsing.
Models
Core models
ChatMessage,ChatRole— conversation messages (withMediaItemsfor media persistence)AiRequest,AiResponse— LLM request/responseProviderPreset— provider configuration
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 (>= 1.1.0)
- 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.2.0: ImageCompressor for automatic JPEG compression. IMultiContentTool and MediaContent/ToolExecutionResult models for multimedia tool results. ChatMessage.MediaItems for media persistence. Ollama native thinking field support.