Enabling AI assistant

<< Click to Display Table of Contents >>

Raynet One Data Hub > 2025.4 > Administration and User Guide > Guides and How-Tos 

Enabling AI assistant

This section explains how to configure and enable the AI assistant in Data Hub. Once set up, you can use the assistant's features as described in Using AI assistant

Prerequsites

Before proceeding, ensure you have the following:

OpenAI account

Network access to the OpenAI API from the server (ensure the domain *.openai.com is accessible)

 

papercliper

Note:

This feature requires an active OpenAI API subscription. For more details, visit https://openai.com/api/pricing/.

 

Set-up (Windows)

It is recommended to perform this step before installing Data Hub. If configured afterward, you may need to restart the service (e.g., by running iisreset as an Administrator).

 

1.Ensure you have an active OpenAI account: https://platform.openai.com

2.Log in using your credentials.

3.Generate a new API key for your project: https://platform.openai.com/api-keys

4.Create an environment variable named AiManagement__ApiKey and set its value to the API key.

 

Set-up (Docker)

Important: This method stores the API key in a configuration file, which poses a security risk. To avoid exposure, use Docker secrets or other secure storage mechanisms (e.g., Docker secrets, vault services).

 

1.Ensure you have an active OpenAI account: https://platform.openai.com

2.Log in using your credentials.

3.Generate a new API key for your project: https://platform.openai.com/api-keys

4.In your docker-compose file, add the environment variable AiManagement__ApiKey, setting its value to the API key.

 

Changing the model

By default, Data Hub uses the gpt-4o-2024-11-20 model, offering an optimal balance of performance, features, intelligence, and cost-efficiency.

 

To change the model set the environment variable AiManagement__Model to the desired model name.

 

Alternative Configuration via appsettings.json

Instead of using environment variables, you can configure the AI assistant directly in the appsettings.json file located in the Data Hub installation directory. This method provides a centralized configuration approach, particularly useful for advanced scenarios.

 

Add or modify the following section in the appsettings.json file:

 

Configuration Structure:

 

Property

Description

ApiKey

Your OpenAI API key. This is required to authenticate with the OpenAI service.

Model

The OpenAI model to use. Default is gpt-4o-2024-11-20. You can specify any available OpenAI model name.

Url

Optional. The API endpoint URL. By default, Data Hub uses the standard OpenAI API endpoint. This setting allows you to specify a custom endpoint, such as when using Azure OpenAI Service or other OpenAI-compatible services.

 

Configuration Examples:

 

For standard OpenAI service, leave the Url property empty. Data Hub will automatically use the default OpenAI API endpoint.

 

For Azure OpenAI Service or other custom endpoints, specify the full endpoint URL in the Url property.

 

papercliper

Security Note:

Storing API keys directly in configuration files poses security risks. For production environments, prefer using environment variables, Docker secrets, or secure vault services. If you must use appsettings.json, ensure proper file system permissions are set to restrict access.

 

Configuration Priority:

Environment variables take precedence over appsettings.json values. If both are configured, the environment variable value will be used.