Skip to content
4 min read · 743 words

Interface: GeminiGenerateContentAdapterOptions ​

Defined in: src/batteries/llm/gemini_generate_content/types.ts:343

Constructor and per-dispatch options.

Remarks ​

Layered exactly like the other batteries: constructor baseline, then executor-scope overrides, then per-iteration ctx.stash overrides, re-validated each iteration.

Properties ​

PropertyTypeDescriptionDefined in
apiKey?stringAPI key. Sent as x-goog-api-key unless useBearerAuth is set.src/batteries/llm/gemini_generate_content/types.ts:347
autoAck?booleanWhether to acknowledge tool-call-free generations; defaults to true.src/batteries/llm/gemini_generate_content/types.ts:404
baseURL?stringDefaults to https://generativelanguage.googleapis.com/v1beta.src/batteries/llm/gemini_generate_content/types.ts:357
bucketOrder?ChatCompletionsBucketOrderOrder of context buckets in the system instruction.src/batteries/llm/gemini_generate_content/types.ts:408
contextWindow?numberMaximum token weight allowed for the assembled context.src/batteries/llm/gemini_generate_content/types.ts:402
fetch?{ (input: URL | RequestInfo, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; }Injectable fetch, for tests or a custom transport.src/batteries/llm/gemini_generate_content/types.ts:398
forgeToolsFilter?(forged: ToolRegistry, ctx: DispatchContext) => ToolRegistryNarrow the artifact-reader tools forged from prior-turn results before they merge in.src/batteries/llm/gemini_generate_content/types.ts:428
helpers?Partial<GeminiGenerateContentHelpers>Override any translation helper; unset entries fall back to the default* implementation.src/batteries/llm/gemini_generate_content/types.ts:426
localToolCallParser?| ToolCallParserName | ToolCallParserFnRecover tool calls the provider returned as prose rather than functionCall parts.src/batteries/llm/gemini_generate_content/types.ts:414
maxOutputTokens?numberUpper bound on generated tokens.src/batteries/llm/gemini_generate_content/types.ts:361
modelstringModel id, e.g. gemini-2.5-flash-lite. Prefer a CONCRETE id over a floating alias.src/batteries/llm/gemini_generate_content/types.ts:345
onPromptAssembled?PromptAssembledObserverFnObserve the assembled request the instant before dispatch. Remarks The honest way to check what a vendor actually received — see the validation battery's "Which API surface a rule applies to" guide. An ADK-control key: stripped from the wire body.src/batteries/llm/gemini_generate_content/types.ts:424
onRawGeneration?RawGenerationObserverFnObserve the raw generation. Purely observational; errors swallowed.src/batteries/llm/gemini_generate_content/types.ts:416
retry?ChatCompletionsRetryConfigRetry/backoff policy for transport failures.src/batteries/llm/gemini_generate_content/types.ts:396
safetySettings?GeminiSafetySetting[]Per-category safety-filter overrides.src/batteries/llm/gemini_generate_content/types.ts:373
spoolStore?SpoolStoreSpool store backing artifact-handle results.src/batteries/llm/gemini_generate_content/types.ts:406
stopSequences?string[]Sequences that halt generation.src/batteries/llm/gemini_generate_content/types.ts:369
stream?booleanUse :streamGenerateContent (SSE) instead of :generateContent.src/batteries/llm/gemini_generate_content/types.ts:359
temperature?numberSampling temperature.src/batteries/llm/gemini_generate_content/types.ts:363
thinkingConfig?GeminiThinkingConfigReasoning-budget controls.src/batteries/llm/gemini_generate_content/types.ts:371
thoughtSignatureSentinel?string | falseSentinel to stamp on the first historical functionCall part that carries no thoughtSignature, or false to send history untouched. Remarks Gemini 3+ REJECTS a historical functionCall with no signature. When history did not originate from Gemini (a replay, a model switch, a cross-vendor panel) there is no genuine signature to send, and Google documents two portable sentinels for exactly that case — 'skip_thought_signature_validator' (Gemini API and Vertex) and 'context_engineering_is_the_way_to_go' (Gemini API only). Defaults to 'skip_thought_signature_validator' because the alternative is a hard 400 on any non-Gemini-originated tool history. It is nonetheless a PROVENANCE CLAIM about reasoning the model did not produce, and Google cautions it may degrade quality relative to a real signature — set false to opt out and surface the vendor's own error instead.src/batteries/llm/gemini_generate_content/types.ts:392
thoughtSurfacing?"all" | "all-self" | "latest-self"Which reasoning to replay.src/batteries/llm/gemini_generate_content/types.ts:410
timeoutMs?numberPer-request timeout. Falls back to the dispatch abort signal when absent.src/batteries/llm/gemini_generate_content/types.ts:394
tokenEncoding?| TokenEncodingId | nullEncoding used for token accounting; null explicitly disables token accounting.src/batteries/llm/gemini_generate_content/types.ts:400
toolConfig?GeminiToolConfigForce, permit, or forbid function calling.src/batteries/llm/gemini_generate_content/types.ts:375
topK?numberTop-k sampling cutoff.src/batteries/llm/gemini_generate_content/types.ts:367
topP?numberNucleus-sampling threshold.src/batteries/llm/gemini_generate_content/types.ts:365
unsupportedMediaPolicy?UnsupportedMediaPolicyWhat to do with a modality Gemini cannot accept.src/batteries/llm/gemini_generate_content/types.ts:412
useBearerAuth?booleanSend the key as Authorization: Bearer instead of x-goog-api-key. Remarks Google's own endpoint wants x-goog-api-key; several gateways in front of it accept only Authorization. Default false.src/batteries/llm/gemini_generate_content/types.ts:355