This is a development environment

New to Telerik UI for Blazor? Download Free 30-day trial

InlineAIPrompt - Events

Event Log
    • Events.razor
    Loading the demo source code...please wait.
    Style in ThemeBuilder
    • Custom SASS variables
    • Atomic customizations
    • Sharing projects
    Start Theming

    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 via args.Output or by calling AppendOutput() 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. Use args.Command to identify the selected command and populate args.Output with the result.
    • OnOutputActionClick — fires when the user clicks one of the output action buttons (Copy, Retry, Discard, or any custom action). Use args.Action.Name and args.Output to 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.

    Support & Learning Resources

    An error has occurred. This application may no longer respond until reloaded.