Skip to main content
All docs
V26.1
  • AIChatControl.ChatResponseProviderServiceKey Property

    Associates the chat control with the specific AI service.

    Namespace: DevExpress.AIIntegration.WinForms.Chat

    Assembly: DevExpress.AIIntegration.WinForms.Chat.v26.1.dll

    NuGet Package: DevExpress.AIIntegration.WinForms.Chat

    Declaration

    [DefaultValue(null)]
    public string ChatResponseProviderServiceKey { get; set; }

    Property Value

    Type Default Description
    String null

    The unique identifier of the IChatResponseProvider service.

    Remarks

    Use the ChatResponseProviderServiceKey property to dynamically bind the DevExpress WinForms AI Chat Control to a specific AI service at runtime. You can allow users to choose an AI model or programmatically select the most appropriate model for a task. For example, use a powerful “thinking” model for complex queries and a faster, more cost-effective model for simpler interactions.

    Example

    The following example creates two chat controls and binds each control to its own AI service:

    using DevExpress.AIIntegration.WinForms.Chat;
    
    AIChatControl azureChat = new AIChatControl() {
        ChatResponseProviderServiceKey = "azureAiProviderServiceKey",
        Dock = DockStyle.Right
    };
    AIChatControl ollamaChat = new AIChatControl() {
        ChatResponseProviderServiceKey = "ollamaAiProviderServiceKey",
        Dock = DockStyle.Left
    };
    this.Controls.AddRange(new Control[] { azureChat, ollamaChat });
    

    Refer to the following help topic for additional information: Manage Multiple Chat Clients

    See Also