Class HttpOptions.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • baseUrl

      public abstract HttpOptions.Builder baseUrl(String baseUrl)
      Setter for baseUrl.

      baseUrl: The base URL for the AI platform service endpoint.

    • clearBaseUrl

      @CanIgnoreReturnValue public HttpOptions.Builder clearBaseUrl()
      Clears the value of baseUrl field.
    • apiVersion

      public abstract HttpOptions.Builder apiVersion(String apiVersion)
      Setter for apiVersion.

      apiVersion: Specifies the version of the API to use.

    • clearApiVersion

      @CanIgnoreReturnValue public HttpOptions.Builder clearApiVersion()
      Clears the value of apiVersion field.
    • headers

      public abstract HttpOptions.Builder headers(Map<String,String> headers)
      Setter for headers.

      headers: Additional HTTP headers to be sent with the request.

    • clearHeaders

      @CanIgnoreReturnValue public HttpOptions.Builder clearHeaders()
      Clears the value of headers field.
    • timeout

      public abstract HttpOptions.Builder timeout(Integer timeout)
      Setter for timeout.

      timeout: Timeout for the request in milliseconds.

    • clearTimeout

      @CanIgnoreReturnValue public HttpOptions.Builder clearTimeout()
      Clears the value of timeout field.
    • extraBody

      public abstract HttpOptions.Builder extraBody(Map<String,Object> extraBody)
      Setter for extraBody.

      extraBody: Extra parameters to add to the request body. The structure must match the backend API's request structure. - VertexAI backend API docs: https://cloud.google.com/vertex-ai/docs/reference/rest - GeminiAPI backend API docs: https://ai.google.dev/api/rest

    • clearExtraBody

      @CanIgnoreReturnValue public HttpOptions.Builder clearExtraBody()
      Clears the value of extraBody field.
    • retryOptions

      public abstract HttpOptions.Builder retryOptions(HttpRetryOptions retryOptions)
      Setter for retryOptions.

      retryOptions: HTTP retry options for the request.

    • retryOptions

      @CanIgnoreReturnValue public HttpOptions.Builder retryOptions(HttpRetryOptions.Builder retryOptionsBuilder)
      Setter for retryOptions builder.

      retryOptions: HTTP retry options for the request.

    • clearRetryOptions

      @CanIgnoreReturnValue public HttpOptions.Builder clearRetryOptions()
      Clears the value of retryOptions field.
    • build

      public abstract HttpOptions build()