GeminiConfig
Defined in: core/src/providers/gemini.ts:50
Standard options that any provider config can accept to configure fallbacks inline.
Extends
Section titled “Extends”Properties
Section titled “Properties”allowLegacySampling?
Section titled “allowLegacySampling?”optional allowLegacySampling?: boolean;Defined in: core/src/providers/gemini.ts:72
Forward explicit sampling on a pinned older model known to accept it. Off by default:
newer models ignore or reject temperature and topP.
apiKey
Section titled “apiKey”apiKey: string;Defined in: core/src/providers/gemini.ts:51
baseUrl?
Section titled “baseUrl?”optional baseUrl?: string;Defined in: core/src/providers/gemini.ts:55
Any endpoint speaking the Generative Language REST dialect, including a proxy or gateway. Defaults to the Generative Language API.
bearer?
Section titled “bearer?”optional bearer?: boolean;Defined in: core/src/providers/gemini.ts:61
Send the credential as Authorization: Bearer instead of x-goog-api-key
(Antigravity OAuth).
effort?
Section titled “effort?”optional effort?: "low" | "medium" | "high" | "none" | "max";Defined in: core/src/providers/gemini.ts:77
Bound default; a per-call effort overrides it.
fallbackOptions?
Section titled “fallbackOptions?”optional fallbackOptions?: FallbackOptions<Provider>;Defined in: core/src/fallback.ts:109
Custom cooldown or telemetry options for the fallback pool.
Inherited from
Section titled “Inherited from”ProviderFallbackConfig.fallbackOptions
fallbacks?
Section titled “fallbacks?”optional fallbacks?: readonly FallbackCandidate[];Defined in: core/src/fallback.ts:103
Secondary and tertiary providers to try if this provider fails/exhausts:
hand-built Providers, preset-id FallbackSpecs, or both.
Inherited from
Section titled “Inherited from”ProviderFallbackConfig.fallbacks
fetchImpl?
Section titled “fetchImpl?”optional fetchImpl?: FetchLike;Defined in: core/src/providers/gemini.ts:100
headers?
Section titled “headers?”optional headers?: Record<string, string>;Defined in: core/src/providers/gemini.ts:103
optional id?: string;Defined in: core/src/providers/gemini.ts:69
Names the provider in errors and logs.
instanceSessionId?
Section titled “instanceSessionId?”optional instanceSessionId?: string;Defined in: core/src/providers/gemini.ts:67
The id sessionHeader carries when a call has no sessionId.
jsonMode?
Section titled “jsonMode?”optional jsonMode?: boolean;Defined in: core/src/providers/gemini.ts:95
Ask for JSON without sending a schema. For calls without tools; an explicit json
schema still uses the normal schema and tool policy.
jsonWithTools?
Section titled “jsonWithTools?”optional jsonWithTools?: JsonWithTools;Defined in: core/src/providers/gemini.ts:92
How the schema rides on a call that also carries tools. See
JsonWithTools. Note that it is the model’s answer, not the
endpoint’s: measured 2026-09-07, gemini-3.5-flash and
gemini-3.5-flash-lite called their tool under responseJsonSchema every
time, while gemini-3.8-flash managed 3/10. probeJsonWithTools asks the
one you actually serve. Overridable per call.
maxTokens?
Section titled “maxTokens?”optional maxTokens?: number;Defined in: core/src/providers/gemini.ts:99
model: string;Defined in: core/src/providers/gemini.ts:52
optional path?: string;Defined in: core/src/providers/gemini.ts:58
Explicit path override when a backend has custom routing (Antigravity:
/v1internal:streamGenerateContent?alt=sse).
projectId?
Section titled “projectId?”optional projectId?: string;Defined in: core/src/providers/gemini.ts:63
Google Antigravity (Cloud Code Assist) project id for the request envelope.
redactErrors?
Section titled “redactErrors?”optional redactErrors?: boolean;Defined in: core/src/providers/gemini.ts:102
Leave the provider’s words out of every error. See PresetProviderConfig.redactErrors.
reportModelVersion?
Section titled “reportModelVersion?”optional reportModelVersion?: boolean;Defined in: core/src/providers/gemini.ts:98
Include Gemini’s reported model version in the finish chunk’s source. By default a registry or fallback keeps reporting the configured model, for its price lookup.
resolveThinkingConfig?
Section titled “resolveThinkingConfig?”optional resolveThinkingConfig?: (effort, model) => | GeminiThinkingConfig | undefined;Defined in: core/src/providers/gemini.ts:83
Replace the thinking settings for the effective effort and model (without models/).
Return undefined to use Core’s default. Not called when no effort is set.
Use only with Gemini endpoints that accept these settings. Not supported on Antigravity.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
effort |
"low" | "medium" | "high" | "none" | "max" |
model |
string |
Returns
Section titled “Returns”| GeminiThinkingConfig
| undefined
servesHostedTools?
Section titled “servesHostedTools?”optional servesHostedTools?: readonly ( | "web_search" | "web_fetch" | "code_execution" | "file_search" | "image_generation")[];Defined in: core/src/providers/gemini.ts:112
For providers imported from @providerkit/core/hosted.
The hosted tools this endpoint runs. Defaults to web search, web fetch,
code execution and file search on the Gemini API
(generativelanguage.googleapis.com), and to none anywhere else. Vertex
and the gateways differ, and one that ignores a tool answers unsearched
without saying so. Antigravity runs none.
sessionHeader?
Section titled “sessionHeader?”optional sessionHeader?: string;Defined in: core/src/providers/gemini.ts:65
Header that carries StreamOptions.sessionId.
settleUsageOnTerminalError?
Section titled “settleUsageOnTerminalError?”optional settleUsageOnTerminalError?: boolean;Defined in: core/src/providers/gemini.ts:75
Read the trailing usage frames after a terminal model error before throwing it. Use with a deadline on the request. This does not make a failed reply usable.
watchdog?
Section titled “watchdog?”optional watchdog?: WatchdogOptions;Defined in: core/src/fallback.ts:107
Watch every candidate separately. A silent candidate then times out and rotates; wrapping the completed pool would abort the whole chain instead. Fallback specs inherit this unless they set their own watchdog.