warp-winforms-ai

Implements AI chat features in WinForms apps using WarpToolkit components and Microsoft.Extensions.AI.

1|1|Updated Jun 12, 2022
One-click install
npx skills add https://github.com/KlausLoeffelmann/WinFormsDevTools --skill warp-winforms-ai-klausloeffelmann
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: warp-winforms-ai
Source: https://github.com/KlausLoeffelmann/WinFormsDevTools/tree/main/.github/skills/WARP-WinFormsAI
Command: npx skills add https://github.com/KlausLoeffelmann/WinFormsDevTools --skill warp-winforms-ai-klausloeffelmann

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires WarpToolkit.Desktop.AI, WarpToolkit.Microsoft.Extensions.AI, WarpToolkit.WinForms.AI, WarpToolkit.WinForms.Chat.

What problem does it solve? Adding AI chat capabilities to a WinForms application normally requires manually wiring streaming clients, prompt templates, chat history, and UI rendering. This Skill guides you through the WarpToolkit AI stack so designer-droppable IChatClient components, streaming parsers, and a ready-made chat UI work together correctly. ## Core Features & Use Cases - Designer-droppable AI provider components: Drop OpenAI, Azure OpenAI, Anthropic, or Ollama chat services onto a form and configure model, temperature, and API-key retrieval as Designer-time properties. - Streaming response parsing: Use ReturnTokenParser to convert token-by-token MEAI streams into paragraph- and code-block-grained callbacks for clean UI rendering. - Prompt templates and chat history: Declare prompts with [AITemplate]/[AITemplateSegment] attributes, compose them with PromptBuilder, and manage conversations with AIChatHistory and AIChatClient<T>. - Use Case: Build a WinForms form with a ChatView control connected to an OpenAIChatService component, stream structured code suggestions into the chat renderer, and persist the conversation via ChatProcessor. ## Quick Start Add the four WarpToolkit AI NuGet packages to my WinForms project and wire a ChatView control to an OpenAIChatService component with streaming responses.

Frequently Asked Questions about warp-winforms-ai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add AI chat to a WinForms application?▼

Add the WarpToolkit.WinForms.AI and WarpToolkit.WinForms.Chat NuGet packages, drop a provider component like OpenAIChatService onto your form, and assign it to a ChatView control's AIUserChatService property. Set the KeyRetrievalService in the form constructor, not in InitializeComponent.

How to parse streaming chat responses in WinForms?▼

Use ReturnTokenParser.ProcessTokens to convert an IAsyncEnumerable<ChatResponseUpdate> stream into paragraph- and code-block-level callbacks. Inside a ChatView, ChatProcessor wires this up automatically; outside of it, call the parser directly.

Which AI providers does WarpToolkit WinForms support?▼

Provider components derived from AIChatServiceBase ship for OpenAI, Azure OpenAI, Anthropic, and Ollama. Each implements Microsoft.Extensions.AI's IChatClient, so any code targeting MEAI can consume them.

Can I use WarpToolkit AI in a ViewModel class library without WinForms?▼

Yes. Reference only WarpToolkit.Microsoft.Extensions.AI and WarpToolkit.Desktop.AI in class libraries to keep ViewModels testable and UI-agnostic. The WinForms-specific packages are only needed for designer components and chat UI controls.

Why should I avoid awaiting chat calls in async void handlers?▼

An unhandled exception in an async void event handler will tear down the process. Wrap chat calls in try/catch and route errors through IDialogService.ShowErrorAsync or the WinForms exception service.