Package com.google.genai.types
Class Part
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.Part
A datatype containing media content.
Exactly one field within a Part should be set, representing the specific type of content being conveyed. Using multiple fields within the same `Part` instance is considered invalid.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
objectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Part.Builderbuilder()Instantiates a builder for Part.abstract Optional<CodeExecutionResult>Optional.abstract Optional<ExecutableCode>Optional.fileData()Optional.static PartDeserializes a JSON string to a Part object.abstract Optional<FunctionCall>Optional.abstract Optional<FunctionResponse>Optional.Optional.text()Optional.thought()Indicates if the part is thought from the model.abstract Part.BuilderCreates a builder with the same values as this instance.abstract Optional<VideoMetadata>Metadata for a given video.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, toJson, toJsonNode, toJsonString
-
Constructor Details
-
Part
public Part()
-
-
Method Details
-
videoMetadata
Metadata for a given video. -
thought
Indicates if the part is thought from the model. -
codeExecutionResult
Optional. Result of executing the [ExecutableCode]. -
executableCode
Optional. Code generated by the model that is meant to be executed. -
fileData
Optional. URI based data. -
functionCall
Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values. -
functionResponse
Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model. -
inlineData
Optional. Inlined bytes data. -
text
Optional. Text part (can be code). -
builder
Instantiates a builder for Part. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a Part object.
-