corelibraries-devexpress-dot-aiintegration-dot-aiextensionscontainerdesktop-918c9ab8.md
The default container for AI services.
Namespace : DevExpress.AIIntegration
Assembly : DevExpress.AIIntegration.Desktop.v25.2.dll
NuGet Package : DevExpress.AIIntegration.Desktop
public static readonly AIExtensionsContainerDefault Default
Public Shared ReadOnly Default As AIExtensionsContainerDefault
| Type | Description |
|---|---|
| AIExtensionsContainerDefault |
The default container.
|
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 azureChatClient = new Azure.AI.OpenAI.AzureOpenAIClient(new Uri(AzureOpenAIEndpoint),
new System.ClientModel.ApiKeyCredential(AzureOpenAIKey))
.GetChatClient("gpt-4o-mini").AsIChatClient();
AIExtensionsContainerDesktop.Default.RegisterChatClient(azureChatClient);
Application.Run(new Form1());
}
static string AzureOpenAIEndpoint { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT"); } }
static string AzureOpenAIKey { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_APIKEY"); } }
}
using Microsoft.Extensions.AI;
using DevExpress.AIIntegration;
internal static class Program {
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Dim azureChatClient As IChatClient = New Azure.AI.OpenAI.AzureOpenAIClient(New Uri(AzureOpenAIEndpoint),
New System.ClientModel.ApiKeyCredential(AzureOpenAIKey)).
GetChatClient("gpt-4o-mini").AsIChatClient()
AIExtensionsContainerDesktop.Default.RegisterChatClient(azureChatClient)
Application.Run(new Form1());
}
static string AzureOpenAIEndpoint { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT"); } }
static string AzureOpenAIKey { get { return Environment.GetEnvironmentVariable("AZURE_OPENAI_APIKEY"); } }
}
Tip
DevExpress AI-poweredExtensions for WinForms
The following code snippets (auto-collected from DevExpress Examples) contain references to the Default field.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
// Register the chat client and the palette generation extension in the DevExpress AI container.
var defaultContainer = AIExtensionsContainerDesktop.Default;
defaultContainer.RegisterChatClient(chatClient);
devexpress-ai-chat-samples/CS/DevExpress.AI.Samples.WPFBlazor/App.xaml.cs#L30
);
var container = AIExtensionsContainerDesktop.Default;
container.RegisterChatClient(openAIClient.AsChatClient(deployment));
winforms-chat-for-net-framework/CS/DevExpress.AI.WinForms.HtmlChat.Demo/Program.cs#L27
IChatClient chatClient = azureOpenAIClient.GetChatClient("gpt-4o-mini").AsIChatClient();
var container = AIExtensionsContainerDesktop.Default;
container.RegisterChatClient(chatClient);
See Also
AIExtensionsContainerDesktop Class