google.GeminiClient
The Gemini Developer API client (`generativelanguage.googleapis.com`).
Signature
class google.GeminiClientThe Gemini Developer API client (generativelanguage.googleapis.com).
This client always talks to the Developer API. There is no environment
switch that re-points it at Vertex AI — the GOOGLE_GENAI_USE_ENTERPRISE /
GOOGLE_GENAI_USE_VERTEXAI flags of the google-genai SDK are deliberately
NOT honored here, because a credential-bearing client that changes endpoint,
auth scheme and billing account behind an ambient env var is a footgun. Use
the enterprise backend by naming it: google.VertexClient.new(...), or the
"vertex/<model>" client shorthand.
Source:<builtin>/google/gemini.bamlbytes 1711–6845
Fields
model
stringapi_key
ai.Credential | nullbase_url
ai.Credential | nullrequest_body
baml.json.json | nullheaders
map<string, string> | nullquery_params
map<string, string> | nulltemperature
float | nullmax_output_tokens
int | nulltop_p
float | nulltop_k
int | nullstop_sequences
string[] | nullresponse_modalities
string[] | nullsafety_settings
google.SafetySetting[] | nullcapture_wire
boolStatic methods
new
(Creates a client. Construction reads no environment variable, so declaring one is always safe; credentials and endpoints resolve when a request is built.
Instance methods
resolved_api_key
(The request-time credential: an explicit value, else the provider's
canonical one. A missing key is a CATCHABLE configuration error, not a
panic: baml.env.get_or_panic unwinds past the catch_all +
ai.errors.normalize wrapper below, so an unset variable would take the
process down instead of surfacing as an ai.errors.Failure.
resolved_base_url
(self) -> string | null throws baml.errors.Io | baml.errors.ParseErrorThe request-time base URL, or null for the provider default.
Implementations
ai.Client for google.GeminiClient
Instance methods
id
(self) -> stringinvoke
(render
(Source:<builtin>/google/gemini.bamlbytes 5989–6546
ai.stream.StreamingClient for google.GeminiClient
Instance methods
invoke_stream
(Source:<builtin>/google/gemini.bamlbytes 6552–6843