Class Part


public abstract class Part extends JsonSerializable
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.

  • Constructor Details

    • Part

      public Part()
  • Method Details

    • videoMetadata

      public abstract Optional<VideoMetadata> videoMetadata()
      Metadata for a given video.
    • thought

      public abstract Optional<Boolean> thought()
      Indicates if the part is thought from the model.
    • inlineData

      public abstract Optional<Blob> inlineData()
      Optional. Inlined bytes data.
    • codeExecutionResult

      public abstract Optional<CodeExecutionResult> codeExecutionResult()
      Optional. Result of executing the [ExecutableCode].
    • executableCode

      public abstract Optional<ExecutableCode> executableCode()
      Optional. Code generated by the model that is meant to be executed.
    • fileData

      public abstract Optional<FileData> fileData()
      Optional. URI based data.
    • functionCall

      public abstract Optional<FunctionCall> functionCall()
      Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
    • functionResponse

      public abstract Optional<FunctionResponse> 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.
    • text

      public abstract Optional<String> text()
      Optional. Text part (can be code).
    • builder

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

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

      public static Part fromJson(String jsonString)
      Deserializes a JSON string to a Part object.
    • fromText

      public static Part fromText(String text)
      Constructs a Text Part from a text string.
    • fromUri

      public static Part fromUri(String fileUri, String mimeType)
      Constructs a FileData Part from a file URI and MIME type.
    • fromBytes

      public static Part fromBytes(byte[] bytes, String mimeType)
      Constructs a InlineData Part from a byte array and MIME type.
    • fromFunctionCall

      public static Part fromFunctionCall(String name, Map<String,Object> args)
      Constructs a FunctionCall Part from a function name and args.
    • fromFunctionResponse

      public static Part fromFunctionResponse(String name, Map<String,Object> response)
      Constructs a FunctionResponse Part from a function name and response.