Skip to content
1 min read · 186 words

Class: GeminiGenerateContentAdapter

Defined in: src/batteries/llm/gemini_generate_content/adapter.ts:149

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(), ... })

Constructors

Constructor

ts
new GeminiGenerateContentAdapter(options: unknown): GeminiGenerateContentAdapter;

Defined in: src/batteries/llm/gemini_generate_content/adapter.ts:159

Parameters

ParameterTypeDescription
optionsunknownConstructor-baseline options, re-validated每 iteration after overrides merge.

Returns

GeminiGenerateContentAdapter

Throws

E_INVALID_GEMINI_GENERATE_CONTENT_OPTIONS when options is invalid.

Properties

PropertyModifierTypeDescriptionDefined in
STASH_KEYreadonly"geminiGenerateContent"Per-iteration override key on ctx.stash.src/batteries/llm/gemini_generate_content/adapter.ts:151

Methods

executor()

ts
executor(overrides?: Partial<GeminiGenerateContentAdapterOptions>): DispatchExecutorFn;

Defined in: src/batteries/llm/gemini_generate_content/adapter.ts:175

Build a DispatchExecutorFn bound to the baseline plus optional executor-scope overrides.

Parameters

ParameterTypeDescription
overrides?Partial<GeminiGenerateContentAdapterOptions>Higher precedence than the baseline, lower than ctx.stash.

Returns

DispatchExecutorFn


isGeminiGenerateContentAdapter()

ts
static isGeminiGenerateContentAdapter(value: unknown): value is GeminiGenerateContentAdapter;

Defined in: src/batteries/llm/gemini_generate_content/adapter.ts:164

Narrowing guard for cross-realm instances.

Parameters

ParameterType
valueunknown

Returns

value is GeminiGenerateContentAdapter