Class Part.Builder

  • All Implemented Interfaces:

    
    public abstract class Part.Builder
    
                        

    Builder for Part.

    • Constructor Detail

      • Part.Builder

        Part.Builder()
    • Method Detail

      • fileData

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

      • functionCall

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

      • functionResponse

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

      • inlineData

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

      • text

         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.

      • thought

         abstract Part.Builder thought(boolean thought)

        Setter for thought.

        thought: Optional. Indicates whether the `part` represents the model's thought process or reasoning.

      • thoughtSignature

         abstract Part.Builder thoughtSignature(Array<byte> thoughtSignature)

        Setter for thoughtSignature.

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

      • videoMetadata

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

      • toolCall

         abstract Part.Builder toolCall(ToolCall toolCall)

        Setter for toolCall.

        toolCall: Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API.

      • toolCall

        @CanIgnoreReturnValue() Part.Builder toolCall(ToolCall.Builder toolCallBuilder)

        Setter for toolCall builder.

        toolCall: Server-side tool call. This field is populated when the model predicts a tool invocation that should be executed on the server. The client is expected to echo this message back to the API.

      • toolResponse

         abstract Part.Builder toolResponse(ToolResponse toolResponse)

        Setter for toolResponse.

        toolResponse: The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall.

      • toolResponse

        @CanIgnoreReturnValue() Part.Builder toolResponse(ToolResponse.Builder toolResponseBuilder)

        Setter for toolResponse builder.

        toolResponse: The output from a server-side ToolCall execution. This field is populated by the client with the results of executing the corresponding ToolCall.

      • partMetadata

         abstract Part.Builder partMetadata(Map<String, Object> partMetadata)

        Setter for partMetadata.

        partMetadata: Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. This field is not supported in Vertex AI.