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
**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.
14
14
15
+
>tip For a working example of this functionality, check the [AI Insights Report Demo](https://demos.telerik.com/reporting/ai-insights).
16
+
15
17

16
18
17
19
## Feature Concept
18
20
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.
21
22
22
-
**TODO**: explain about the context that is kept within one reportand 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.
23
24
24
25
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.
25
26
@@ -33,30 +34,25 @@ The feature is supported by all [web report viewers]({%slug telerikreporting/usi
33
34
Alternatively, you may disable the feature by setting the _AIClient allowRAG_ attribute to _false_.
34
35
35
36
-**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.
37
38
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.
40
41
41
42
-**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.
43
44
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
+
<imgsrc="images/predefined-prompts.png"style="border: 1pxsolidlightgray; width: 500px"alt="Image of the Prompt UI" />
50
46
51
-
<imgsrc="images/AskAIPrompt-updated.png"style="border: 1pxsolidlightgray"alt="Image of the Prompt UI" />
47
+
## User Consent
52
48
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.
54
50
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
+
<imgsrc="images/user-consent.png"style="border: 1pxsolidlightgray; width: 500px"alt="User Consent for AI Summaries" />
56
52
57
-
<imgsrc="images/UserConsentForAI-updated.png"style="border: 1pxsolidlightgray"alt="User Consent for AI Summaries" />
53
+
## Configuration
58
54
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.
60
56
61
57
| Setting | Description |
62
58
| ------ | ------ |
@@ -67,8 +63,8 @@ Before using the AI Prompt Dialog, users must give consent for the AI to process
67
63
|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.|
68
64
|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.|
69
65
|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.|
72
68
73
69
__AI clients__
74
70
@@ -88,6 +84,8 @@ Depending on which option will be used, a corresponding `Telerik.Reporting.Teler
Below is an example of how to configure the project for the `AzureOpenAI` option.
92
90
93
91
````JSON
@@ -102,8 +100,8 @@ Below is an example of how to configure the project for the `AzureOpenAI` option
102
100
"allowCustomPrompts": false,
103
101
"allowRAG": true,
104
102
"predefinedPrompts": [
105
-
{ "text": "Prompt 1" },
106
-
{ "text": "Prompt 2" }
103
+
{ "text": "Generate a summary of the report." },
104
+
{ "text": "Translate the report into German." }
107
105
],
108
106
"ragSettings": {
109
107
"tokenizationEncoding": "Set Encoding Name Here",
@@ -126,22 +124,21 @@ Below is an example of how to configure the project for the `AzureOpenAI` option
126
124
requireConsent="false"
127
125
allowCustomPrompts="false">
128
126
<predefinedPrompts>
129
-
<addtext="Prompt 1" />
130
-
<addtext="Prompt 2" />
127
+
<addtext="Generate a summary of the report." />
128
+
<addtext="Translate the report into German." />
131
129
</predefinedPrompts>
132
130
</AIClient>
133
131
</Telerik.Reporting>
134
132
````
135
133
136
-
137
134
## Customization
138
135
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**.
*[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**.
*[Overview of the AI Interactivity]({%slug telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/ai-interactivity%})
0 commit comments