Text

@SerialName(value = "text")
@Serializable
data class Text(val value: String) : ContentPart

A text content part.

Samples

// Create a Content.parts
val imagePartsContent = Content.Parts(
    parts = listOf(
        ContentPart.Image(ImageSource.FilePath("path/to/file.png", mimeType = MimeType.Image.Png)),
        ContentPart.Text("What do you see in the photo?")
    )
)

val message = Message(
    role = Role.User,
    content = imagePartsContent
)

// Send message to API.

Constructors

Link copied to clipboard
constructor(value: String)

Properties

Link copied to clipboard

The text content.