New to Telerik UI for ASP.NET MVCStart a free 30-day trial

Streaming AI Responses with InlineAIPrompt

The ASP.NET MVC InlineAIPrompt component enables streaming responses, allowing users to view AI-generated content in real time as it's being created. This capability significantly improves the user experience by offering instant feedback and a more dynamic interaction.

Streaming proves especially beneficial in scenarios such as:

  • Handling lengthy AI outputs that require several seconds to complete.
  • Building inline editing tools where users anticipate immediate updates.
  • Connecting with AI platforms that deliver responses in chunks.
  • Boosting engagement in contextual AI support environments.

Configuration

To enable streaming in the InlineAIPrompt component, follow these steps:

  1. Enable the IsStreaming property of the InlineAIPrompt. This property controls whether the component displays the Stop Generation button and indicates that a response is being streamed.

    Razor
        @(Html.Kendo().InlineAIPrompt()
            .Name("inlineAi")
            .IsStreaming(true)
            ...... //Additional configuration
        )
  2. To initiate streaming in the ASP.NET MVC InlineAIPrompt component, you need to handle the PromptRequest event. This event is triggered when the user either clicks the Send button or presses Enter.

    Razor
        @(Html.Kendo().InlineAIPrompt()
            .Name("inlineaiprompt")
            .Events(ev => ev.PromptRequest("onPromptRequest"))
            ... //Additional configuration
        )

See Also

In this article
ConfigurationSee Also
Not finding the help you need?
Contact Support