Class Client

java.lang.Object
com.google.genai.Client
All Implemented Interfaces:
AutoCloseable

public final class Client extends Object implements AutoCloseable
Client class for GenAI.
  • Field Details

  • Constructor Details

    • Client

      public Client()
      Constructs a Client instance with environment variables.
  • Method Details

    • builder

      public static Client.Builder builder()
      Returns a Client.Builder for Client.
    • isVertexAI

      public boolean isVertexAI()
      Returns whether the client is using Vertex AI APIs.
    • project

      public String project()
      Returns the project ID for Vertex AI APIs.
    • location

      public String location()
      Returns the location for Vertex AI APIs.
    • apiKey

      public String apiKey()
      Returns the API key for Google AI APIs.
    • setReplayId

      protected void setReplayId(String replayId)
    • close

      public void close() throws IOException
      Closes the Client instance together with its instantiated http client.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException