ProtectedbaseProtectedcachedThe last successful discovery, while younger than modelCacheTtlMs (default 5 min; 0 disables).
ProtectedclassifyProvider-specific reading of an error body. Return the fields you can
tell from it (code, providerCode, hint, retryAfterMs); the status
code default fills the rest.
ProtectederrorA fresh AIError for a failure this provider detects itself (no key, no model, blocked answer).
ProtectederrorOptionalmodel: stringProtectedfailOptionalmodelUsed: stringProtectedhttpJSON request. Non-2xx throws [HttpError]; the JSON body (if any) is on .json.
ProtectedhttpJSON request with the reply's status and headers (request ids live there).
ProtectedhttpStreaming request: the body as an async iterable of bytes, idle-guarded. Non-2xx throws [HttpError].
ProtectedokGemini's streamGenerateContent, read as server-sent events.
Same body as [process] -- system instruction, JSON mode and schema all travel unchanged -- so a streamed answer is the same answer, delivered in pieces. A frame that does not parse is skipped rather than thrown on.
ProtectedrequestThe per-request knobs (signal, timeouts) as http options.
ProtectedsetRecords what discovery found, keeping any seeded models first so the caller's chosen default stays the default.
Cheap by default: "up" means at least one model can be listed. No generation is sent.
ProtectedtoAny thrown value → AIError carrying this provider's classification.
Optionalmodel: string
Origin this provider talks to; shown in
PROVIDER_UNREACHABLEhints.