New to KendoReactStart a free 30-day trial

Streaming AI Responses
Premium

The KendoReact AIPrompt supports streaming AI responses, which display content progressively as it's generated rather than waiting for the complete response.

Configuration

To implement streaming AI responses, you need to configure the following properties and event handlers:

  1. Enable streaming mode - Set the streaming property to true when content is being generated.
  2. Handle generation requests - Use the onPromptRequest event to start streaming when users submit prompts.
  3. Handle cancellation - Use the onCancel event to stop streaming when users click the Stop Generation button.
  4. Manage outputs - Update the [outputs] array progressively as streamed content arrives.
Change Theme
Theme
Loading ...

When to Use Streaming

Streaming is ideal when you need to provide immediate feedback and maintain user engagement during AI response generation. Consider using streaming in the following scenarios:

  • Working with long-form AI responses that take several seconds to generate, such as detailed explanations, code implementations, or comprehensive analysis.
  • Creating chat-like interfaces where users expect real-time feedback and natural conversation flow.
  • Integrating with AI services that support chunked responses, such as OpenAI's streaming API or similar services.
  • Enhancing user engagement in conversational applications where waiting for complete responses would disrupt the interaction flow.
In this article
ConfigurationWhen to Use StreamingSuggested Links
Not finding the help you need?
Contact Support