Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DevExpress AI-powered Extensions for Blazor

  • 2 minutes to read

DevExpress AI-powered Extensions for Blazor include the following extensions and UI components:

#Supported AI Services

DevExpress AI APIs allow you to register and use AI services supported by the Microsoft.Extensions.AI library:

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.

Important

We use the following versions of the Microsoft.Extensions.AI.* libraries in our source code:

  • v24.2.6+ | 9.3.0-preview.1.25161.3
  • v24.2.3-v24.2.5 | 9.0.0-preview.9.24556.5

We do not guarantee compatibility or correct operation with higher versions. Refer to the following announcement for additional information: Microsoft.Extensions.AI.Abstractions NuGet Package Version Upgrade in v24.2.6.

#Prerequisites

#Install NuGet Packages

#OpenAI Service

#Azure OpenAI Service

#Ollama

Important

We use version 9.0.0-preview.9.24556.5 of the Microsoft.Extensions.AI.* libraries in our source code. We do not guarantee compatibility or correct operation with higher versions.

#Register an AI Service

Call the AddDevExpressAI(IServiceCollection, Action<AIWebSettings>) method at application startup to register an AI service and enable DevExpress AI-powered extensions in your application.

The following code snippet registers an Azure OpenAI service:

using Azure;
using Azure.AI.OpenAI;
using Microsoft.Extensions.AI;
...
string azureOpenAIEndpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT");
string azureOpenAIKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY");
string deploymentName = string.Empty;
...
IChatClient chatClient = new AzureOpenAIClient(
    new Uri(azureOpenAIEndpoint),
    new AzureKeyCredential(azureOpenAIKey)).AsChatClient(deploymentName);

builder.Services.AddDevExpressBlazor();
builder.Services.AddChatClient(chatClient);
builder.Services.AddDevExpressAI();
See Also