Package com.google.genai
Class Client.Builder
-
- All Implemented Interfaces:
public class Client.BuilderBuilder for Client.
-
-
Constructor Summary
Constructors Constructor Description Client.Builder()
-
Method Summary
Modifier and Type Method Description Clientbuild()Builds the Client instance. Client.BuilderapiKey(String apiKey)Sets the API key for Gemini API. Client.Builderproject(String project)Sets the project ID for Vertex AI APIs. Client.Builderlocation(String location)Sets the location for Vertex AI APIs. Client.Buildercredentials(GoogleCredentials credentials)Sets the GoogleCredentials for Vertex AI APIs. Client.BuilderclientOptions(ClientOptions clientOptions)Sets the ClientOptions for the API client. Client.BuilderhttpOptions(HttpOptions httpOptions)Sets the HttpOptions for the API client. Client.Builderenterprise(boolean enterprise)Sets whether to use Gemini Enterprise Agent Platform. Client.BuildervertexAI(boolean vertexAI)Sets whether to use Vertex AI APIs. -
-
Method Detail
-
apiKey
@CanIgnoreReturnValue() Client.Builder apiKey(String apiKey)
Sets the API key for Gemini API.
-
project
@CanIgnoreReturnValue() Client.Builder project(String project)
Sets the project ID for Vertex AI APIs.
-
location
@CanIgnoreReturnValue() Client.Builder location(String location)
Sets the location for Vertex AI APIs.
-
credentials
@CanIgnoreReturnValue() Client.Builder credentials(GoogleCredentials credentials)
Sets the GoogleCredentials for Vertex AI APIs.
-
clientOptions
@CanIgnoreReturnValue() Client.Builder clientOptions(ClientOptions clientOptions)
Sets the ClientOptions for the API client.
-
httpOptions
@CanIgnoreReturnValue() Client.Builder httpOptions(HttpOptions httpOptions)
Sets the HttpOptions for the API client.
-
enterprise
@CanIgnoreReturnValue() Client.Builder enterprise(boolean 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
@CanIgnoreReturnValue() Client.Builder vertexAI(boolean vertexAI)
Sets whether to use Vertex AI APIs. When both enterprise and vertexAI are set, and they have different values, an IllegalArgumentException will be thrown.
-
-
-
-