New to Telerik Reporting? Download free 30-day trial

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
  • 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.
  • 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.
  • endpoint - Optional string attribute. If set, specifies the URL of the AI service endpoint.
  • credential - Optional string attribute. If set, specifies the authentication credentials used to access the AI service.
  • 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.
  • 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.
Child Elements
  • predefinedPrompts - Optional element. Defines a list of predefined prompts that the AI client can use.
Parent Element Telerik.Reporting - Configures all settings that the Telerik Reporting Engine uses.

<predefinedPrompts> element

Attributes None
Child Elements
  • add - Optional element. Adds a prompt to the list of predefined prompts.
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 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,
        "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 with the following text: Configuration system failed to initialize.

In this article