Real-time Stream-ing of Responses to SfAIAssistView

Hello Syncfusion Team and Community,

I am building a Blazor application that integrates with a local Ollama server to create an AI assistant using the SfAIAssistView component. The component is excellent for handling user prompts and displaying a finished response.

I am trying to implement a stream-ing response feature where the AI's reply is rendered in real time, character by character or chunk by chunk, as it is generated by the server. This provides a much better user experience, as it feels more dynamic and responsive.

I would like to request the addition of a feature that allows developers to:

  1. Stream responses directly to SfAIAssistView.

  2. Provide a method, such as args.AppendResponseAsync(string chunk) or args.SetResponseStream(IAsyncEnumerable<string> stream), within the AssistViewPromptRequestedEventArgs that enables real-time rendering.

My current code uses the PromptRequested event to call my IChatInferenceService:

@page "/chat"
@attribute [Authorize]
@using Syncfusion.Blazor.InteractiveChat
@using ChatMessage = Microsoft.Extensions.AI.ChatMessage
@inject IChatInferenceService OllamaAIService

<SfAIAssistView PromptRequested="@PromptRequest"></SfAIAssistView>

@code {
    private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
    {
        args.Response = await OllamaAIService.GenerateResponseAsync(new ChatParameters
        {
            Messages = [ new ChatMessage(Microsoft.Extensions.AI.ChatRole.User, args.Prompt) ]
        });
    }
}

Image_3852_1756008575805


4 Replies

VG Vigneshwaran Govindharajan Syncfusion Team August 26, 2025 03:05 AM UTC

Hi Yongkee,


Greetings from Syncfusion support.


Thanks for your suggestions, you can achieve streaming responses in the AI AssistView component using the public method UpdateResponseAsync. This allows you to dynamically update the response content in real-time, ensuring smooth and responsive rendering of the AI's reply.


We have a live demo showcasing this functionality: Blazor AI AssistView Streaming | Real-time Responses | Syncfusion


Please get back to us if you need any further assistance.


Regards,

Vigneshwaran G



AV Asher Vayne June 14, 2026 12:55 PM UTC

Thanks for sharing



AV Asher Vayne replied to Vigneshwaran Govindharajan June 14, 2026 12:59 PM UTC

Thanks buddy Amazing guide!



IS Indrajith Srinivasan Syncfusion Team June 16, 2026 06:44 AM UTC

Hi Asher,


Welcome, Thanks for your update.


Please get back to us if you need any further assistance.


Regards,

Indrajith


Loader.
Up arrow icon