Package com.google.genai
Class Client.Builder
java.lang.Object
com.google.genai.Client.Builder
- Enclosing class:
- Client
Builder for
Client.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the API key for the Gemini Developer API or the Gemini Enterprise API.asyncRetryScheduler(ScheduledExecutorService asyncRetryScheduler) Sets theScheduledExecutorServicefor async retries in GAOS.build()Builds theClientinstance.clientOptions(ClientOptions clientOptions) Sets theClientOptionsfor the API client.credentials(com.google.auth.oauth2.GoogleCredentials credentials) Sets theGoogleCredentialsfor the Gemini Enterprise API.enterprise(boolean enterprise) Sets whether to use the Gemini Enterprise API.httpOptions(HttpOptions httpOptions) Sets theHttpOptionsfor the API client.Sets the location for the Gemini Enterprise API.Sets the project ID for the Gemini Enterprise API.vertexAI(boolean vertexAI) Sets whether to use the Gemini Enterprise API.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Builds theClientinstance. -
apiKey
Sets the API key for the Gemini Developer API or the Gemini Enterprise API. -
project
Sets the project ID for the Gemini Enterprise API. -
location
Sets the location for the Gemini Enterprise API. -
credentials
@CanIgnoreReturnValue public Client.Builder credentials(com.google.auth.oauth2.GoogleCredentials credentials) Sets theGoogleCredentialsfor the Gemini Enterprise API. -
clientOptions
Sets theClientOptionsfor the API client. -
httpOptions
Sets theHttpOptionsfor the API client. -
enterprise
Sets whether to use the Gemini Enterprise API. When both enterprise and vertexAI are set, and they have different values, an IllegalArgumentException will be thrown. -
vertexAI
Sets whether to use the Gemini Enterprise API. Preferenterprise(boolean). -
asyncRetryScheduler
@CanIgnoreReturnValue public Client.Builder asyncRetryScheduler(ScheduledExecutorService asyncRetryScheduler) Sets theScheduledExecutorServicefor async retries in GAOS.
-