1. ProfileAttributes

This class defines attributes that manage and configure the behavior of an AI profile. ProfileAttributes objects are created with select_ai.ProfileAttributes() and passed to select_ai.Profile or select_ai.AsyncProfile when creating or updating a profile.

Profile attributes describe what the profile can access, which AI provider it uses, how much metadata is sent to the model, and how generation should behave. Provider-specific settings, such as OCI region or Azure deployment name, are configured on the provider object and assigned to the provider attribute.

1.1. Common required attributes

Most profiles need these attributes:

  • provider: A select_ai.Provider object, such as select_ai.OCIGenAIProvider or select_ai.OpenAIProvider.

  • credential_name: The database credential used to authenticate with the AI provider.

  • object_list: The schemas, tables, or views that Select AI can use when generating SQL from natural language prompts.

For example:

attributes = select_ai.ProfileAttributes(
    provider=select_ai.OCIGenAIProvider(
        region="us-chicago-1",
        oci_apiformat="GENERIC",
    ),
    credential_name="my_oci_ai_profile_key",
    object_list=[
        {"owner": "SH", "name": "CUSTOMERS"},
        {"owner": "SH", "name": "SALES"},
    ],
)

1.2. Attribute groups

Profile attribute groups

Attribute

Purpose

provider

Selects the AI provider, model, endpoint, and provider-specific options.

credential_name

Names the database credential used to authenticate with the AI provider.

object_list

Defines which schemas, tables, or views are eligible for natural language to SQL generation.

object_list_mode

Controls whether Select AI sends metadata for the most relevant objects or for all eligible objects.

enforce_object_list

Restricts generated SQL to objects in object_list.

comments, constraints, annotations

Controls whether additional database metadata is included in the prompt sent to the model.

case_sensitive_values

Helps prompts that depend on case-sensitive database values.

max_tokens, temperature, stop_tokens, seed

Tunes model generation behavior.

conversation

Enables conversation history for context-aware chat workflows.

vector_index_name, enable_sources, enable_source_offsets, enable_custom_source_uri

Configures retrieval-augmented generation and source reporting for vector index workflows.

1.3. Object list examples

Grant access to every supported object in a schema:

object_list = [{"owner": "SH"}]

Grant access to selected tables:

object_list = [
    {"owner": "SH", "name": "CUSTOMERS"},
    {"owner": "SH", "name": "SALES"},
    {"owner": "SH", "name": "PRODUCTS"},
]

Restrict generated SQL to the selected objects:

attributes = select_ai.ProfileAttributes(
    provider=provider,
    credential_name="my_oci_ai_profile_key",
    object_list=[
        {"owner": "SH", "name": "CUSTOMERS"},
        {"owner": "SH", "name": "SALES"},
    ],
    enforce_object_list=True,
)

1.4. Generation controls

Use generation controls when you need more predictable or constrained model responses:

attributes = select_ai.ProfileAttributes(
    provider=provider,
    credential_name="my_oci_ai_profile_key",
    object_list=[{"owner": "SH"}],
    max_tokens=1024,
    temperature=0.1,
    stop_tokens='[";"]',
)
class select_ai.ProfileAttributes(annotations: bool | None = None, case_sensitive_values: bool | None = None, comments: bool | None = None, constraints: bool | None = None, conversation: bool | None = None, credential_name: str | None = None, enable_custom_source_uri: bool | None = None, enable_sources: bool | None = None, enable_source_offsets: bool | None = None, enforce_object_list: bool | None = None, max_tokens: int | None = 1024, object_list: List[Mapping] | None = None, object_list_mode: str | None = None, provider: Provider | None = None, seed: str | None = None, stop_tokens: str | None = None, streaming: str | None = None, temperature: float | None = None, vector_index_name: str | None = None)

Use this class to define attributes to manage and configure the behavior of an AI profile

Parameters:
  • comments (bool) – True to include column comments in the metadata used for generating SQL queries from natural language prompts.

  • constraints (bool) – True to include referential integrity constraints such as primary and foreign keys in the metadata sent to the LLM.

  • conversation (bool) – Indicates if conversation history is enabled for a profile.

  • credential_name (str) – The name of the credential to access the AI provider APIs.

  • enforce_object_list (bool) – Specifies whether to restrict the LLM to generate SQL that uses only tables covered by the object list.

  • max_tokens (int) – Denotes the number of tokens to return per generation. Default is 1024.

  • object_list (List[Mapping]) – Array of JSON objects specifying the owner and object names that are eligible for natural language translation to SQL.

  • object_list_mode (str) – Specifies whether to send metadata for the most relevant tables or all tables to the LLM. Supported values are - ‘automated’ and ‘all’

  • provider (select_ai.Provider) – AI Provider

  • stop_tokens (str) – The generated text will be terminated at the beginning of the earliest stop sequence. Sequence will be incorporated into the text. The attribute value must be a valid array of string values in JSON format

  • temperature (float) – Temperature is a non-negative float number used to tune the degree of randomness. Lower temperatures mean less random generations.

  • vector_index_name (str) – Name of the vector index