Skip to main content
All docs
V26.1
  • IChatResponseProvider.GetResponseAsync(IEnumerable<ChatMessage>, Boolean, String, CancellationToken) Method

    Sends the conversation to the associated AI service and returns the response as a sequence of updates.

    Namespace: DevExpress.AIIntegration.Chat

    Assembly: DevExpress.AIIntegration.v26.1.dll

    NuGet Package: DevExpress.AIIntegration

    Declaration

    IAsyncEnumerable<ChatResponseUpdate> GetResponseAsync(
        IEnumerable<ChatMessage> messages,
        bool useStreaming = true,
        string conversationId = null,
        CancellationToken cancellationToken = default(CancellationToken)
    )

    Parameters

    Name Type Description
    messages IEnumerable<Microsoft.Extensions.AI.ChatMessage>

    The complete conversation history (including the latest user message).

    Optional Parameters

    Name Type Default Description
    useStreaming Boolean True

    true to receive the response as incremental updates while the AI service generates it; false to receive the complete response at once.

    conversationId String null

    The conversation identifier returned in the previous response. null if no identifier was returned.

    cancellationToken CancellationToken null

    The token that cancels the request.

    Returns

    Type Description
    IAsyncEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate>

    An asynchronous sequence of response updates.

    See Also