Class ConversationAttributes

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

public final class ConversationAttributes extends Object
Attributes used to create or update a Select AI conversation.

Conversation attributes control the user-visible title and description, conversation retention, and the number of conversation turns retained for contextual follow-up prompts.

For complete runnable sample sources that build ConversationAttributes, see CreateConversationSample source and SetConversationAttributesSample source.

The SDK performs basic, deterministic validation and normalization of conversation attribute values where the constraint can be evaluated independently of Oracle Database. Blank title and description values are normalized to null. When specified, retentionDays must be non-negative and conversationLength must be greater than zero. Invalid values detected by the SDK result in an IllegalArgumentException.

Database-specific and database-version-specific 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 when the conversation is created or updated.

See Also:
  • Method Details

    • builder

      Creates a builder for conversation attributes.
      Returns:
      new builder
    • getTitle

      public String getTitle()
      Returns the configured conversation title.
      Returns:
      conversation title, or null when unset
    • getDescription

      Returns the optional conversation description.
      Returns:
      optional conversation description, or null when unset
    • getRetentionDays

      Returns the conversation retention period in days.
      Returns:
      retention days value, or null when unset
    • getConversationLength

      Returns the configured conversation history length.
      Returns:
      optional conversation history length, or null when not configured
    • isEmpty

      public boolean isEmpty()
      Returns whether this instance contains no configured conversation attributes.
      Returns:
      true when no conversation attributes are configured
    • toAttributeMap

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

      Builds conversation attributes from database attribute rows.
      Parameters:
      attributes - map using DBMS_CLOUD_AI attribute names
      Returns:
      ConversationAttributes instance built from recognized map keys
    • toJson

      public String toJson()
      Serializes attributes using snake_case JSON keys expected by DBMS_CLOUD_AI.
      Returns:
      JSON string representation of this object with snake_case keys and non-null fields
    • toString

      public String toString()
      Returns a non-sensitive summary of configured conversation attributes.
      Overrides:
      toString in class Object
      Returns:
      summary string that omits title and description values