Http Api Client
Base client for the HTTP APIs. This is for internal use only.
Constructors
Link copied to clipboard
public void HttpApiClient(Optional<String> apiKey, Optional<HttpOptions> httpOptions, Optional<ClientOptions> clientOptions)
Constructs an ApiClient for Google AI APIs.
public void HttpApiClient(Optional<String> apiKey, Optional<String> project, Optional<String> location, Optional<GoogleCredentials> credentials, Optional<HttpOptions> httpOptions, Optional<ClientOptions> clientOptions)
Constructs an ApiClient for Vertex AI APIs.
Functions
Link copied to clipboard
public CompletableFuture<ApiResponse> asyncRequest(String httpMethod, String url, Array<byte> requestBytes, Optional<HttpOptions> requestHttpOptions)
Sends an asynchronous Http request given the http method, path, request bytes, and http options.
public CompletableFuture<ApiResponse> asyncRequest(String httpMethod, String path, String requestJson, Optional<HttpOptions> requestHttpOptions)
Sends an asynchronous Http request given the http method, path, request json string, and http options.
Link copied to clipboard
Returns the GoogleCredentials for Vertex AI APIs.
Link copied to clipboard
Returns the custom base URL if provided.
Link copied to clipboard
Returns the default environment variables for the client.
Link copied to clipboard
Returns the HttpClient for API calls.
Link copied to clipboard
Returns the HTTP options for API calls.
Link copied to clipboard
public HttpApiResponse request(String httpMethod, String url, Array<byte> requestBytes, Optional<HttpOptions> requestHttpOptions)
Sends a Http request given the http method, path, request bytes, and http options.
public HttpApiResponse request(String httpMethod, String path, String requestJson, Optional<HttpOptions> requestHttpOptions)
Sends a Http request given the http method, path, request json string, and http options.
Link copied to clipboard
public static void setDefaultBaseUrls(Optional<String> geminiBaseUrl, Optional<String> vertexBaseUrl)
Overrides the base URLs for the Gemini API and/or Vertex AI API.