# Streaming AI Responses

The Kendo UI for Vue 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`](https://www.telerik.com/kendo-vue-ui-develop/components/conversationalui/api/aipromptprops#streaming) property to `true` when content is being generated.
2. **Handle generation requests** - Use the [`onPromptrequest`](https://www.telerik.com/kendo-vue-ui-develop/components/conversationalui/api/aipromptprops#onpromptrequest) event to start streaming when users submit prompts.
3. **Handle cancellation** - Use the [`onCancel`](https://www.telerik.com/kendo-vue-ui-develop/components/conversationalui/api/aipromptprops#oncancel) event to stop streaming when users click the Stop Generation button.
4. **Manage outputs** - Update the `outputs` array progressively as streamed content arrives.

[Demo Source](https://demos.telerik.com/kendo-vue-ui/conversational-ui/ai-prompt/streaming/source.txt)

## 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.

## Suggested Links

* [Customization](https://www.telerik.com/kendo-vue-ui-develop/components/conversationalui/ai-prompt/customization)
* [Events Documentation](https://www.telerik.com/kendo-vue-ui-develop/components/conversationalui/ai-prompt/events)
* [API Reference of the AIPromptProps](https://www.telerik.com/kendo-vue-ui-develop/components/conversationalui/api/aipromptprops)
