# Events

The KendoReact AIPrompt emits several events that enable you to control its behavior upon user interaction:

* [`onActiveViewChange`](https://www.telerik.com/kendo-react-ui-develop/components/conversationalui/api/aipromptprops#onActiveViewChange) - Fires when the user switches between different views (Prompt, Output, Commands).
* [`onPromptRequest`](https://www.telerik.com/kendo-react-ui-develop/components/conversationalui/api/aipromptprops#onPromptRequest) - Fires when the user submits a prompt for AI processing, including retry and rating actions.
* [`onCommandExecute`](https://www.telerik.com/kendo-react-ui-develop/components/conversationalui/api/aipromptprops#onCommandExecute) - Fires when the user executes a command from the Commands view.
* [`onCancel`](https://www.telerik.com/kendo-react-ui-develop/components/conversationalui/api/aipromptprops#onCancel) - Fires when the user cancels an ongoing request.

The following example demonstrates all the events that the AIPrompt features.

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

## Suggested Links

* [Getting Started with the KendoReact Conversational UI Package](https://www.telerik.com/kendo-react-ui-develop/components/conversationalui/get-started)
* [API Reference of the KendoReact AIPrompt](https://www.telerik.com/kendo-react-ui-develop/components/conversationalui/api/aiprompt)
* [API Reference of the AIPromptProps](https://www.telerik.com/kendo-react-ui-develop/components/conversationalui/api/aipromptprops)
