Skip to content

Commit bb3bd67

Browse files
docs: address ai insights recommendations (#1810)
* docs: address ai insights recommendations * docs: further refinements * chore: delete outdated images * Update AI-powered-insights.md --------- Co-authored-by: Dimitar Nikolov <[email protected]>
1 parent 380c306 commit bb3bd67

File tree

6 files changed

+26
-121
lines changed

6 files changed

+26
-121
lines changed

embedding-reports/display-reports-in-applications/web-application/ai-interactivity.md

Lines changed: 0 additions & 91 deletions
This file was deleted.

interactivity/AI-powered-insights.md

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: AI-Powered Insights in Report Preview
2+
title: AI-Powered Insights
33
page_title: AI-Powered Insights in Report Preview
44
description: "Learn how to implement an AI-powered prompt UI as part of any web-based report viewer."
55
slug: telerikreporting/designing-reports/adding-interactivity-to-reports/ai-powered-insights
@@ -12,14 +12,15 @@ position: 1
1212

1313
**AI Insights** is an AI-powered feature available during the report preview. It enables users to execute predefined or custom prompts on the core data of the previewed report, uncovering valuable insights, generating summaries, or answering specific questions. The feature also supports fine-tuning of the embedded Retrieval-Augmented Generation (RAG) algorithms, optimizing them to deliver accurate responses while minimizing token consumption.
1414

15+
>tip For a working example of this functionality, check the [AI Insights Report Demo](https://demos.telerik.com/reporting/ai-insights).
16+
1517
![The UI of the AI system after configuration.](images/angular-report-viewer-with-ai-insights.png)
1618

1719
## Feature Concept
1820

19-
To bring the power of Generative AI (GenAI) into reporting workflows, we are introducing a **AI Prompt** dialog that integrates seamlessly in the report viewers. The dialog provides a convenient UI for sending predefined or custom prompts to an AI model, configured in the Reporting REST Service. The prompts and responses returned from the AI model are displayed in the Output panel of the dialog, allowing for easier tracking of the conversation.
20-
21+
To bring the power of Generative AI (GenAI) into reporting workflows, we are introducing an **AI Prompt** dialog that integrates seamlessly in the report viewers. The dialog provides a convenient UI for sending predefined or custom prompts to an AI model, configured in the Reporting REST Service. The prompts and responses returned from the AI model are displayed in the Output panel of the dialog, allowing for easier tracking of the conversation.
2122

22-
**TODO**: explain about the context that is kept within one report and is cleared when changing the report parameters or navigating to another report.
23+
The AI conversation maintains context throughout user's interaction with a specific report. All previous questions and responses are preserved and sent to the AI model as context, enabling more coherent and contextually relevant conversations. However, this context is automatically cleared when report parameters are changed or when navigating to a different report, ensuring that each report session starts with a fresh conversation thread.
2324

2425
The feature is supported by all [web report viewers]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/html5-report-viewer/overview%}) and by the [WPF Report Viewer]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/wpf-application/overview%}) connected to a remote Reporting REST Service.
2526

