Skip to content

Commit 911e928

Browse files
committed
Sync with Kendo UI Professional
1 parent f1a9d96 commit 911e928

File tree

27 files changed

+1843
-30
lines changed

27 files changed

+1843
-30
lines changed

docs-aspnet/backwards-compatibility/2025-backwards-compatibility.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ The ActionSheet's action buttons now accept enums for the `FillMode`, `Rounded`,
1919
### AIPrompt
2020

2121
* The `ShowOutputRating()` option of the AIPrompt HtmlHelper {% if site.core %} and `show-output-rating` attribute of AIPrompt TagHelper{% endif %} is deprecated. Use [`OutputActions()`](/api/kendo.mvc.ui.fluent/aipromptbuilder#outputactionsactionaipromptoutputactionfactory) configuration option that is more flexible.
22-
23-
* The `outputRatingChange` event is deprecated. Use `outputAction` instead.
24-
25-
* The `outputCopy` event is deprecated. Use `outputAction` event instead.
22+
* The `OutputRatingChange` event is deprecated. Use `OutputAction` instead.
23+
* The `OutputCopy` event is deprecated. Use `OutputAction` event instead.
24+
* The `k-prompt-suggestion` class on the `role='listitem'` element has been replaced with the `k-suggestion` class.
2625

2726
{% if site.core %}
2827
### TabStrip

docs-aspnet/html-helpers/conversational-ui/aiprompt/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Events
33
page_title: Events
44
description: "Learn how to handle the events of the Telerik UI AIPrompt component for {{ site.framework }}."
55
slug: htmlhelpers_events_aiprompt
6-
position: 4
6+
position: 6
77
---
88

99
# Events
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
title: Output Actions
3+
page_title: Telerik UI AIPrompt Documentation - Output Actions
4+
description: "Configure built-in and custom actions that can be applied to the generated output of the Telerik UI for {{ site.framework }} AIPrompt component."
5+
slug: htmlhelpers_output_actions_aiprompt
6+
position: 3
7+
---
8+
9+
# Output Actions
10+
11+
The output actions are interactive controls shown on every generated output card in the `Output` view of the AIPrompt. Users can click these actions to copy, retry, rate, or run custom logic against the specific AI response.
12+
13+
You can use the [built-in actions](#built-in-actions) or define [custom actions](#custom-actions) to let users modify or further process the respective prompt response.
14+
15+
## Built-in Actions
16+
17+
The AIPrompt supports the following built-in output actions:
18+
19+
* `Copy()`—Copies the output content to the clipboard. The action is displayed by default.
20+
* `Retry()`—Regenerates the output using the same prompt and settings. The action is displayed by default.
21+
* `Rating()`—Shows positive and negative rating buttons so users can provide feedback.
22+
23+
To display a specified output action to the right side of the output card, define a `Spacer` element before the action.
24+
25+
```HtmlHelper
26+
@(Html.Kendo().AIPrompt()
27+
.Name("aiprompt")
28+
.OutputActions(action =>
29+
{
30+
action.Copy();
31+
action.Retry();
32+
action.Custom().Type(ItemType.Spacer);
33+
action.Rating();
34+
})
35+
)
36+
```
37+
{% if site.core %}
38+
```TagHelper
39+
@addTagHelper *, Kendo.Mvc
40+
41+
<kendo-aiprompt name="aiprompt">
42+
<output-actions>
43+
<aiprompt-output-action command="copy" />
44+
<aiprompt-output-action command="retry" />
45+
<aiprompt-output-action type="ItemType.Spacer" />
46+
<aiprompt-output-action command="rating" />
47+
</output-actions>
48+
</kendo-aiprompt>
49+
```
50+
{% endif %}
51+
52+
## Custom Actions
53+
54+
Custom actions let you add domain-specific commands, such as **Export**, **Translate**, **Summarize**, and more.
55+
56+
The custom output actions support the following appearance options:
57+
58+
| Option | Description |
59+
|---|---|
60+
| `Comamnd()` | Defines the name of the action (a command identifier). |
61+
| `Type()` | Sets the command type (a `Button` or a `Spacer`). |
62+
| `Icon()` | Specifies an icon for the button. |
63+
| `FillMode()` | Defines how the color is applied to the action button. |
64+
| `Rounded()` | Determines the border radius of the button. |
65+
| `ThemeColor()` | Sest what color will be applied to the button. |
66+
| `Text()` | Sets the button's text. |
67+
| `Title()` | Configures a title to the button's element (a tooltip). |
68+
69+
When a custom action is clicked, the AIPrompt triggers the `OutputAction` client-side event. You can handle the event, identify the selected action, and implement the desired custom logic.
70+
71+
The example below shows how to define custom output actions and handle their `click` events.
72+
73+
```HtmlHelper
74+
@(Html.Kendo().AIPrompt()
75+
.Name("aiprompt")
76+
.OutputActions(action =>
77+
{
78+
action.Custom().Icon("heart-outline").Command("like");
79+
action.Custom().Text("Share").Icon("share").Command("share");
80+
})
81+
.Events(ev => ev.OutputAction("onOutputAction"))
82+
)
83+
```
84+
{% if site.core %}
85+
```TagHelper
86+
@addTagHelper *, Kendo.Mvc
87+
88+
<kendo-aiprompt name="aiprompt" on-output-action="onOutputAction">
89+
<output-actions>
90+
<aiprompt-output-action type="ItemType.Button" command="like" icon="heart-outline" />
91+
<aiprompt-output-action type="ItemType.Button" text="Share" command="share" icon="share" />
92+
</output-actions>
93+
</kendo-aiprompt>
94+
```
95+
{% endif %}
96+
```JS Scripts
97+
<script>
98+
function onOutputAction (e) {
99+
if (e.command === "like") {
100+
let output = e.output; // The output text content associated with the action.
101+
// For example, store the liked output result.
102+
} else if (e.command === "share") {
103+
let output = e.output;
104+
let prompt = e.prompt; // The prompt text that was used to generate the output.
105+
// For example, redirect the user to a social media.
106+
}
107+
}
108+
</script>
109+
```
110+
111+
## See Also
112+
113+
* [Output Actions in the AIPrompt for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/aiprompt/output-actions)
114+
* [Configuring the AIPrompt Templates]({% slug htmlhelpers_templates_aiprompt %})
115+
* [Server-Side API of the AIPrompt HtmlHelper](/api/aiprompt)
116+
{% if site.core %}
117+
* [Server-Side API of the AIPrompt TagHelper](/api/taghelpers/aiprompt)
118+
{% endif %}

docs-aspnet/html-helpers/conversational-ui/aiprompt/overview.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ The AIPrompt provides options for configuring its views, toolbar items, and appe
142142
## Functionality and Features
143143

144144
* [Views]({% slug htmlhelpers_views_aiprompt %})&mdash;The AIPrompt provides predefined and custom views.
145+
* [Output Actions]({% slug htmlhelpers_output_actions_aiprompt %})&mdash;Configure actions on each output card to act on the generated response.
145146
* [Templates]({% slug htmlhelpers_templates_aiprompt %})&mdash;The available templates allow you to control the rendering of the views and prompt suggestions layout.
146-
* [Integration with Microsoft.Extensions.AI]({% slug integration_microsoft_extensions_ai %})&mdash;The AIPrompt supports using the <a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.ai?view=net-9.0-pp" target="_blank">Microsoft.Extensions.AI library</a> to provide seamless integration with various AI models and boost your workflow when connecting the AIPrompt with AI models.
147+
* [AI Chat Client Integration]({% slug htmlhelpers_streaming_integration_aiprompt %})&mdash;Connect the AIPrompt to a streaming AI chat service.
147148
* [Events]({% slug htmlhelpers_events_aiprompt %})&mdash;The component emits a variety of events that allow you to implement custom functionality.
148149
* [Accessibility]({% slug htmlhelpers_aiprompt_accessibility %})&mdash;The AIPrompt is accessible for screen readers, supports WAI-ARIA attributes, and delivers [keyboard shortcuts]({% slug keynav_aspnetcore_aiprompt %}) for faster navigation.
149150

0 commit comments

Comments
 (0)