FieldCure.AssistStudio.Core 0.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FieldCure.AssistStudio.Core --version 0.4.0
                    
NuGet\Install-Package FieldCure.AssistStudio.Core -Version 0.4.0
                    
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.Core" Version="0.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FieldCure.AssistStudio.Core" Version="0.4.0" />
                    
Directory.Packages.props
<PackageReference Include="FieldCure.AssistStudio.Core" />
                    
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.Core --version 0.4.0
                    
#r "nuget: FieldCure.AssistStudio.Core, 0.4.0"
                    
#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.Core@0.4.0
                    
#: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.Core&version=0.4.0
                    
Install as a Cake Addin
#tool nuget:?package=FieldCure.AssistStudio.Core&version=0.4.0
                    
Install as a Cake Tool

FieldLab AssistStudio

AI Chat Controls for WinUI 3 — Bring Your Own Key, pick any provider.

NuGet Core NuGet Controls License: MIT .NET

Chat conversation with Markdown and syntax highlighting


Features

  • BYOK (Bring Your Own Key) — Users supply their own API keys. No proxy, no middleman.
  • Multi-Provider — Claude, OpenAI, Gemini, and Ollama out of the box. Implement IAiProvider to add your own.
  • Streaming — Real-time token-by-token responses via IAsyncEnumerable<string>.
  • Vision & Documents — Attach images (PNG, JPG, WebP, …), PDFs, and DOCX files to any conversation.
  • Token Tracking — Input/output token counts exposed after every request.
  • Re-templatable WinUI 3 ControlsChatPanel, InputContainer, AttachmentPreviewBar, and ToolApprovalPanel are TemplatedControls with no app dependency. Override Generic.xaml to fully customize the UI.
  • Profiles & Presets — Save provider configurations as presets; switch system prompts with profiles.
  • Conversation Persistence — Save and load conversations in .astx (JSON) format.
  • Localization — Built-in en-US and ko-KR resource strings.
  • Tool / Function Calling — Define tools with IAssistTool and let providers invoke them. Tools that require confirmation show an inline ToolApprovalPanel for user approval before execution.

Screenshots

Empty State Tool Approval
Empty state Tool approval panel

Architecture

┌─────────────────────────────────────────────────┐
│  AssistStudio (Demo App)                        │
│  WinUI 3 desktop app — showcases all controls   │
├─────────────────────────────────────────────────┤
│  AssistStudio.Controls        ← NuGet package   │
│  ChatPanel · InputContainer · ToolApprovalPanel │
│  WebView2 rendering · Themes · Localization     │
├─────────────────────────────────────────────────┤
│  AssistStudio.Core            ← NuGet package   │
│  IAiProvider · IAssistTool · Models · Helpers   │
│  Claude │ OpenAI │ Gemini │ Ollama providers    │
└─────────────────────────────────────────────────┘
Project NuGet Package TFM Key Types
AssistStudio.Core FieldCure.AssistStudio.Core net8.0 IAiProvider, IAssistTool, AiRequest, AiResponse, ChatMessage, TokenUsage, ProviderPreset, Profile, ConversationManager
AssistStudio.Controls FieldCure.AssistStudio.Controls.WinUI net8.0-windows10.0.19041.0<br>net9.0-windows10.0.19041.0 ChatPanel, InputContainer, AttachmentPreviewBar, ToolApprovalPanel, WebViewChatRenderer, ChatTheme
AssistStudio (demo app, not published) net9.0-windows10.0.19041.0 Reference implementation with settings, dialogs, and PasswordVaultHelper

Core is platform-agnostic (net8.0). It has no Windows-specific dependencies — you can reference it from a console app, a server, or any .NET project.


Quick Start

1. Install packages

dotnet add package FieldCure.AssistStudio.Core
dotnet add package FieldCure.AssistStudio.Controls.WinUI

2. Create a provider and wire up the control

using FieldCure.AssistStudio.Providers;

// Pick a provider — API key comes from the user
var provider = new ClaudeProvider(apiKey: "sk-ant-...", modelId: "claude-sonnet-4-20250514");

