-
Notifications
You must be signed in to change notification settings - Fork 26
Created AI-powered-insights.md #1679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
8113d4e
Create AI-powered-insights.md
IvetNikolova 3f3512f
Updated AI-powered-insights.md
IvetNikolova 04d3db6
Updated AI-powered-insights.md
IvetNikolova a6b5c7e
Updated AI-powered-insights.md
IvetNikolova 46808b8
Updated the Extensibility section
IvetNikolova 3cb40d0
Updated snippets
IvetNikolova 849536d
Update AI-powered-insights.md
IvetNikolova cbd1a79
chore: added aiclient-element.md
mzanev ea450a3
Update doc-output/configure-the-report-engine/aiclient-element.md
petar-i-todorov 16d0576
Update interactivity/AI-powered-insights.md
petar-i-todorov e9d25c6
Update doc-output/configure-the-report-engine/aiclient-element.md
DimitarNikolovv06 73ac9aa
Update doc-output/configure-the-report-engine/aiclient-element.md
DimitarNikolovv06 ac7867a
Update doc-output/configure-the-report-engine/aiclient-element.md
DimitarNikolovv06 0f9f337
Update doc-output/configure-the-report-engine/aiclient-element.md
DimitarNikolovv06 f505088
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 d254766
Update doc-output/configure-the-report-engine/aiclient-element.md
DimitarNikolovv06 37112f4
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 d0af8b3
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 cf2d483
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 b91b2dd
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 7be4ee3
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 dcad00f
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 19b897d
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 dc13158
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 05817a3
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 a937224
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 6a7a5ff
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 87a3154
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 3c41bc1
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 8ecee33
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 0819125
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 212d1ad
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 3177b33
Update AI-powered-insights.md
DimitarNikolovv06 2d4a287
Update doc-output/configure-the-report-engine/aiclient-element.md
DimitarNikolovv06 8e91fa6
Update doc-output/configure-the-report-engine/aiclient-element.md
DimitarNikolovv06 a53742d
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 db496e5
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 b1551aa
Update doc-output/configure-the-report-engine/aiclient-element.md
DimitarNikolovv06 30229f1
Update interactivity/AI-powered-insights.md
DimitarNikolovv06 b2c0472
Update interactivity/AI-powered-insights.md
petar-i-todorov d1b6ea4
Update interactivity/AI-powered-insights.md
petar-i-todorov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
100 changes: 100 additions & 0 deletions
100
doc-output/configure-the-report-engine/aiclient-element.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
--- | ||
title: AIClient Element | ||
page_title: AIClient Element Configuration | ||
description: "Learn how to utilize the AIClient Element to configure the AI model used for GenAI-powered insights during report preview." | ||
slug: telerikreporting/aiclient-element | ||
tags: aiclient,element,ai | ||
published: True | ||
position: 13 | ||
--- | ||
|
||
<style> | ||
table th:first-of-type { | ||
width: 10%; | ||
} | ||
table th:nth-of-type(2) { | ||
width: 90%; | ||
} | ||
</style> | ||
|
||
# AIClient Element Overview | ||
|
||
The `AIClient` element specifies the configuration settings for the GenAI-powered insights functionality of Telerik Reporting. It is used to connect the Reporting engine to a local or remote LLM, as well as configure the behavior of the built-in Reporting AI capabilities. | ||
|
||
## Attributes and Elements | ||
|
||
__`<AIClient>` element__ | ||
|
||
| | | | ||
| ------ | ------ | | ||
|Attributes|<ul><li>__friendlyName__ - Required string attribute. Specifies the name that corresponds to the type of AI client to be used. The names of the currently supported AI client types are: `MicrosoftExtensionsAzureAIInference`, `MicrosoftExtensionsAzureOpenAI`, `MicrosoftExtensionsOllama`, and `MicrosoftExtensionsOpenAI`.</li><li>__model__ - Required string attribute. Specifies the AI model to be used for generating responses. For example, setting the model to "gpt-4o-mini" indicates that the GPT-4o mini model variant is being utilized.</li><li>__endpoint__ - Optional string attribute. If set, specifies the URL of the AI service endpoint.</li><li>__credential__ - Optional string attribute. If set, specifies the authentication credentials used to access the AI service.</li><li>__requireConsent__ - Optional boolean attribute _(true by default)_. Determines whether users must explicitly consent to the use of AI services before the AI report insights features can be utilized within the application.</li><li>__allowCustomPrompts__ - Optional boolean attribute _(true by default)_. Determines whether users are allowed to freely communicate with the AI model. If set to false, custom queries are forbidden and only the predefined prompts can be used.</li></ul>| | ||
|Child Elements|<ul><li>__predefinedPrompts__ - Optional element. Defines a list of predefined prompts that the AI client can use.</li></ul>| | ||
|Parent Element|__Telerik.Reporting__ - Configures all settings that the Telerik Reporting Engine uses.| | ||
|
||
__`<predefinedPrompts>` element__ | ||
|
||
| | | | ||
| ------ | ------ | | ||
|Attributes|None| | ||
|Child Elements|<ul><li>__add__ - Optional element. Adds a prompt to the list of predefined prompts.</li></ul>| | ||
|Parent Element|__AIClient__| | ||
|
||
__`<add>` element__ | ||
|
||
| | | | ||
| ------ | ------ | | ||
|Attributes|__text__ - The text of a predefined AI prompt.| | ||
|Child Elements|None| | ||
|Parent Element|__predefinedPrompts__| | ||
|
||
## Example | ||
|
||
The following code example demonstrates how to configure the Reporting engine with an Azure OpenAI client that uses the GPT-4o mini model variant. In addition, the AI functionality is limited to a few predefined prompts that enable it to summarize and translate the report. | ||
|
||
XML-based configuration file: | ||
|
||
````XML | ||
<?xml version="1.0"?> | ||
<configuration> | ||
<configSections> | ||
<section name="Telerik.Reporting" type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting" allowLocation="true" allowDefinition="Everywhere" /> | ||
</configSections> | ||
<Telerik.Reporting> | ||
<AIClient | ||
friendlyName="MicrosoftExtensionsAzureOpenAI" | ||
model="gpt-4o-mini" | ||
endpoint="https://ai-explorations.openai.azure.com/" | ||
credential="..." | ||
requireConsent="true" | ||
allowCustomPrompts="false"> | ||
<predefinedPrompts> | ||
<add text="Generate an executive summary of this report."/> | ||
<add text="Translate the document into German."/> | ||
</predefinedPrompts> | ||
</AIClient> | ||
</Telerik.Reporting> | ||
... | ||
</configuration> | ||
```` | ||
|
||
JSON-based configuration file: | ||
|
||
````JSON | ||
"telerikReporting": { | ||
"AIClient": { | ||
"friendlyName": "MicrosoftExtensionsAzureOpenAI", | ||
"model": "gpt-4o-mini", | ||
"endpoint": "https://ai-explorations.openai.azure.com/", | ||
"credential": "...", | ||
"requireConsent": true, | ||
"allowCustomPrompts": false, | ||
"predefinedPrompts": [ | ||
{ "text": "Generate an executive summary of this report." }, | ||
{ "text": "Translate the document into German." } | ||
] | ||
} | ||
} | ||
```` | ||
|
||
> When adding the `Telerik.Reporting` section manually, do not forget to register it in `configSections` element of the configuration file. Failing to do so will result in a [ConfigurationErrorsException](https://learn.microsoft.com/en-us/dotnet/api/system.configuration.configurationerrorsexception?view=dotnet-plat-ext-7.0) with the following text: *Configuration system failed to initialize*. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,106 @@ | ||||||
--- | ||||||
title: AI-Powered Insights in Report Preview | ||||||
page_title: AI-Powered Insights in Report Preview | ||||||
description: "Learn how to implement an AI-powered prompt UI as part of any web-based report viewer." | ||||||
slug: telerikreporting/designing-reports/adding-interactivity-to-reports/ai-powered-insights | ||||||
tags: telerik, reporting, ai | ||||||
published: True | ||||||
position: 1 | ||||||
--- | ||||||
|
||||||
# AI-Powered Insights Overview | ||||||
|
||||||
The AI-powered insights during report preview provide comprehensive capabilities, including response generation, prompt creation, AI output interaction, and execution of predefined commands. | ||||||
|
||||||
## AI Features | ||||||
|
||||||
* Ask AI: This window allows users to ask questions to the AI, facilitating dynamic responses based on the document context. | ||||||
|
||||||
* Output: This feature generates outputs from the AI, including summaries, highlights, and other predefined commands, enhancing the overall productivity and efficiency of the report viewer. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
## Configure the AI | ||||||
|
||||||
| Setting | Description | | ||||||
| ------ | ------ | | ||||||
|friendlyName|This setting specifies the name corresponding to the type of AI client you wish to use. For example, setting friendlyName to "MicrosoftExtensionsAzureOpenAI" indicates that the Azure OpenAI client is being utilized.| | ||||||
|model|This setting specifies the AI model to be used for generating responses. For example, setting the model to "gpt-4o-mini" indicates that the GPT-4o mini model variant is being utilized.| | ||||||
|endpoint|This setting specifies the URL of the AI service endpoint.| | ||||||
|credential|This setting specifies the authentication credentials required to access the AI service. It ensures that the AI client can securely connect to the specified endpoint.| | ||||||
|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.| | ||||||
|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.| | ||||||
|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.| | ||||||
|
||||||
__AI clients__ | ||||||
|
||||||
There are four available options for the `friendlyName` setting: | ||||||
|
||||||
| Client Type | Friendly Name | | ||||||
| ------ | ------ | | ||||||
|Microsoft.Extensions.AI.AzureAIInference|"MicrosoftExtensionsAzureAIInference"| | ||||||
|Microsoft.Extensions.AI.OpenAI + Azure.AI.OpenAI|"MicrosoftExtensionsAzureOpenAI"| | ||||||
|Microsoft.Extensions.AI.Ollama|"MicrosoftExtensionsOllama"| | ||||||
|Microsoft.Extensions.AI.OpenAI|"MicrosoftExtensionsOpenAI"| | ||||||
|
||||||
Depending on which option will be used, a corresponding `Telerik.Reporting.Telerik.Reporting.AI.Microsoft.Extensions.{name}` NuGet package must be installed in the project. In other words, please install one of the following packages before continuing with the configuration: | ||||||
|
||||||
- `Telerik.Reporting.AI.Microsoft.Extensions.AzureAIInference` | ||||||
- `Telerik.Reporting.AI.Microsoft.Extensions.AzureOpenAI` | ||||||
- `Telerik.Reporting.AI.Microsoft.Extensions.Ollama` | ||||||
- `Telerik.Reporting.AI.Microsoft.Extensions.OpenAI` | ||||||
|
||||||
Below is an example of how to configure the project for the `AzureOpenAI` option. | ||||||
|
||||||
````JSON | ||||||
{ | ||||||
"telerikReporting": { | ||||||
"AIClient": { | ||||||
"friendlyName": "MicrosoftExtensionsAzureOpenAI", | ||||||
"model": "gpt-4o-mini", | ||||||
"endpoint": "https://ai-explorations.openai.azure.com/", | ||||||
"credential": "...", | ||||||
"requireConsent": false, | ||||||
"allowCustomPrompts": false, | ||||||
"predefinedPrompts": [ | ||||||
{ "text": "Prompt 1" }, | ||||||
{ "text": "Prompt 2" } | ||||||
] | ||||||
} | ||||||
} | ||||||
} | ||||||
```` | ||||||
````XML | ||||||
<Telerik.Reporting> | ||||||
<AIClient | ||||||
friendlyName="MicrosoftExtensionsAzureOpenAI" | ||||||
model="gpt-4o-mini" | ||||||
endpoint="https://ai-explorations.openai.azure.com/" | ||||||
credential="..." | ||||||
requireConsent="false" | ||||||
allowCustomPrompts="false"> | ||||||
<predefinedPrompts> | ||||||
<add text="Prompt 1" /> | ||||||
<add text="Prompt 2" /> | ||||||
</predefinedPrompts> | ||||||
</AIClient> | ||||||
</Telerik.Reporting> | ||||||
```` | ||||||
|
||||||
## Extensibility | ||||||
|
||||||
If necessary, the Reporting engine can use a custom `Telerik.Reporting.AI.IClient` implementation, which can be registered in the Reporting REST Service configuration: | ||||||
|
||||||
````C# | ||||||
builder.Services.TryAddSingleton<IReportServiceConfiguration>(sp => new ReportServiceConfiguration | ||||||
{ | ||||||
HostAppId = "MyApp", | ||||||
AIClientFactory = GetCustomAIClient, | ||||||
... | ||||||
}); | ||||||
|
||||||
static Telerik.Reporting.AI.IClient GetCustomAIClient() | ||||||
{ | ||||||
return new MyCustomAIClient(...); | ||||||
} | ||||||
```` | ||||||
|
||||||
> The configured predefined prompts can be modified at runtime by overriding the `UpdateAIPrompts` method of the [ReportsController](/api/telerik.reporting.services.webapi.reportscontrollerbase) class. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.