UserContent

@Serializable(with = UserContentSerializer::class)
sealed interface UserContent

The two shapes the content of a UserMessage takes on the wire: a bare string, or an array of ContentParts.

The UserMessage constructors wrap a String or a List<ContentPart> for you, so this type mostly shows up when reading a message back.

Inheritors

Types

Link copied to clipboard
class Parts(val parts: List<ContentPart>) : UserContent

Multimodal content, sent and received as a JSON array of parts.

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

Plain text, sent and received as a bare JSON string.