Class FunctionResponsePart
-
- All Implemented Interfaces:
public abstract class FunctionResponsePart extends JsonSerializable
A datatype containing media that is part of a `FunctionResponse` message.
A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`.
A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classFunctionResponsePart.BuilderBuilder for FunctionResponsePart.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description FunctionResponsePart()
-
Method Summary
Modifier and Type Method Description abstract Optional<FunctionResponseBlob>inlineData()Optional. abstract Optional<FunctionResponseFileData>fileData()Optional. static FunctionResponsePart.Builderbuilder()Instantiates a builder for FunctionResponsePart. abstract FunctionResponsePart.BuildertoBuilder()Creates a builder with the same values as this instance. static FunctionResponsePartfromJson(String jsonString)Deserializes a JSON string to a FunctionResponsePart object. static FunctionResponsePartfromBytes(Array<byte> bytes, String mimeType)Constructs a FunctionResponsePart with FunctionResponseBlob from a byte array and MIME type. static FunctionResponsePartfromUri(String fileUri, String mimeType)Constructs a FunctionResponsePart with FunctionResponseFileData from a file URI and MIME type. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
inlineData
abstract Optional<FunctionResponseBlob> inlineData()
Optional. Inline media bytes.
-
fileData
abstract Optional<FunctionResponseFileData> fileData()
Optional. URI based data.
-
builder
static FunctionResponsePart.Builder builder()
Instantiates a builder for FunctionResponsePart.
-
toBuilder
abstract FunctionResponsePart.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static FunctionResponsePart fromJson(String jsonString)
Deserializes a JSON string to a FunctionResponsePart object.
-
fromBytes
static FunctionResponsePart fromBytes(Array<byte> bytes, String mimeType)
Constructs a FunctionResponsePart with FunctionResponseBlob from a byte array and MIME type.
-
fromUri
static FunctionResponsePart fromUri(String fileUri, String mimeType)
Constructs a FunctionResponsePart with FunctionResponseFileData from a file URI and MIME type.
-
-
-
-