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. The result of executing the ExecutableCode.

    • codeExecutionResult

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

      codeExecutionResult: Optional. The 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 intended 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 intended 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. The URI-based data of the part. This can be used to include files from Google Cloud Storage.

    • fileData

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

      fileData: Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.

    • 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 function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.

    • functionCall

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

      functionCall: Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.

    • 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 of a function call. This is used to provide the model with the result of a function call that it predicted.

    • functionResponse

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

      functionResponse: Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.

    • 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. The inline data content of the part. This can be used to include images, audio, or video in a request.

    • inlineData

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

      inlineData: Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.

    • 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. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.

    • 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 whether the `part` represents the model's thought process or reasoning.

    • 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()