New to Telerik UI for Blazor? Download Free 30-day trial
InlineAIPrompt - Events
- EXAMPLE
- VIEW SOURCE
- EDIT IN TELERIK REPL
- Change Theme
default
Event Log
- Events.razor
Loading the demo source code...please wait.
Description
The Telerik UI for Blazor InlineAIPrompt exposes a set of events that let you respond to user interactions and control the component behavior at each stage of the prompt lifecycle.
The following events are available:
OnPromptRequest— fires when the user submits a prompt by clicking the send button or pressing Enter. Use it to call your AI service and populate the output viaargs.Outputor by callingAppendOutput()on the component reference.PromptChanged— fires each time the value of the prompt text area changes, giving you access to the current input text.OnPromptRequestStop— fires when the user clicks the stop button to cancel an in-progress request. Use it to abort your AI service call and clean up any ongoing operations.OnCommandExecute— fires when the user selects a command from the commands menu. Useargs.Commandto identify the selected command and populateargs.Outputwith the result.OnOutputActionClick— fires when the user clicks one of the output action buttons (Copy, Retry, Discard, or any custom action). Useargs.Action.Nameandargs.Outputto react accordingly.
The demo logs each fired event and its key arguments in a real-time event log panel, making it easy to observe the order and data of each event as you interact with the component.
This Blazor InlineAIPrompt Events example is part of a unique collection of hundreds of Blazor demos, with which you can see all Telerik UI for Blazor components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in Telerik REPL for Blazor or ThemeBuilder.