Package com.google.genai
Class Client
java.lang.Object
com.google.genai.Client
- All Implemented Interfaces:
AutoCloseable
Client class for GenAI.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classAsync class for GenAI.static classBuilder forClient. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapiKey()Returns the API key for Google AI APIs.static Client.Builderbuilder()Returns aClient.BuilderforClient.voidclose()Closes the Client instance together with its instantiated http client.booleanReturns whether the client is using Vertex AI APIs.location()Returns the location for Vertex AI APIs.project()Returns the project ID for Vertex AI APIs.protected voidsetReplayId(String replayId)
-
Field Details
-
models
-
async
-
-
Constructor Details
-
Client
public Client()Constructs a Client instance with environment variables.
-
-
Method Details
-
builder
Returns aClient.BuilderforClient. -
isVertexAI
public boolean isVertexAI()Returns whether the client is using Vertex AI APIs. -
project
Returns the project ID for Vertex AI APIs. -
location
Returns the location for Vertex AI APIs. -
apiKey
Returns the API key for Google AI APIs. -
setReplayId
-
close
Closes the Client instance together with its instantiated http client.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-