Skip to content

AI assistance settings

To use the AI assistance in Team Edition, you’ll need to complete a few setup steps. This article explains how to add your service credentials, and adjust specific settings for your AI service.

Basic setup

AI assistance is enabled by default. Switch the provider using the Service dropdown menu. Supported providers:

  • OpenAI
  • GitHub Copilot
  • Azure OpenAI
  • Gemini
  • Ollama

To get started, follow this guide to add your service keys and configure settings specific to the AI service you’re using:

OpenAI

  1. Sign up on the OpenAI platform.
  2. Navigate to the API Keys section and generate a new secret key.
  3. In Team Edition, go to Engine Settings and insert this key into API token field.
  4. Choose the model.

    Team Edition currently supports:

    • gpt-3.5-turbo (recommended for SQL).
    • gpt-3.5-turbo-instruct.
    • gpt-4.
    • gpt-4-turbo.
    • gpt-4o.
    • gpt-4o-mini.
  5. Apply the changes.

Note

OpenAI services are available in specific countries. Consult the supported countries list to verify availability in your location.

GitHub Copilot

  1. Sign in to your GitHub account.
  2. Go to the GitHub Copilot page and activate a free trial or subscription.
  3. In Team Edition, go to Engine Settings and select GitHub Copilot.
  4. Click Generate code to get your OAuth code.
  5. Click Copy - this opens the GitHub authorization page.
  6. Paste the code, confirm access, and authorize the GitHub Copilot plugin.
  7. After completing the OAuth flow, the access token will be filled in automatically in Team Edition.
  8. Choose the model.

    Team Edition currently supports:

    • gpt-3.5-turbo (recommended for SQL).
    • gpt-4.
  9. Apply the changes.

Azure AI

  1. Sign up on the Azure platform.
  2. Navigate to the Azure Portal and create a new AI service under the AI + Machine Learning section.
  3. Generate and copy the credentials for the newly created service.
  4. Insert these credentials into Team Edition's Engine Settings.
  5. Apply the changes.

Google Gemini

  1. Sign up on the Google Cloud Platform.
  2. Navigate to the Google Cloud Console and create a new project.
  3. Enable the Gemini API for your project by searching for the Gemini API in the marketplace and clicking Enable.
  4. Create credentials for your project by navigating to the Credentials page under APIs & Services. Choose Create credentials and select the appropriate type for your Gemini integration.
  5. Copy the generated credentials.
  6. Insert these credentials into Team Edition's Engine Settings.
  7. Apply the changes.

Note

Google Gemini services are subject to regional availability. Check the list of available regions to ensure access in your area.

Ollama

Ensure that Ollama is already installed and running on a server. You will need the host address where Ollama is installed to proceed.

  1. Specify the host address of your Ollama server in the Instance host field, ensuring it follows the format http://host:port.
  2. Click Load Models. If the host address is correct, Team Edition will display the available models from your Ollama server in the Model dropdown menu.
  3. Select the model you need for your integration.
  4. Apply the changes.

AI integration configuration

For configuring engine configuration, navigate to Window -> Preferences -> General -> AI.

Setting Description
API token Input your secret key from the provider platform.
Model Choose the AI model.
Temperature Control AI's creativity from 0.0 (more precise) to 0.9 (more diverse).
Note that higher temperature can lead to less predictable results.
Write GPT/Ollama queries to debug log Logs your AI requests. For more details on logging, see Log Viewer.
Endpoint Configure a custom endpoint URL for Azure OpenAPI interactions.
API version Select the version of the API you wish to use.
Deployment Specify the deployment name chosen during model deployment.
Context size Choose the context size between 2048 and 32768. A larger number allows the AI to use more data for better answers but may slow down response time. Choose based on your balance of accuracy and speed.

Note

The availability of Engine settings may vary depending on the AI provider you are using.

AI assistant configuration

For configuring specific settings, navigate to Window -> Preferences -> General -> AI -> Configuration.

SQL Completion

Setting Description
Enable AI integration Displays the AI assistance in the SQL Editor.
Include source in query comment Shows your original request above the AI-generated query in the SQL Editor.
Execute SQL immediately Runs the translated SQL query immediately after generation.
Send attribute type information Send attribute type information to the AI provider. It makes better completion, but consumes more tokens.
Send object description Send object description to the AI provider. Improves completion, but may consume significant amount of tokens.
Format SQL query Adds formatting to the generated SQL. Uses database-default case.
Table join rule Choose between explicit JOIN or JOIN with sub-queries.
Send previous AI chat answers Sends previous assistant responses to the AI provider. This can improve completion quality but increases token usage. Can be skipped if not required.
Enable AI query suggestion Triggers smart SQL text suggestions using a shortcut. Suggestions are based on the current query and comments.

Send database structure

Setting Description
Send foreign keys information Helps AI understand table relationships.
Send unique and primary keys information Sends unique and primary key metadata to the AI provider. Improves the quality of query generation, especially for joins and constraints, but uses more tokens.

Sample data

You can send a few rows of real data to the AI provider. This helps the AI understand your table structure and content better, so it can generate more accurate queries.

Setting Description
Send sample data Sends sample data to the AI provider. Improves completion quality, but increases token usage.
Sample data row count Sets how many rows to include when sending sample data. Used only if Send sample data is enabled.