<Page xmlns:assist="using:FieldCure.AssistStudio.Controls">

    <assist:ChatPanel x:Name="Chat"
                      Placeholder="Ask anything..."
                      Theme="System" />
</Page>
// Code-behind
Chat.Provider = provider;

That's it — you have a fully functional AI chat with streaming, Markdown rendering, and syntax highlighting.


Providers

Supported providers

Provider Streaming Vision Documents Tool Calling API Key Required
Claude (Anthropic) Yes Yes Yes Yes Yes
OpenAI (+ compatible endpoints) Yes Yes Yes Yes Yes
Gemini (Google) Yes Yes Yes Yes Yes
Ollama (local) Yes Yes Yes Yes No

OpenAI provider works with any OpenAI-compatible API (Groq, Azure OpenAI, etc.) by setting a custom baseUrl.

Implementing a custom provider

Implement IAiProvider to integrate any AI service:

using FieldCure.AssistStudio.Models;
using FieldCure.AssistStudio.Providers;

public class MyCustomProvider : IAiProvider
{
    public string ProviderName => "MyService";
    public string ModelId => "my-model-v1";
    public TokenUsage? LastUsage { get; private set; }
    public bool IsTruncated { get; private set; }
    public string? LastRequestBody { get; private set; }
    public string? LastRawResponse { get; private set; }

    public async Task<AiResponse> CompleteAsync(AiRequest request, CancellationToken ct = default)
    {
        // Call your API, return an AiResponse
        throw new NotImplementedException();
    }

