/** * Cross-environment executor adapter for Google's native Gemini `generateContent` endpoint. * * @module @nhtio/adk/batteries/llm/gemini_generate_content/adapter * * @remarks * Targets `POST {baseURL}/models/{model}:generateContent` (and `:streamGenerateContent` when * `stream` is set) — Gemini's OWN wire format, not an OpenAI-compatible façade in front of it. * * That distinction is the reason this battery exists. Pointing `openai_chat_completions` at a * Gemini-compatible gateway means some translator, not the ADK, decides how your primitives become * `contents[]` — including whether a `thoughtSignature` is stamped, whether consecutive same-role * turns get merged, and how a tool result is correlated to its call. For ordinary use that is fine. * For anything that needs to reason about what the VENDOR actually received — an ordering guard, a * wire-shape audit, a bug report against Google — the translation has to be ours and observable. * See the validation battery's "Which API surface a rule applies to" guide. * * Options layer exactly as the other batteries: constructor baseline → `executor()` overrides → * per-iteration `ctx.stash.geminiGenerateContent`, re-validated each iteration. */ import type { DispatchExecutorFn } from "../../../types"; import type { GeminiGenerateContentAdapterOptions } from "./types"; /** * Native Gemini `generateContent` executor adapter. * * @example * ```ts * const adapter = new GeminiGenerateContentAdapter({ * model: 'gemini-2.5-flash-lite', * apiKey: process.env.GEMINI_API_KEY, * }) * const runner = new TurnRunner({ executorCallback: adapter.executor(), ... }) * ``` */ export declare class GeminiGenerateContentAdapter { #private; /** Per-iteration override key on `ctx.stash`. */ static readonly STASH_KEY: "geminiGenerateContent"; /** * @param options - Constructor-baseline options, re-validated每 iteration after overrides merge. * @throws {@link E_INVALID_GEMINI_GENERATE_CONTENT_OPTIONS} when `options` is invalid. */ constructor(options: unknown); /** Narrowing guard for cross-realm instances. */ static isGeminiGenerateContentAdapter(value: unknown): value is GeminiGenerateContentAdapter; /** * Build a {@link DispatchExecutorFn} bound to the baseline plus optional executor-scope overrides. * * @param overrides - Higher precedence than the baseline, lower than `ctx.stash`. */ executor(overrides?: Partial): DispatchExecutorFn; }