Skip to main content
All docs
V26.1
  • AIChatControl.ResponseReceived Event

    Fires after the AI provider returns a response, before the chat displays the message.

    Namespace: DevExpress.AIIntegration.WinForms.Chat

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

    NuGet Package: DevExpress.AIIntegration.WinForms.Chat

    Declaration

    [DXCategory("Events")]
    public event EventHandler<AIChatControlResponseReceivedEventArgs> ResponseReceived

    Event Data

    The ResponseReceived event's data class is DevExpress.AIIntegration.Blazor.Chat.WebView.AIChatControlResponseReceivedEventArgs.

    Remarks

    Handle the ResponseReceived event to inspect or modify AI responses after the provider returns them. This event is useful for logging, filtering, and post-processing multi-part responses. You can also use the event to modify metadata about invoked tools or functions before the chat UI displays the response.

    Example

    The following example outputs the text of every received message:

    using DevExpress.AIIntegration.Blazor.Chat.WebView;
    
    public Chat() {
        InitializeComponent();
        aiChatControl1.ResponseReceived += AiChatControl1_ResponseReceived;
    }
    
    void AiChatControl1_ResponseReceived(object sender, AIChatControlResponseReceivedEventArgs e) {
        foreach (var message in e.Messages) {
            Console.WriteLine(message.Text);
        }
    }
    

    Refer to the following help topics for additional information: AI Chat Control | Tool Calling API

    See Also