AIExtensionsContainerDesktop Class
A container that manages registered AI clients in WinForms and WPF applications.
Namespace: DevExpress.AIIntegration
Assembly: DevExpress.AIIntegration.Desktop.v24.2.dll
Declaration
Remarks
DevExpress AI-powered extensions operate within AIExtensionsContainerDesktop.Default. This container manages all registered AI clients so that DevExpress UI controls can automatically leverage AI services.
The following code snippet registers an Azure OpenAI client in a WinForms application:
using Microsoft.Extensions.AI;
using DevExpress.AIIntegration;
internal static class Program {
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
IChatClient asChatClient = new Azure.AI.OpenAI.AzureOpenAIClient(new Uri(AzureOpenAIEndpoint),
new System.ClientModel.ApiKeyCredential(AzureOpenAIKey))
.AsChatClient("GPT4o");
AIExtensionsContainerDesktop.Default.RegisterChatClient(asChatClient);
Application.Run(new Form1());
}
static string AzureOpenAIEndpoint { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT"); } }
static string AzureOpenAIKey { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_APIKEY"); } }
}
Inheritance
Object
AIExtensionsContainerDesktop
See Also