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 Gemini API.build()Builds theClientinstance.clientOptions(ClientOptions clientOptions) Sets theClientOptionsfor the API client.credentials(com.google.auth.oauth2.GoogleCredentials credentials) Sets theGoogleCredentialsfor Vertex AI APIs.enterprise(boolean enterprise) Sets whether to use Gemini Enterprise Agent Platform.httpOptions(HttpOptions httpOptions) Sets theHttpOptionsfor the API client.Sets the location for Vertex AI APIs.Sets the project ID for Vertex AI APIs.vertexAI(boolean vertexAI) Sets whether to use Vertex AI APIs.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Builds theClientinstance. -
apiKey
Sets the API key for Gemini API. -
project
Sets the project ID for Vertex AI APIs. -
location
Sets the location for Vertex AI APIs. -
credentials
@CanIgnoreReturnValue public Client.Builder credentials(com.google.auth.oauth2.GoogleCredentials credentials) Sets theGoogleCredentialsfor Vertex AI APIs. -
clientOptions
Sets theClientOptionsfor the API client. -
httpOptions
Sets theHttpOptionsfor the API client. -
enterprise
Sets whether to use Gemini Enterprise Agent Platform. When both enterprise and vertexAI are set, and they have different values, an IllegalArgumentException will be thrown. -
vertexAI
Sets whether to use Vertex AI APIs.
-