@@ -33,30 +34,25 @@ The feature is supported by all [web report viewers]({%slug telerikreporting/usi
3334
Alternatively, you may disable the feature by setting the _AIClient allowRAG_ attribute to _false_.
3435

3536
- **Predefined Summary Prompts**
36-
Users can choose from a set of **predefined prompts** tailored for common tasks like summarization, explanation, and data insights—boosting efficiency with minimal effort.
37+
Users can choose from a set of predefined prompts tailored for common tasks like summarization, explanation, and data insights—boosting efficiency with minimal effort.
3738

38-
- **Custom AI Prompts**
39-
Besides the predefined prompts, you can choose to allow custom prompts to be made by the end-users of the application.
39+
- **Custom AI Prompts**
40+
Besides the predefined prompts, users can create and use custom prompts through the UI.
4041

4142
- **End-User Consent for Data Sharing**
42-
To ensure transparency and compliance, the **AI Prompt** will **request explicit consent** from users before sharing any data with GenAI services.
43+
To ensure transparency and compliance, the AI Prompt requests explicit consent from users before sharing any data with GenAI services.
4344

44-
- **Flexible Context Selection**
45-
Users can define the scope of the prompt by selecting:
46-
47-
* The **entire document**
48-
* A **specific page**
49-
* A **range of pages**
45+
<img src="images/predefined-prompts.png" style="border: 1px solid lightgray; width: 500px" alt="Image of the Prompt UI" />
5046

51-
<img src="images/AskAIPrompt-updated.png" style="border: 1px solid lightgray" alt="Image of the Prompt UI" />
47+
## User Consent
5248

53-
## User Consent for AI Summaries
49+
Before using the AI Prompt dialog, users must give consent for the AI to process their provided text. This ensures transparency and user control over their data.
5450

55-
Before using the AI Prompt Dialog, users must give consent for the AI to process their provided text. This ensures transparency and user control over their data.
51+
<img src="images/user-consent.png" style="border: 1px solid lightgray; width: 500px" alt="User Consent for AI Summaries" />
5652

57-
<img src="images/UserConsentForAI-updated.png" style="border: 1px solid lightgray" alt="User Consent for AI Summaries" />
53+
## Configuration
5854

59-
## Configure the AI
55+
To enable the AI-powered insights functionality, you must provide a valid configuration that defines the AI client, model, and other essential details such as authentication credentials. This configuration also allows you to customize various aspects of the AI functionality, including user consent requirements, custom prompt permissions, and Retrieval-Augmented Generation (RAG) settings. The AI configuration is managed through the [report engine configuration]({%slug telerikreporting/using-reports-in-applications/export-and-configure/configure-the-report-engine/overview%}). For a complete list of available settings, check the table below. For an example configuration, check the [Example](#example) section.
6056

6157
| Setting | Description |
6258
| ------ | ------ |
@@ -67,8 +63,8 @@ Before using the AI Prompt Dialog, users must give consent for the AI to process
6763
|requireConsent|A boolean configuration option that determines whether users must explicitly consent to the use of AI models before the AI report insights features can be utilized within the application.|
6864
|allowCustomPrompts|This setting is set to true by default. If you set it to `false`, users will only be able to use the predefined prompts and will not be allowed to ask custom prompts.|
6965
|predefinedPrompts|This setting specifies a list of predefined prompts that the AI client can use. Each prompt is defined by a text attribute, which contains the prompt's content.|
70-
|allowRAG|This setting specifies whether the [Retrieval-Augmented Generation (RAG)](https://en.wikipedia.org/wiki/Retrieval-augmented_generation) is allowed. The default value is _true_. Available only on projects targeting .NET and .NET Standard.|
71-
|ragSettings|These settings specify the configuration of the [Retrieval-Augmented Generation (RAG)](https://en.wikipedia.org/wiki/Retrieval-augmented_generation) when allowed by the _allowRAG_ setting. Available only on projects targeting .NET and .NET Standard.|
66+
|allowRAG|This setting specifies whether the [Retrieval-Augmented Generation (RAG)](https://en.wikipedia.org/wiki/Retrieval-augmented_generation) is allowed. The default value is _true_. Available only on projects targeting .NET8 or higher.|
67+
|ragSettings|These settings specify the configuration of the [Retrieval-Augmented Generation (RAG)](https://en.wikipedia.org/wiki/Retrieval-augmented_generation) when allowed by the _allowRAG_ setting. Available only on projects targeting .NET8 or higher.|
7268

7369
__AI clients__
7470

@@ -88,6 +84,8 @@ Depending on which option will be used, a corresponding `Telerik.Reporting.Teler
8884
- `Telerik.Reporting.AI.Microsoft.Extensions.Ollama`
8985
- `Telerik.Reporting.AI.Microsoft.Extensions.OpenAI`
9086

87+
### Example
88+
9189
Below is an example of how to configure the project for the `AzureOpenAI` option.
9290

9391
````JSON
@@ -102,8 +100,8 @@ Below is an example of how to configure the project for the `AzureOpenAI` option
102100
"allowCustomPrompts": false,
103101
"allowRAG": true,
104102
"predefinedPrompts": [
105-
{ "text": "Prompt 1" },
106-
{ "text": "Prompt 2" }
103+
{ "text": "Generate a summary of the report." },
104+
{ "text": "Translate the report into German." }
107105
],
108106
"ragSettings": {
109107
"tokenizationEncoding": "Set Encoding Name Here",
@@ -126,22 +124,21 @@ Below is an example of how to configure the project for the `AzureOpenAI` option
126124
requireConsent="false"
127125
allowCustomPrompts="false">
128126
<predefinedPrompts>
129-
<add text="Prompt 1" />
130-
<add text="Prompt 2" />
127+
<add text="Generate a summary of the report." />
128+
<add text="Translate the report into German." />
131129
</predefinedPrompts>
132130
</AIClient>
133131
</Telerik.Reporting>
134132
````
135133

136-
137134
## Customization
138135
The workflow of instantiating the AI Client and passing a request to it can be customized by overriding the following methods of the [ReportsController](/api/telerik.reporting.services.webapi.reportscontrollerbase) class:
139-
* [CreateAIThread(string, string, ClientReportSource)](/api/telerik.reporting.services.webapi.reportscontrollerbase#Telerik_Reporting_Services_WebApi_ReportsControllerBase_CreateAIThread_System_String_System_String_Telerik_Reporting_Services_WebApi_ClientReportSource_) - called when the AI Prompt dialog is to be displayed. In this method the AI Client is instantiated either using the settings provided in the application configuration file, or by using the AIClientFactory instance provided with the Reporting REST Service Configuration (see [Extensibility]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/ai-powered-insights%}#extensibility) below. Providing custom logic in the method allows to control the UI properties of the AI Prompt dialog: changing or disabling the consent message, enabling/disabling custom prompts, etc. This logic can be based on the currently previewed report, represented by the property **ClientReportSource**.
136+
* [CreateAIThread(string, string, ClientReportSource)](/api/telerik.reporting.services.webapi.reportscontrollerbase#Telerik_Reporting_Services_WebApi_ReportsControllerBase_CreateAIThread_System_String_System_String_Telerik_Reporting_Services_WebApi_ClientReportSource_) - called when the AI Prompt dialog is to be displayed. In this method, the AI Client is instantiated either using the settings provided in the application configuration file, or by using the AIClientFactory instance provided with the Reporting REST Service Configuration (see [Extensibility]({%slug telerikreporting/designing-reports/adding-interactivity-to-reports/ai-powered-insights%}#extensibility) below. Providing custom logic in the method allows to control the UI properties of the AI Prompt dialog: changing or disabling the consent message, enabling/disabling custom prompts, etc. This logic can be based on the currently previewed report, represented by the property **ClientReportSource**.
140137

141138
{{source=CodeSnippets\MvcCS\Controllers\ReportsController.cs region=ReportsController_CreateAIThread_CheckReportSource}}
142139

143140

144-
* [UpdateAIPrompts(ClientReportSource, AIThreadInfo)](/api/telerik.reporting.services.webapi.reportscontrollerbase#collapsible-Telerik_Reporting_Services_WebApi_ReportsControllerBase_UpdateAIPrompts_Telerik_Reporting_Services_WebApi_ClientReportSource_Telerik_Reporting_Services_Engine_AIThreadInfo_) - called internally during the execution of **CreateAIThread()** method. Provides easier access to the predefined prompts, allowing to alter or disable them based on a custom logic like the role of the currently logged user, or on the currently previewed report, represented by the property **ClientReportSource**.
141+
* [UpdateAIPrompts(ClientReportSource, AIThreadInfo)](/api/telerik.reporting.services.webapi.reportscontrollerbase#collapsible-Telerik_Reporting_Services_WebApi_ReportsControllerBase_UpdateAIPrompts_Telerik_Reporting_Services_WebApi_ClientReportSource_Telerik_Reporting_Services_Engine_AIThreadInfo_) - called internally during the execution of the **CreateAIThread()** method. Provides easier access to the predefined prompts, allowing to alter or disable them based on custom logic like the role of the currently logged user, or on the currently previewed report, represented by the property **ClientReportSource**.
145142

146143
{{source=CodeSnippets\MvcCS\Controllers\ReportsController.cs region=ReportsController_CreateAIThread_UpdateAIPrompts}}
147144

@@ -172,9 +169,8 @@ static Telerik.Reporting.AI.IClient GetCustomAIClient()
172169
}
173170
````
174171

175-
176172
## See Also
177173

178-
* [Overview of the AI Interactivity]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/ai-interactivity%})
174+
* [AI Insights Report Demo](https://demos.telerik.com/reporting/ai-insights)
179175
* [AIClient Element Overview]({%slug telerikreporting/aiclient-element%})
180176
* [Interface IClient](https://docs.telerik.com/reporting/api/telerik.reporting.ai.iclient)
-15.2 KB
Binary file not shown.
-14.1 KB
Binary file not shown.
33.4 KB
Loading
34.7 KB
Loading

0 commit comments

Comments
 (0)