Content

class Content


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.

Summary

Nested types

Builder class to facilitate constructing complex Content objects.

Public constructors

Content(role: String?, parts: List<Part>)

Public functions

Content
copy(role: String?, parts: List<Part>)

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

Public properties

List<Part>

An ordered list of Part that constitute this content.

String?

The producer of the content.

Public constructors

Content

Content(role: String? = "user", parts: List<Part>)
Parameters
role: String? = "user"

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

parts: List<Part>

An ordered list of Part that constitute this content.

Public functions

copy

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.

Public properties

parts

val partsList<Part>

An ordered list of Part that constitute this content.

role

val roleString?

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