Class ConversationAttributes
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:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder for conversation attributes.static ConversationAttributesfromAttributeMap(Map<String, String> attributes) Builds conversation attributes from database attribute rows.Returns the configured conversation history length.Returns the optional conversation description.Returns the conversation retention period in days.getTitle()Returns the configured conversation title.booleanisEmpty()Returns whether this instance contains no configured conversation attributes.Converts attributes to DBMS_CLOUD_AI attribute names and string values.toJson()Serializes attributes using snake_case JSON keys expected by DBMS_CLOUD_AI.toString()Returns a non-sensitive summary of configured conversation attributes.
-
Method Details
-
builder
Creates a builder for conversation attributes.- Returns:
- new builder
-
getTitle
Returns the configured conversation title.- Returns:
- conversation title, or
nullwhen unset
-
getDescription
Returns the optional conversation description.- Returns:
- optional conversation description, or
nullwhen unset
-
getRetentionDays
Returns the conversation retention period in days.- Returns:
- retention days value, or
nullwhen unset
-
getConversationLength
Returns the configured conversation history length.- Returns:
- optional conversation history length, or
nullwhen not configured
-
isEmpty
Returns whether this instance contains no configured conversation attributes.- Returns:
truewhen 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
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
Returns a non-sensitive summary of configured conversation attributes.
-