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:
Stream responses directly to
SfAIAssistView.Provide a method, such as
args.AppendResponseAsync(string chunk)orargs.SetResponseStream(IAsyncEnumerable<string> stream), within theAssistViewPromptRequestedEventArgsthat 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) ]
});
}
}
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
Thanks for sharing
Thanks buddy Amazing guide!
Hi Asher,
Welcome, Thanks for your update.
Please get back to us if you need any further assistance.
Regards,
Indrajith
- 4 Replies
- 4 Participants
-
YC Yongkee Cho
- Aug 24, 2025 04:07 AM UTC
- Jun 16, 2026 06:44 AM UTC