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. How the model 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. This field is not supported in Vertex AI.
    • 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.