Class ProfileAttributes

java.lang.Object
com.oracle.database.selectai.model.ProfileAttributes

public final class ProfileAttributes extends Object
Attribute payload for DBMS_CLOUD_AI.CREATE_PROFILE, SET_ATTRIBUTE, and SET_ATTRIBUTES.

Profile attributes describe the provider, AI model, credential, object selection, prompt behavior, conversation behavior, and RAG/vector-index settings that Select AI uses when answering prompts. Most attributes map to database-side Select AI profile settings; callers can build the payload once for profile creation or reuse it for bulk updates.

For complete runnable sample sources that build ProfileAttributes, see CreateProfileSample source and SetProfileAttributesSample source.

Commonly used profile attributes include:

Common Select AI profile attributes
Attribute Description
provider AI provider used by the profile.
credential_name Credential used to access the AI provider, where required.
model AI model used by the profile.
object_list Database objects available for NL2SQL processing.
object_list_mode Controls how database objects are selected for NL2SQL processing.
temperature Controls randomness in model-generated responses.
max_tokens Specifies the maximum number of tokens to generate.
vector_index_name Specifies the vector index associated with the profile.

The SDK performs basic, deterministic validation of profile attributes where the constraint can be validated independently of the configured provider or database version. This includes validation of supported SDK-defined values, numeric constraints, and basic input structure. Invalid values detected by the SDK result in an IllegalArgumentException.

Provider-specific, model-specific, database-version-specific, and other database-side semantic validation is delegated to DBMS_CLOUD_AI and Oracle Database. Therefore, an attribute value that passes SDK validation may still be rejected by the database based on the selected provider, model, database version, or other database-side requirements.

Supported profile attributes, valid values, defaults, requirements, and provider-specific behavior are defined by Oracle Database and may vary by database version and provider. See the DBMS_CLOUD_AI Profile Attributes documentation for the complete and current list.

See Also:
  • Method Details

    • builder

      Creates a builder for profile attributes.
      Returns:
      new builder for constructing ProfileAttributes
    • getAnnotations

      Returns whether table/column annotations are included in metadata.
      Returns:
      annotations flag value, or null when unset
    • getAdditionalInstructions

      Returns additional instructions included in Select AI prompts.
      Returns:
      additional instructions, or null when unset
    • getAzureDeploymentName

      Returns the Azure OpenAI deployment name.
      Returns:
      Azure deployment name, or null when unset
    • getAzureEmbeddingDeploymentName

      Returns the Azure OpenAI embedding deployment name.
      Returns:
      Azure embedding deployment name, or null when unset
    • getAzureResourceName

      Returns the Azure OpenAI resource name.
      Returns:
      Azure resource name, or null when unset
    • getCaseSensitiveValues

      Returns whether generated SQL value matching is case-sensitive.
      Returns:
      case-sensitive-values flag, or null when unset
    • getComments

      public Boolean getComments()
      Returns whether table and column comments are included in prompt metadata.
      Returns:
      comments flag, or null when unset
    • getConstraints

      Returns whether referential constraints are included in prompt metadata.
      Returns:
      constraints flag, or null when unset
    • getConversation

      Returns whether conversation history is enabled for the profile.
      Returns:
      conversation flag, or null when unset
    • getConversationLength

      Returns how many conversation turns are retained for context.
      Returns:
      configured conversation length, or null when unset
    • getCredentialName

      Returns the credential name used for provider API calls.
      Returns:
      credential name, or null when unset
    • getEmbeddingModel

      Returns the embedding model name.
      Returns:
      embedding model name, or null when unset
    • getEnableCustomSourceUri

      Returns whether custom source URI metadata is enabled.
      Returns:
      custom-source-URI flag, or null when unset
    • getEnforceObjectList

      Returns whether SQL generation is restricted to object_list.
      Returns:
      enforce-object-list flag, or null when unset
    • getMaxTokens

      Returns the maximum generated output tokens.
      Returns:
      maximum tokens value, or null when unset
    • getModel

      public String getModel()
      Returns the provider model identifier.
      Returns:
      provider model identifier, or null when unset
    • getObjectList

      Returns the JSON object list supplied to Select AI.
      Returns:
      object-list JSON string, or null when unset
    • getObjectListMode

      Returns how Select AI chooses objects for metadata.
      Returns:
      object-list mode value, or null when unset
    • getOciApiformat

      Returns the OCI Generative AI API format.
      Returns:
      OCI API format value, or null when unset
    • getOciCompartmentId

      Returns the OCI compartment OCID.
      Returns:
      OCI compartment ID, or null when unset
    • getOciEndpointId

      Returns the OCI dedicated endpoint OCID.
      Returns:
      OCI endpoint ID, or null when unset
    • getOciRuntimetype

      Returns the OCI runtime type attribute.
      Returns:
      OCI runtime type value, or null when unset
    • getProvider

      public String getProvider()
      Returns the AI provider name.
      Returns:
      provider name, or null when unset
    • getProviderEndpoint

      Returns the provider endpoint host/path.
      Returns:
      provider endpoint value, or null when unset
    • getRegion

      public String getRegion()
      Returns the provider region.
      Returns:
      configured region value, or null when unset
    • getRole

      public String getRole()
      Returns the role prompt used by Select AI.
      Returns:
      role prompt, or null when unset
    • getSeed

      public Long getSeed()
      Returns the deterministic sampling seed.
      Returns:
      deterministic sampling seed, or null when unset
    • getStopTokens

      Returns stop tokens used to terminate generation.
      Returns:
      configured stop-token list, or null when unset
    • getTemperature

      Returns the provider sampling temperature.
      Returns:
      sampling temperature, or null when unset
    • getVectorIndexName

      Returns the vector index name associated with this profile.
      Returns:
      vector index name, or null when unset
    • getSourceLanguage

      Returns the source language for translation requests.
      Returns:
      source language for translation, or null when unset
    • getTargetLanguage

      Returns the target language for translation requests.
      Returns:
      target language for translation, or null when unset
    • getCustomAttributes

      Returns unmodeled database attributes preserved for forward-compatible metadata round-tripping.

      These values are emitted by toAttributeMap() but excluded from toJson() to avoid sending a nested custom_attributes object to DBMS_CLOUD_AI.

      Returns:
      immutable map of custom attribute names and values
    • toAttributeMap

      Converts non-null attributes to DBMS_CLOUD_AI attribute names and string values.
      Returns:
      map containing non-null profile attributes
    • fromAttributeMap

      public static ProfileAttributes fromAttributeMap(Map<String,String> attributes)
      Builds a ProfileAttributes instance from an attribute name/value map.

      Recognized keys are converted to strongly-typed builder fields; unknown keys are accepted so metadata reads do not fail when the database exposes a newer attribute than this SDK version supports directly.

      Parameters:
      attributes - attribute map (typically DB-sourced key/value pairs)
      Returns:
      populated ProfileAttributes instance
    • toJson

      public String toJson()
      Serializes the profile attributes using snake_case JSON names.
      Returns:
      JSON representation of this ProfileAttributes instance