MessageContent

Represents the content of a message, which can be either a simple string or an array of content parts.

Inheritors

Types

Link copied to clipboard

Array of content parts for multimodal messages.

Link copied to clipboard
data class Text(val text: String) : MessageContent

Simple string content.

Functions

Link copied to clipboard
fun asText(): String

Extracts all text content from the message, regardless of whether it's a simple string or an array of content parts.

Link copied to clipboard
fun contains(substring: String, ignoreCase: Boolean = false): Boolean

Checks if the message content contains the specified substring.