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 |
|
Child Elements |
|
Parent Element | Telerik.Reporting - Configures all settings that the Telerik Reporting Engine uses. |
<predefinedPrompts>
element
Attributes | None |
Child Elements |
|
Parent Element | AIClient |
<add>
element
Attributes | text - The text of a predefined AI prompt. |
Child Elements | None |
Parent Element | predefinedPrompts |
<ragSettings>
element
Attributes |
|
Parent Element | AIClient |
The
ragSettings
element is valid only in .NET and .NET Standard. It is not supported in the .NET Framework.
The ragSettings will be respected only when allowRAG is true
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 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:
"telerikReporting": {
"AIClient": {
"friendlyName": "MicrosoftExtensionsAzureOpenAI",
"model": "gpt-4o-mini",
"endpoint": "https://ai-explorations.openai.azure.com/",
"credential": "...",
"requireConsent": true,
"allowCustomPrompts": false,
"allowRAG": true,
"predefinedPrompts": [
{ "text": "Generate an executive summary of this report." },
{ "text": "Translate the document into German." }
],
"ragSettings": {
"tokenizationEncoding": "Set Encoding Name Here",
"modelMaxInputTokenLimit": 15000,
"maxNumberOfEmbeddingsSent": 15,
"maxTokenSizeOfSingleEmbedding": 0,
"splitTables": true
}
}
}
When adding the
Telerik.Reporting
section manually, do not forget to register it inconfigSections
element of the configuration file. Failing to do so will result in a ConfigurationErrorsException with the following text: Configuration system failed to initialize.