Content

class Content @JvmOverloads constructor(val role: String? = "user", val parts: List<Part>)(source)

Represents content sent to and received from the model.

Content is composed of a one or more heterogeneous parts that can be represent data in different formats, like text or images.

Parameters

role

The producer of the content. Must be either "user" or "model". By default, it's "user".

parts

An ordered list of Part that constitute this content.

Constructors

Link copied to clipboard
constructor(role: String? = "user", parts: List<Part>)

Types

Link copied to clipboard
class Builder

Builder class to facilitate constructing complex Content objects.

Properties

Link copied to clipboard
Link copied to clipboard
val role: String?

Functions

Link copied to clipboard
fun copy(role: String? = this.role, parts: List<Part> = this.parts): Content

Returns a copy of this object, with the provided parameters overwriting the originals.