    public async IAsyncEnumerable<string> StreamAsync(
        AiRequest request,
        [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken ct = default)
    {
        // Yield tokens as they arrive
        yield return "Hello ";
        yield return "from MyService!";
    }

    public Task<IReadOnlyList<AiModel>> ListModelsAsync(CancellationToken ct = default)
        => Task.FromResult<IReadOnlyList<AiModel>>(
            [new AiModel("my-model-v1", "My Model", "myservice")]);

    public Task<ConnectionInfo> ValidateConnectionAsync(CancellationToken ct = default)
        => Task.FromResult(new ConnectionInfo(true, null, null, null));
}

Then assign it to a ChatPanel:

Chat.Provider = new MyCustomProvider();

Controls

All controls are TemplatedControls defined in Generic.xaml. They carry no app-level dependency — reference the NuGet package and use them in any WinUI 3 project.

ChatPanel

The main control. Provides a complete chat experience: message list (WebView2), input area, streaming, attachments, presets, and profiles.

<assist:ChatPanel Provider="{x:Bind ViewModel.Provider, Mode=OneWay}"
                  SystemPrompt="You are a helpful assistant."
                  Theme="Dark"
                  Placeholder="Type a message..."
                  AvailablePresets="{x:Bind ViewModel.Presets}"
                  SelectedPreset="{x:Bind ViewModel.CurrentPreset, Mode=TwoWay}" />

Key dependency properties: Provider, SystemPrompt, Theme, Placeholder, AvailablePresets, SelectedPreset, AvailableProfiles, SelectedProfile, MessageFontSize, ShowTitleBar

Events: MessageSent, PresetChanged, FilesDropped, TitleBarRequested

InputContainer

The chat input area — text box, attach button, preset/profile selectors. Used internally by ChatPanel, but can be placed standalone.

AttachmentPreviewBar

Horizontal scrollable bar showing thumbnails of attached files before sending.

ToolApprovalPanel

Inline confirmation panel shown when a tool with RequiresConfirmation = true is invoked. Displays the tool name, an expandable JSON arguments preview, and Allow/Reject buttons. Replaces InputContainer during confirmation and restores it after.

Re-templating

Override the default template in your app's resources:

<Style TargetType="assist:ChatPanel" BasedOn="{StaticResource DefaultChatPanelStyle}">
    
</Style>

Configuration

Provider presets

var preset = new ProviderPreset
{
    Name = "Claude Sonnet",
    ProviderType = "Claude",
    ApiKey = "sk-ant-...",
    ModelId = "claude-sonnet-4-20250514",
    Temperature = 0.7,
    MaxTokens = 4096,
    StreamingEnabled = true
};

Profiles

Profiles pair a system prompt with optional provider/model preferences and tool selections:

var profile = new Profile
{
    Name = "Task Planner",
    Text = "You are a task planner that breaks down complex requests into steps and executes them using available tools.",
    ToolNames = ["search_files", "read_file", "write_file", "run_command"]
};

Requirements

Dependency Minimum Version
.NET 8.0
Windows App SDK 1.7
WebView2 Runtime Evergreen
Target Platform Windows 10 1903+ (10.0.19041.0)

Contributing

Contributions are welcome! Please open an issue first to discuss what you'd like to change.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes
  4. Push to the branch and open a Pull Request

License

MIT — Copyright (c) 2026 FieldCure Co., Ltd.

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 (1)

Showing the top 1 NuGet packages that depend on FieldCure.AssistStudio.Core:

Package Downloads
FieldCure.AssistStudio.Controls.WinUI

AI Chat UI Controls for WinUI 3. Supports Claude, OpenAI, Gemini, Ollama and more.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.19.2 80 5/5/2026
0.19.1 94 5/4/2026
0.19.0 79 5/4/2026
0.18.0 99 4/27/2026
0.17.0 97 4/21/2026
0.16.0 93 4/14/2026
0.15.0 104 4/10/2026
0.14.0 95 4/7/2026
0.13.0 102 3/31/2026
0.12.0 106 3/30/2026
0.11.0 101 3/29/2026
0.10.0 98 3/24/2026
0.9.0 101 3/24/2026
0.8.0 90 3/22/2026
0.7.0 96 3/21/2026
0.6.0 104 3/17/2026
0.5.0 103 3/17/2026
0.4.0 101 3/17/2026

# Release Notes — FieldCure.AssistStudio.Core

## [0.4.0] - 2026-03-17

### Added
- NuGet package metadata (Company, Copyright, Icon, README, Repository URL, Tags)
- Release notes auto-inclusion in NuGet package
- `publish-nuget.ps1` script for pack → sign → push workflow

---

## [0.3.0] - 2026-03-17

### Added
- Generic file and command tools for agentic workflows (`ReadFileTool`, `WriteFileTool`, `RunCommandTool`, etc.)
- `broadFileSystemAccess` support for tool file operations

---

## [0.2.0] - 2026-03-16

### Added
- Tool calling support for `ClaudeProvider` and `GeminiProvider`
- `PdfCapability` enum with `Auto`, `TextExtraction`, `NativePdf`, `PageAsImage` options
- `PdfCapability` property on `ProviderPreset` for per-preset PDF handling
- `AttachmentProcessor.RenderPdfPages()` for PDF-to-image conversion (via PDFtoImage)
- `PageAsImage` PDF handling in `OpenAiProvider` and `OllamaProvider` for vision models
- `DisplayName` default interface member on `IAssistTool` for human-readable UI labels
- `ProviderFactory` auto-resolves `PdfCapability.Auto` based on provider type

### Fixed
- Gemini tool call ID uniqueness for parallel calls

---

## [0.1.0] - 2026-03-15

### Added
- `IAiProvider` abstraction with `StreamAsync` returning `IAsyncEnumerable<string>`
- Provider implementations: `ClaudeProvider`, `OpenAiProvider`, `GeminiProvider`, `OllamaProvider`
- SSE and NDJSON streaming support
- Model listing (`ListModelsAsync`) for all providers
- `OllamaManager` for local model management (pull, delete, search)
- `OllamaFitPolicy` for automatic model selection based on hardware
- Token tracking (`TokenUsage` model)
- Conversation persistence (`ConversationManager`)
- Hardware detection helpers (`HardwareInfo`)
- Image and document attachment models (`ChatAttachment`)
- Profile and ProviderPreset models
- Tool use abstractions (`IAssistTool`, `ToolCall`, `ToolResult`)