Overview

DevExpress AI Chat for Blazor is an AI-enabled chat component that allows users to interact with multiple AI services. Our Blazor Chat component can be integrated with the following AI services:

  • OpenAI
  • Azure OpenAI
  • Ollama

To add the DxAIChat component to your application, register the appropriate AI service at application startup.

Use the following properties to customize the chat appearance:

  • ShowHeader: Displays a customizable chat header and a Clear Chat button.
  • UseStreaming: Allows the AI client to send parts of a response once they become available. The AI Chat component will update the display message accordingly for a more responsive chat experience.
  • AllowResizeInput: Allows users to resize the Blazor AI Chat input box. If this property is set to false, the input box automatically resizes itself as a user types.

Note: DevExpress AI-powered extensions follow the "bring your own key" principle. DevExpress does not offer a REST API and does not ship any built-in LLMs/SLMs. You need an active Azure/Open AI subscription to obtain the REST API endpoint, key, and model deployment name. These variables must be specified at application startup to register AI clients and enable DevExpress AI-powered Extensions in your application.

 Customize Message Appearance

Hello, AI!
Hey there, human! What's on your mind? 😊

The DevExpress Blazor AI Chat component allows you to modify the appearance of message bubbles. Use the MessageTemplate property to display any UI render fragment within a chat message. This template changes how the message bubble is rendered, including paddings and inner content alignment.

The BlazorChatMessage template context parameter includes details about the message being processed.

In this demo, the Initialized event handler calls the LoadMessages method to load message history during chat initialization.

 Manual Message Processing

Our Blazor Chat component (DxAIChat) raises the MessageSent event when a user sends a message to the chat. Handle the event to process this action as needed. You can use the Content event argument to access user input and call the SendMessage method to send another message to the chat.

In this demo, users can attach files to messages (the DxAIChat.FileUploadEnabled option is active). To access attached files in a MessageSent event handler, use its Files argument property.

 Customize Empty Message Area

AI Assistant is ready to answer your questions.

Define the EmptyMessageAreaTemplate to customize content displayed in the empty message area.

 Rich Formatted Response

Hello, AI!

Hey there, human! What's on your mind? 😊

AI services use plain text as the default response format. To display rich formatted responses within our Blazor Chat component (DxAIChat), set the ResponseContentFormat property to Markdown and use a markdown processor to convert response content to HTML code.

In this demo, the MessageContentTemplate property is used to render HTML code for message bubble content.

 Prompt Suggestions

AI Assistant

DevExpress Blazor AI Chat supports prompt suggestions – hints that guide users to possible actions. The component displays prompt suggestions (hint bubbles) when the chat area is empty.

Follow the steps below to enable and configure prompt suggestions:

  1. Populate the component's PromptSuggestions property with DxAIChatPromptSuggestion objects (hint bubbles).
  2. Specify bubble content using Title and Text properties.
  3. Use the PromptMessage property to specify the text to be displayed in the input field after a user clicks the corresponding suggestion.

In this demo, the Initialized event handler supplies prompt suggestion content during chat initialization.

 File Attachments

Eiffel-Tower.jpg
Eiffel-Tower.jpg
Analyze the image file and summarize its content.
The image features the Eiffel Tower, a renowned landmark located in Paris, France. The tower is shown from a low angle, emphasizing its height and intricate iron lattice structure. The sky is lit with dramatic clouds and warm hues of sunset, creating a visually striking backdrop for the iconic monument. The overall scene conveys a sense of grandeur and beauty, highlighting the Eiffel Tower as a symbol of romance and architectural achievement.

DevExpress Blazor AI Chat allows users to attach files to messages. Set the DxAIChat.FileUploadEnabled property to true to activate file upload functionality. You can use a nested DxAIChatFileUploadSettings component to validate file size/extension and limit the number of files. This demo uses the drop-down menu to specify allowed file types.

In this demo, the Initialized event handler calls the LoadMessages method to pre-populate the chat with messages and file attachments. File attachments are specified by AIChatUploadFileInfo objects.

 Tool Call Visualization

AI Assistant
Click a tile below to call a function

AI Tool Calling allows Large Language Models (LLMs) to interact with your database files, APIs, and application logic. Instead of guessing an answer, the AI model selects the appropriate function from your code, and generates parameters needed to execute it.

Use the IncludeFunctionCallInfo property to automatically append AI tool execution details to the chat response. This feature allows you to debug and monitor how the LLM interacts with your system in real-time:

  • Optimize AI tool definitions: Refine metadata to make your tools easier for the LLM to understand.
  • Audit security: Identify when AI attempts to access sensitive or restricted data.
  • Build trust: Demonstrate to users that the response is based on actual data processing, not a hallucination.

 Resources

The DevExpress Blazor AI Chat component allows users to attach additional context to chat messages. Context can include binary files (images, audio, PDFs, documents) and non-file artifacts such as database schemas, structured records, or logs. You can also supply external content retrieved from a Model Context Protocol (MCP) server as a resource. Resources help the AI model generate more accurate answers and reduce hallucinations.

Use the Resources collection to manage chat context programmatically.

 AI Tools Integration

AI Assistant
Click a tile below to call a function
 
Drag a column header here to group by that column
Order ID Customer Name Country Order Date Product Name Quantity Total ($) Status
1AliceUSA12/7/2025Monitor4$702.63Processing
2BobCanada12/7/2025Monitor4$778.68On Hold
3CharlieGermany12/18/2025Webcam2$136.69On Hold
4DianaUSA12/3/2025Docking Station7$892.55Processing
5EvanFrance12/17/2025USB Hub3$82.28Pending
6FionaUSA11/30/2025Headset7$624.08Pending
7GeorgeUK11/23/2025Webcam5$315.81Processing
8HelenItaly12/10/2025Headset5$401.96On Hold
9IvanItaly12/8/2025Headset3$244.06Processing
10JuliaJapan12/14/2025Webcam3$208.97Cancelled
11KarlFrance11/25/2025Graphic Tablet2$459.46Shipped
12LauraUSA12/15/2025External SSD5$751.96On Hold
13MartinCanada12/6/2025USB Hub5$115.96Pending
14NinaJapan12/8/2025USB Hub4$99.33Processing
15OscarFrance12/9/2025Docking Station6$800.71Delivered
16AliceJapan12/9/2025Laptop7$6,877.77Shipped
17BobJapan11/29/2025Docking Station4$517.83Pending
18CharlieUSA12/2/2025Headset1$81.37Delivered
19DianaItaly11/22/2025Laptop5$4,862.32Processing
20EvanJapan12/3/2025Graphic Tablet1$207.54Delivered
Data grid with 20 rows and 8 columns
0 rows are selected

The DevExpress AI Chat component can transform natural language input into application logic. This feature relies on AI Tools — specifically annotated methods that define their purpose, input parameters, and the target object against which they operate. Users can trigger UI updates or business workflows by entering requests in the chat.

This demo features the DevExpress AI tool calling layer that significantly extends Microsoft.Extensions.AI capabilities:

  • Context-aware targets: Tools can operate on specific Blazor components, data services, and business objects. The API automatically resolves the correct target instance at runtime.
  • Dynamic availability: Tools can be programmatically enabled, disabled, or removed based on current application state or user workflow.
  • Visual feedback: The AI Chat component includes a built-in UI that visualizes tool selection and execution process.