devexpress/agent-skills/devexpress-blazor-ai-chat

Claude Code and agent skill by devexpress/agent-skills

Trust tier 2
  • community
  • ext:[{"type":"template","description":"Custom templates for code generation"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Generate and configure DevExpress Blazor AI Chat (DxAIChat) — an AI-powered chat UI for Blazor apps. Use for building conversational assistants, integrating providers (OpenAI, Azure OpenAI, Ollama, or custom), configuring system prompts and suggestions, streaming responses, attachments, Markdown rendering, and tool/function calling via custom IChatResponseProvider implementations. Also use for DxAIChat, AI chat component, LLM chat UI, OpenAI setup, and chat architecture comparisons or migration scenarios.

Install

npx vskill@latest install devexpress/agent-skills/devexpress-blazor-ai-chat

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

DevExpress Blazor AI Chat

DxAIChat is an AI-powered conversational UI component compatible with major cloud AI providers (OpenAI, Azure OpenAI) and self-hosted models (Ollama). It runs in Blazor, .NET MAUI, WPF, and WinForms applications. The component operates on a BYOK (bring your own key) model — you supply the AI provider credentials; DevExpress does not bundle any LLM.

Security: Never hardcode AI provider keys, endpoints, or credentials in source code. Use environment variables, user secrets, or a secrets vault.

When to Use This Skill

  • Add a conversational AI chat widget to a Blazor page
  • Connect DxAIChat to Azure OpenAI, OpenAI, or Ollama
  • Configure prompt suggestions (hint bubbles shown before the first message)
  • Add a system prompt to give the AI model a persona or instructions
  • Enable file attachments (PDF, images) for multimodal AI analysis
  • Render AI responses with Markdown formatting
  • Switch between multiple AI providers at runtime
  • Implement tool/function calling from the AI model
  • Save and load conversation history
  • Integrate with AI agents and custom backends via IChatResponseProvider

Prerequisites & Installation

NuGet Packages
PackageMinimum VersionPurpose
DevExpress.AIIntegration.Blazor.Chat26.1Core AI Chat component
DevExpress.Blazor26.1Required DevExpress Blazor base
DevExpress.AIIntegration.Agents26.1Agent-based IChatResponseProvider creation (.AsAIAgent())
Microsoft.Extensions.AI9.7.1Required MEI abstraction layer
Microsoft.Extensions.AI.OpenAI9.7.1-preview.1.25365.4Azure OpenAI / OpenAI provider bridge
Azure.AI.OpenAI2.3.0Azure OpenAI SDK
OpenAI2.3.0OpenAI (non-Azure) SDK
OllamaSharp—Ollama self-hosted provider
bash
# Install from NuGet.org:
dotnet add package DevExpress.AIIntegration.Blazor.Chat
dotnet add package DevExpress.Blazor

Important: Always use version 26.1 or later. IChatResponseProvider and .AsIChatResponseProvider() are not available in 25.2 or earlier. All DevExpress packages must use the same version. A valid DevExpress license is required.

Namespace Quick Reference

Use this table to resolve using directives without searching — copy the exact namespace for each type:

Type / ExtensionNamespace
DxAIChat, DxAIChatPromptSuggestion, DxAIChatFileUploadSettings, BlazorChatMessage, IAIChat, AIChatResource, IAIChatMessageContextItemDevExpress.AIIntegration.Blazor.Chat
IChatResponseProvider, .AsIChatResponseProvider(), .AsIChatResponseProvider(ChatOptions)DevExpress.AIIntegration.Chat
.AsAIAgent(instructions:)DevExpress.AIIntegration.Agents
DxResourceManager, Themes, SizeModeDevExpress.Blazor
IChatClient, ChatRoleMicrosoft.Extensions.AI
AzureOpenAIClientAzure.AI.OpenAI
ApiKeyCredentialSystem.ClientModel
OpenAIClientOpenAI
AddDevExpressBlazor, AddDevExpressAIExtension methods — no explicit using needed; resolved from installed NuGet packages
Required Registration (all three steps must be present)

Program.cs — register the AI provider, then DevExpress services (see BYOK Setup Guide below for provider details):

csharp
// Register the IChatClient — AddDevExpressAI() automatically creates the default IChatResponseProvider from it
builder.Services.AddChatClient(chatClient);
builder.Services.AddDevExpressBlazor();
builder.Services.AddDevExpressAI();
v26.1 note: DevExpress.Blazor no longer includes options.BootstrapVersion or DevExpress.Blazor.BootstrapVersion. Do not generate either API.
Keyed providers only: For multi-provider (runtime-switching) setups, skip AddChatClient and register each provider explicitly: builder.Services.AddKeyedScoped<IChatResponseProvider>("key", (_, _) => client.AsIChatResponseProvider()).

Components/App.razor — register theme and client scripts inside <head>:

razor
@using DevExpress.Blazor
@DxResourceManager.RegisterTheme(Themes.Fluent)
@DxResourceManager.RegisterScripts()
Without these two calls components render without styles and client interactivity is broken.

Components/_Imports.razor — add global namespace:

razor
@using DevExpress.AIIntegration.Blazor.Chat

Before You Start — Ask the Developer

If the host agent has a structured question-asking tool available, use it to ask these questions one at a time with clear options — for example, Claude Code's AskUserQuestion tool or GitHub Copilot's askQuestions tool. If no such tool is available, ask the questions directly in the chat response before generating code.

  1. Render mode: What is your render mode? (InteractiveServer, InteractiveWebAssembly, or InteractiveAuto)
  2. New or existing project?
  3. AI provider: Azure OpenAI, OpenAI, Ollama, Google Gemini, or custom?
  4. If Ollama: What model name do you want to use? (e.g., llama3, phi4, mistral, gemma) — run ollama list to see installed models.
  5. Key features needed: Prompt suggestions? File attachments? System prompt? Markdown rendering? Tool calling?
  6. Secrets management: How are API keys stored? (environment variables, user secrets, Azure Key Vault)
Rule: Do not hardcode AI credentials. Confirm secret management before generating Program.cs code.

BYOK Setup Guide

DxAIChat is a Bring Your Own Key (BYOK) component — DevExpress does not supply AI models, API keys, or endpoints. The developer must provision an AI provider and configure credentials before any code will work.

Agent instruction: When the user picks an AI provider (question 3) or a secret storage approach (question 5) from the section above, immediately present the matching rows from the tables below. Do not skip to code generation until the user confirms their credentials are in place.
Required Credentials by Provider
ProviderRequired ValuesWhere to Obtain
Azure OpenAIEndpoint URL · API key · Deployment nameAzure Portal → your Azure OpenAI resource → Keys and Endpoint; deployment name from Azure OpenAI Studio
OpenAIAPI keyplatform.openai.com → API keys
Ollama (self-hosted)Server URL (default http://localhost:11434) · Model nameNo cloud account needed — install Ollama locally and pull a model (see below)
Google GeminiAPI keyGoogle AI Studio → Get API key
Custom providerProvider-specificImplement IChatResponseProvider manually

Azure OpenAI — three values are required:

AZURE_OPENAI_ENDPOINT = https://<resource-name>.openai.azure.com/
AZURE_OPENAI_KEY = <key copied from Azure Portal → Keys and Endpoint>
AZURE_OPENAI_DEPLOYMENT = <deployment name from Azure OpenAI Studio>

OpenAI — one value required:

OPENAI_KEY = sk-<key from platform.openai.com>

The model name (e.g., "gpt-4o") is set in Program.cs code directly, not stored as a secret.

Ollama — local system setup, no cloud account:

bash
# Install Ollama on Windows
winget install Ollama.Ollama
# List already-installed models
ollama list
# Pull a model if not already installed (examples below)
ollama pull llama3 # Meta LLaMA 3
ollama pull phi4 # Microsoft Phi-4
ollama pull mistral # Mistral 7B
ollama pull gemma # Google Gemma
# Ollama starts automatically; default server URL: http://localhost:11434
# No API key required for local use
Agent instruction: Before generating Ollama registration code, ask the developer which model they want to use. Declare the client as IChatClient (not var) so .AsIChatResponseProvider() resolves: IChatClient ollamaClient = new OllamaApiClient(url, "<model-name>"); — do not hardcode "llama3" as a default.
Secret Storage — What to Configure
ApproachRecommended forWhat to do
User secretsLocal developmentRun dotnet user-secrets commands once per project (see below)
Environment variablesCI/CD pipelines, containers, PaaS hostingSet variables in the OS, Docker environment, or hosting platform config
Azure Key VaultProduction Azure deploymentsAdd Azure.Extensions.AspNetCore.Configuration.Secrets package; configure vault URI in Program.cs
appsettings.json overridesDeploy-time injection onlyLeave placeholder values in the file; supply real values via environment variable overrides at deploy time — never commit real keys

User secrets — run once per project in the project folder:

bash
dotnet user-secrets init
# Azure OpenAI
dotnet user-secrets set "AZURE_OPENAI_ENDPOINT" "https://..."
dotnet user-secrets set "AZURE_OPENAI_KEY" "..."
dotnet user-secrets set "AZURE_OPENAI_DEPLOYMENT" "gpt-4o"
# OpenAI
dotnet user-secrets set "OPENAI_KEY" "sk-..."

Secrets are stored in %APPDATA%\Microsoft\UserSecrets\<project-guid>\secrets.json and are never committed to source control.

Environment variables — read in Program.cs:

csharp
// Direct read
Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY")
// Via IConfiguration (reads env vars and user secrets automatically in development)
builder.Configuration["AZURE_OPENAI_KEY"]

Azure Key Vault — add to Program.cs before building services:

csharp
using Azure.Identity;
builder.Configuration.AddAzureKeyVault(
new Uri("https://<vault-name>.vault.azure.net/"),
new DefaultAzureCredential());
// Then read secrets by their vault secret name:
builder.Configuration["AzureOpenAiKey"]

Component Overview

DxAIChat provides:

  • Conversational UI: Full message history, user/AI message rendering, typing indicator (DxAIChat)
  • Prompt suggestions: Pre-defined hint bubbles for first-message guidance (DxAIChatPromptSuggestion)
  • File attachments: Upload PDFs and images for multimodal AI analysis (DxAIChatFileUploadSettings)
  • Initialization hook: Run setup code (system prompt, assistant binding) via the Initialized event (IAIChat)
  • Multi-provider support: Switch providers at runtime using ChatResponseProviderServiceKey
Core Entry Point

Minimal Razor markup:

razor
@using DevExpress.AIIntegration.Blazor.Chat
<DxAIChat />

Minimal Program.cs (Azure OpenAI):

csharp
using Azure.AI.OpenAI;
using System.ClientModel;
using Microsoft.Extensions.AI;
var azureClient = new AzureOpenAIClient(
new Uri(Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")!),
new ApiKeyCredential(Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY")!));
IChatClient chatClient = azureClient
.GetChatClient(Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT")!)
.AsIChatClient();
// AddChatClient registers the IChatClient; AddDevExpressAI() automatically wraps it
// as the default (non-keyed) IChatResponseProvider — no explicit registration needed
builder.Services.AddChatClient(chatClient);
builder.Services.AddDevExpressBlazor();
builder.Services.AddDevExpressAI();
Version requirement: IChatResponseProvider and the .AsIChatResponseProvider() extension method are available starting from DevExpress v26.1. Earlier versions use a different integration API.

Documentation & Navigation Guide

Getting Started

📄 references/getting-started.md

When you need to:

  • Install packages and register an AI provider in Program.cs
  • Add DxAIChat to a Blazor page with the correct render mode
  • See a complete working project setup
AI Service Integration

📄 references/ai-service-integration.md

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
52
Repository forks
8
7-day trend score
20

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • templateCustom templates for code generation

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/devexpress/agent-skills/devexpress-blazor-ai-chat/badge)](https://verified-skill.com/skills/devexpress/agent-skills/devexpress-blazor-ai-chat)

Something wrong with this skill or its page? Tell us.