![]() |
VOOZH | about |
dotnet add package FieldCure.Ai.Providers --version 0.8.0
NuGet\Install-Package FieldCure.Ai.Providers -Version 0.8.0
<PackageReference Include="FieldCure.Ai.Providers" Version="0.8.0" />
<PackageVersion Include="FieldCure.Ai.Providers" Version="0.8.0" />Directory.Packages.props
<PackageReference Include="FieldCure.Ai.Providers" />Project file
paket add FieldCure.Ai.Providers --version 0.8.0
#r "nuget: FieldCure.Ai.Providers, 0.8.0"
#:package FieldCure.Ai.Providers@0.8.0
#addin nuget:?package=FieldCure.Ai.Providers&version=0.8.0Install as a Cake Addin
#tool nuget:?package=FieldCure.Ai.Providers&version=0.8.0Install as a Cake Tool
AI provider clients for Claude, OpenAI, Gemini, Ollama, and Groq with shared models and streaming support.
| 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 |
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);
ProviderFactory.RegisterCustomProvider with CustomProviderConfig (BaseUrl, DisplayName).ImageCompressor automatically compresses and resizes large images (JPEG, via SkiaSharp) before sending to providers, reducing token usage and API costs.IMultiContentTool interface for tools returning structured multimedia content (images, audio, video) alongside text via ToolExecutionResult.ChatMessage.MediaItems stores media attachments with conversation messages for save/load in .astx files.reasoning_details parsing, <think> tag streaming extraction via ThinkTagParser, and Ollama native thinking field support.Core models
ChatMessage, ChatRole — conversation messages (with MediaItems for media persistence)AiRequest, AiResponse — LLM request/responseAiResponse.IsTruncated — true 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 confirmationIMultiContentTool — tools returning multimedia content alongside textToolExecutionResult — combined text + media content return typeMedia
MediaContent — typed media payload (MimeType, Base64Data, FileName)ImageCompressor — JPEG compression and resize helper (via SkiaSharp)Streaming
StreamEvent — discriminated union: TextDelta, ThinkingDelta, ToolCallStart, ToolCallDelta, Usage, StreamCompletedAdapters
McpToolAdapter — bridges MCP tools to IAssistTool with multimedia content block supportMIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
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. |
This package is not used by any popular GitHub repositories.
v0.8.0: New IToolContext capability surface (RequestApprovalAsync / RequestElicitationAsync) lets tools call back into the host without a UI reference; pairs with an IAssistTool.ExecuteAsync(.., IToolContext?, ..) overload whose default impl forwards to the context-less path. Breaking: ElicitationFieldInfo (+ Type / Option) moved from FieldCure.AssistStudio.Controls to FieldCure.Ai.Providers.Models — pure namespace move, swap the using. Breaking: ChatMessage.IsTruncated is now a [JsonIgnore] read-only alias for the new StopReason enum (Completed / UserCanceled / MaxTokens); .astx files written before this release migrate via a LegacyIsTruncated read alias. New StructuredContent JsonElement on ChatMessage and ToolExecutionResult lets MCP tools ship inline chart specs (e.g. Plotly) at zero token cost. Gemini -image variants now enable IMAGE modality so inlineData parts are produced; Gemini synthesized tool_call_ids are globally unique ({funcName}_{8-hex}) with legacy-form stripping on send so old .astx files keep replaying against strict providers.