GeminiClient

GeminiClient(**kwargs)

Client for Google’s Gemini API.
Uses either either api_key for authentication from the LLM config (specifying the GOOGLE_GEMINI_API_KEY environment variable also works), or follows the Google authentication mechanism for VertexAI in Google Cloud if no api_key is specified, where project_id and location can also be passed as parameters. Previously created credentials object can be provided, or a Service account key file can also be used. If neither a service account key file, nor the api_key are passed, then the default credentials will be used, which could be a personal account if the user is already authenticated in, like in Google Cloud Shell.

Parameters:
NameDescription
**kwargs

Class Attributes

PARAMS_MAPPING



Instance Methods

cost

cost(*args, **kwargs) -> 

Call self as a function.

Parameters:
NameDescription
*args
**kwargs

create

create(*args, **kwargs) -> 

Call self as a function.

Parameters:
NameDescription
*args
**kwargs

get_usage

get_usage(*args, **kwargs) -> 

Call self as a function.

Parameters:
NameDescription
*args
**kwargs

message_retrieval

message_retrieval(*args, **kwargs) -> 

Call self as a function.

Parameters:
NameDescription
*args
**kwargs