Class Part.Builder

java.lang.Object
com.google.genai.types.Part.Builder
Enclosing class:
Part

public abstract static class Part.Builder extends Object
Builder for Part.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • mediaResolution

      public abstract Part.Builder mediaResolution(PartMediaResolution mediaResolution)
      Setter for mediaResolution.

      mediaResolution: Media resolution for the input media.

    • mediaResolution

      @CanIgnoreReturnValue public Part.Builder mediaResolution(PartMediaResolution.Builder mediaResolutionBuilder)
      Setter for mediaResolution builder.

      mediaResolution: Media resolution for the input media.

    • clearMediaResolution

      @CanIgnoreReturnValue public Part.Builder clearMediaResolution()
      Clears the value of mediaResolution field.
    • codeExecutionResult

      public abstract Part.Builder codeExecutionResult(CodeExecutionResult codeExecutionResult)
      Setter for codeExecutionResult.

      codeExecutionResult: Optional. Result of executing the [ExecutableCode].

    • codeExecutionResult

      @CanIgnoreReturnValue public Part.Builder codeExecutionResult(CodeExecutionResult.Builder codeExecutionResultBuilder)
      Setter for codeExecutionResult builder.

      codeExecutionResult: Optional. Result of executing the [ExecutableCode].

    • clearCodeExecutionResult

      @CanIgnoreReturnValue public Part.Builder clearCodeExecutionResult()
      Clears the value of codeExecutionResult field.
    • executableCode

      public abstract Part.Builder executableCode(ExecutableCode executableCode)
      Setter for executableCode.

      executableCode: Optional. Code generated by the model that is meant to be executed.

    • executableCode

      @CanIgnoreReturnValue public Part.Builder executableCode(ExecutableCode.Builder executableCodeBuilder)
      Setter for executableCode builder.

      executableCode: Optional. Code generated by the model that is meant to be executed.

    • clearExecutableCode

      @CanIgnoreReturnValue public Part.Builder clearExecutableCode()
      Clears the value of executableCode field.
    • fileData

      public abstract Part.Builder fileData(FileData fileData)
      Setter for fileData.

      fileData: Optional. URI based data.

    • fileData

      @CanIgnoreReturnValue public Part.Builder fileData(FileData.Builder fileDataBuilder)
      Setter for fileData builder.

      fileData: Optional. URI based data.

    • clearFileData

      @CanIgnoreReturnValue public Part.Builder clearFileData()
      Clears the value of fileData field.
    • functionCall

      public abstract Part.Builder functionCall(FunctionCall functionCall)
      Setter for functionCall.

      functionCall: Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.

    • functionCall

      @CanIgnoreReturnValue public Part.Builder functionCall(FunctionCall.Builder functionCallBuilder)
      Setter for functionCall builder.

      functionCall: Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.

    • clearFunctionCall

      @CanIgnoreReturnValue public Part.Builder clearFunctionCall()
      Clears the value of functionCall field.
    • functionResponse

      public abstract Part.Builder functionResponse(FunctionResponse functionResponse)
      Setter for 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.

    • functionResponse

      @CanIgnoreReturnValue public Part.Builder functionResponse(FunctionResponse.Builder functionResponseBuilder)
      Setter for functionResponse builder.

      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.

    • clearFunctionResponse

      @CanIgnoreReturnValue public Part.Builder clearFunctionResponse()
      Clears the value of functionResponse field.
    • inlineData

      public abstract Part.Builder inlineData(Blob inlineData)
      Setter for inlineData.

      inlineData: Optional. Inlined bytes data.

    • inlineData

      @CanIgnoreReturnValue public Part.Builder inlineData(Blob.Builder inlineDataBuilder)
      Setter for inlineData builder.

      inlineData: Optional. Inlined bytes data.

    • clearInlineData

      @CanIgnoreReturnValue public Part.Builder clearInlineData()
      Clears the value of inlineData field.
    • text

      public abstract Part.Builder text(String text)
      Setter for text.

      text: Optional. Text part (can be code).

    • clearText

      @CanIgnoreReturnValue public Part.Builder clearText()
      Clears the value of text field.
    • thought

      public abstract Part.Builder thought(boolean thought)
      Setter for thought.

      thought: Optional. Indicates if the part is thought from the model.

    • clearThought

      @CanIgnoreReturnValue public Part.Builder clearThought()
      Clears the value of thought field.
    • thoughtSignature

      public abstract Part.Builder thoughtSignature(byte[] thoughtSignature)
      Setter for thoughtSignature.

      thoughtSignature: Optional. An opaque signature for the thought so it can be reused in subsequent requests.

    • clearThoughtSignature

      @CanIgnoreReturnValue public Part.Builder clearThoughtSignature()
      Clears the value of thoughtSignature field.
    • videoMetadata

      public abstract Part.Builder videoMetadata(VideoMetadata videoMetadata)
      Setter for videoMetadata.

      videoMetadata: Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.

    • videoMetadata

      @CanIgnoreReturnValue public Part.Builder videoMetadata(VideoMetadata.Builder videoMetadataBuilder)
      Setter for videoMetadata builder.

      videoMetadata: Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.

    • clearVideoMetadata

      @CanIgnoreReturnValue public Part.Builder clearVideoMetadata()
      Clears the value of videoMetadata field.
    • build

      public abstract Part build()