You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/aiprompt/events.md
+49-18Lines changed: 49 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,51 @@ position: 40
12
12
13
13
This article explains the events available in the Telerik AIPrompt for Blazor:
14
14
15
+
*[`OnOutputActionClick`](#onoutputactionclick)
15
16
*[`OnPromptRequest`](#onpromptrequest)
17
+
*[`OnPromptRequestStop`](#onpromptrequeststo)
16
18
*[`OnCommandExecute`](#oncommandexecute)
17
-
*[`OnOutputRate`](#onoutputrate)
18
19
*[`PromptTextChanged`](#prompttextchanged)
19
20
21
+
## OnOutputActionClick
22
+
23
+
The `OnOutputActionClick` event fires when the user clicks an output action button in the output view of the AIPrompt component. Use this event to handle custom actions such as copying, retrying, or providing feedback on the generated output.
24
+
25
+
To define the available output actions, set the `OutputActions` parameter to a list of [`AIPromptOutputActionDescriptor`](slug:Telerik.Blazor.Components.AIPromptOutputActionDescriptor) objects. Each action descriptor configures the appearance and behavior of an action button.
26
+
27
+
The event handler receives an argument of type `AIPromptOutputActionClickEventArgs`, which provides details about the clicked action, the prompt, the output, and the related command (if any). For a full list of available properties, refer to the [`AIPromptOutputActionClickEventArgs` API reference](slug:Telerik.Blazor.Components.AIPromptOutputActionClickEventArgs).
28
+
29
+
>caption Handle output action clicks in the AIPrompt
// The example uses dummy data intentionally. Replace the hard-coded string with a call to your AI API.
55
+
args.Output = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
56
+
}
57
+
}
58
+
````
59
+
20
60
## OnPromptRequest
21
61
22
62
The `OnPromptRequest` event fires when the user clicks on the **Generate** button within the Prompt view or retries a prompt from the Output view.
@@ -34,6 +74,12 @@ The event handler receives an argument of type [`AIPromptPromptRequestEventArgs`
34
74
35
75
> Do not use the `OnPromptRequest` event when [integrating the AIPrompt component with `Microsoft.Extensions.AI`](slug:common-features-microsoft-extensions-ai-integration). The `OnPromptRequest` event disables such integration.
36
76
77
+
## OnPromptRequestStop
78
+
79
+
The `OnPromptRequestStop` event fires when the user stops a prompt request by clicking the stop floating action button in the output view. This event allows you to handle the cancellation of an ongoing prompt request.
80
+
81
+
The event handler receives an `EventCallback` with no arguments.
82
+
37
83
## OnCommandExecute
38
84
39
85
The `OnCommandExecute` event fires when the user clicks on a command within the Commands view.
@@ -49,24 +95,9 @@ The event handler receives an argument of type [`AIPromptCommandExecuteEventArgs
49
95
|`IsCancelled`|`bool`| Whether the event is cancelled and the built-in action is prevented. |
50
96
|`OutputItem`|`AIPromptOutputItemDescriptor`| The output item. This property will be populated only when the user retries an existing output. See [`AIPromptOutputItemDescriptor`](slug:Telerik.Blazor.Components.AIPromptOutputItemDescriptor). |
51
97
98
+
## PromptChanged
52
99
53
-
## OnOutputRate
54
-
55
-
The `OnOutputRate` event fires when the user rates an output.
56
-
57
-
The event handler receives an argument of type [`AIPromptOutputRateEventArgs`](slug:Telerik.Blazor.Components.AIPromptOutputRateEventArgs). See the [example below](#example).
|`OutputItem`|`AIPromptOutputItemDescriptor`| Specifies the output item that is being rated. See [`AIPromptOutputItemDescriptor`](slug:Telerik.Blazor.Components.AIPromptOutputItemDescriptor). |
64
-
65
-
## PromptTextChanged
66
-
67
-
The `PromptTextChanged` event fires when the user changes the prompt text. Use the event to update the AIPrompt's prompt when the `PromptText` parameter is set with one-way binding, otherwise, the user action will be ignored.
68
-
69
-
## See Also
100
+
The `PromptChanged` event fires when the user changes the prompt text. Use the event to update the AIPrompt's prompt when the `Prompt` parameter is set with one-way binding, otherwise, the user action will be ignored.
Copy file name to clipboardExpand all lines: components/aiprompt/overview.md
+30-30Lines changed: 30 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,39 +84,13 @@ The AIPrompt component provides templates that enable developers to customize th
84
84
85
85
The various AIPrompt events allow you to implement custom functionality and handle user interactions with the component's ToolBar. [Read more about the AIPrompt events...](slug:aiprompt-events)
86
86
87
+
## Parameters and API
87
88
88
-
##AIPrompt Parameters
89
+
The AIPrompt component provides a wide range of parameters and methods that let you customize its appearance, behavior, and integration with your application. You can configure built-in and custom views, toolbar items, commands, prompt suggestions, and more. The component also exposes methods for programmatic control, such as refreshing the UI or adding output items dynamically.
89
90
90
-
The table below lists the AIPrompt parameters. For a full list of the AIPrompt API members (parameters, methods, and events), check the [AIPrompt API Reference](slug:Telerik.Blazor.Components.TelerikAIPrompt).
91
+
For a complete list of available parametersand methods, refer to the [AIPrompt API Reference](slug:Telerik.Blazor.Components.TelerikAIPrompt).
| Parameter | Type and Default Value | Description |
95
-
| --- | --- | --- |
96
-
|`AIPromptViews`|`RenderFragment`| Allows control over the views of the content. Use it to set the visibility of a predefined view or to create custom views. If a render fragment is not provided, the AIPrompt will display its default views. |
97
-
|`AIPromptToolBar`|`RenderFragment`| Any additional buttons that will be rendered within the ToolBar. This parameter will append the new items, rather than override buttons related to existing views. |
98
-
|`Class`|`string`| The `class` attribute of the `<div class="k-prompt">` element. Use it to apply custom styles or [override the theme](slug:themes-override). |
99
-
|`Commands`|`List<AIPromptCommandDescriptor>`| The predefined commands displayed within the Commands view. |
100
-
|`Height`|`string`| The `height` style of the component in any [supported CSS unit](slug:common-features/dimensions). The default AIPrompt dimensions depend on the CSS theme. |
101
-
| `PromptContext` | `string` | This text is appended to the prompt when sending the request. This is required in order to allow the component to work with external context, which is not visible in the prompt box.
102
-
|`PromptText`|`string`| The value of the text within the prompt view. Use it when you need to add some form of transformation to the prompt. The parameter supports two-way binding. |
103
-
|`PromptTextChanged`|`EventCallback<string>`| The handler called whenever the `PromptText` changes. |
104
-
|`PromptSuggestions`|`List<string>`| The prompt suggestions displayed within the Prompt view. |
105
-
|`PromptSuggestionItemTemplate`|`RenderFragment<string>`| The Prompt Suggestion Item template of the AIPrompt. |
106
-
|`ShowOutputRating`|`bool` <br /> (`false`) | Controls the visibility of the rating buttons within the output card. |
107
-
| `SystemPrompt` | `string` <br /> (See "Description" column) | Defines the system prompt that is passed to the [Microsoft `ChatMessage`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.ai.chatmessage) object constructor. <br /><br /> The default `SystemPrompt` value is: `"You are a helpful assistant designed to assist users. Your goal is to provide helpful, accurate, and contextually appropriate information in a clear and concise manner. Avoid discussing harmful, illegal, or inappropriate topics."`.
108
-
|`Width`|`string`| The `width` style of the component in any [supported CSS unit](slug:common-features/dimensions). The default AIPrompt dimensions depend on the CSS theme. |
109
-
110
-
## AIPrompt Reference and Methods
111
-
112
-
The AIPrompt exposes methods for programmatic operation. To use them, define a reference to the component instance with the `@ref` directive attribute.
113
-
114
-
| Method | Description |
115
-
| --- | --- |
116
-
|`Refresh`| Re-renders the component. |
117
-
|`AddOutput`| Insert a new output item to the AIPrompt. |
118
-
119
-
>caption AIPrompt reference and method usage
93
+
To use component methods, define a reference to the AIPrompt instance with the `@ref` directive. For example:
@@ -149,6 +123,32 @@ The AIPrompt exposes methods for programmatic operation. To use them, define a r
149
123
}
150
124
````
151
125
126
+
## SpeechToTextButton Integration
127
+
128
+
To integrate a built-in SpeechToTextButton in the AIPrompt component, set `EnableSpeechToText="true"`. Optionally, you can use the `<AIPromptSettings>` tag as a child of `<TelerikAIPrompt>`. Inside `<AIPromptSettings>`, you can define the `<AIPromptSpeechToTextButtonSettings>` tag to configure the appearance and behavior of the built-in SpeechToTextButton. For a complete list of available parameters, refer to the [AIPromptSpeechToTextButtonSettings API Reference](slug:Telerik.Blazor.Components.AIPromptSpeechToTextButtonSettings).
129
+
130
+
For advanced configuration options and more details about the SpeechToTextButton component, see the [SpeechToTextButton documentation](slug:speechtotextbutton-overview).
131
+
132
+
>caption Example of integrating the SpeechToTextButton in the AIPrompt component
description: Handle the changes in the 10.0.0 release of the Telerik UI for Blazor components.
4
+
page_title: Breaking Changes in 10.0.0
5
+
slug: changes-in-10-0-0
6
+
position: 955
7
+
---
8
+
9
+
# Breaking Changes in 10.0.0
10
+
11
+
## AIPrompt
12
+
13
+
The `OnOutputRate` event and the `ShowOutputRating` parameter are removed in version 10.0.0. To implement output rating or similar actions, use an output action and handle it through the [`OnOutputActionClick` event](slug:aiprompt-events#onoutputactionclick).
14
+
15
+
The **Retry** and **Copy** actions remain built-in, but you now need to define them as part of the `OutputActions` collection. For details on how to use output actions and handle user interaction, see the [OutputActionClick event example](slug:aiprompt-events#onoutputactionclick), which demonstrates how to configure the `OutputActions` collection, including the built-in **Copy** and **Retry** actions.
Copy file name to clipboardExpand all lines: upgrade/breaking-changes/list.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ position: 0
9
9
# List of Telerik UI for Blazor Versions with Breaking Changes
10
10
11
11
This article lists the releases of the Telerik UI for Blazor product that introduce breaking changes. You may want to go through it when [upgrading](slug:upgrade-tutorial) to see whether you are affected.
Copy file name to clipboardExpand all lines: upgrade/rendering-changes/list.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ position: 0
10
10
11
11
As the Telerik UI for Blazor matures we will continuously optimize the HTML rendering and the usage of CSS classes. The rendering changes only affect the styling of the components if the application [overrides the built-in CSS styles](slug:themes-override) or uses an outdated [custom theme](slug:themes-customize). This article tracks the product versions with rendering changes.
0 commit comments