Class FunctionResponsePart

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.FunctionResponsePart

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.

  • Constructor Details

    • FunctionResponsePart

      public FunctionResponsePart()
  • Method Details

    • inlineData

      public abstract Optional<FunctionResponseBlob> inlineData()
      Inline media bytes.
    • fileData

      public abstract Optional<FunctionResponseFileData> fileData()
      URI based data.
    • mediaProcessing

      public abstract Optional<MediaProcessing> mediaProcessing()
      Optional. Processes this part's media for understanding. Only meaningful for video parts (`inline_data` or `file_data` with video mime). Non-video parts ignore this field.
    • mediaResolution

      public abstract Optional<PartMediaResolution> mediaResolution()
      Media resolution for the input media.
    • videoMetadata

      public abstract Optional<VideoMetadata> videoMetadata()
      Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
    • documentMetadata

      public abstract Optional<DocumentMetadata> documentMetadata()
      Document metadata. The metadata should only be specified while the document data is presented in inline_data or file_data.
    • spreadsheetMetadata

      public abstract Optional<SpreadsheetMetadata> spreadsheetMetadata()
      Spreadsheet metadata. The metadata should only be specified while the spreadsheet data is presented in inline_data or file_data.
    • audioMetadata

      public abstract Optional<AudioMetadata> audioMetadata()
      Audio metadata. The metadata should only be specified while the audio data is presented in inline_data or file_data.
    • builder

      public static FunctionResponsePart.Builder builder()
      Instantiates a builder for FunctionResponsePart.
    • toBuilder

      public abstract FunctionResponsePart.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static FunctionResponsePart fromJson(String jsonString)
      Deserializes a JSON string to a FunctionResponsePart object.
    • fromBytes

      public static FunctionResponsePart fromBytes(byte[] bytes, String mimeType)
      Constructs a FunctionResponsePart with FunctionResponseBlob from a byte array and MIME type.
    • fromUri

      public static FunctionResponsePart fromUri(String fileUri, String mimeType)
      Constructs a FunctionResponsePart with FunctionResponseFileData from a file URI and MIME type.