Package com.google.genai.types
Class Content
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.Content
Contains the multi-part content of a message.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
objectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Content.Builderbuilder()Instantiates a builder for Content.static ContentDeserializes a JSON string to a Content object.parts()List of parts that constitute a single message.role()Optional.abstract Content.BuilderCreates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, toJson, toJsonNode, toJsonString
-
Constructor Details
-
Content
public Content()
-
-
Method Details
-
parts
List of parts that constitute a single message. Each part may have a different IANA MIME type. -
role
Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset. If role is not specified, SDK will determine the role. -
builder
Instantiates a builder for Content. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a Content object.
-