Skip to main content
All docs
V24.2

AIExtensionsContainerDesktop.Default Field

The default container for AI services.

Namespace: DevExpress.AIIntegration

Assembly: DevExpress.AIIntegration.Desktop.v24.2.dll

NuGet Package: DevExpress.AIIntegration.Desktop

Declaration

public static readonly AIExtensionsContainerDefault Default

Field Value

Type Description
AIExtensionsContainerDefault

The default container.

Remarks

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"); } }
}
See Also