GoogleOptions class final

Options for streamGoogle.

Ported subset of pi's GoogleOptions (which extends StreamOptions): temperature, maxTokens, apiKey, headers, signal, thinking, toolChoice, onPayload, onResponse. pi's signal: AbortSignal is cancelToken here.

Constructors

GoogleOptions({double? temperature, int? maxTokens, String? apiKey, Map<String, String?>? headers, CancelToken? cancelToken, GoogleThinking? thinking, String? toolChoice, bool useParameters = false, FutureOr<Map<String, dynamic>?> onPayload(Map<String, dynamic> payload, Model model)?, FutureOr<void> onResponse(int statusCode, Map<String, String> headers, Model model)?})
Creates Google options.
const

Properties

apiKey → String?
API key sent as x-goog-api-key: ... (what pi's @google/genai SDK does). Falls back to an x-goog-api-key or authorization entry in headers (key then unused), else the stream fails with an error event.
final
cancelToken → CancelToken?
Cancels the in-flight request when triggered. The stream then ends with an ErrorEvent whose reason is StopReason.aborted.
final
hashCode → int
The hash code for this object.
no setterinherited
headers → Map<String, String?>?
Extra request headers, merged over Model.headers; a null value suppresses the header with the same name (pi's ProviderHeaders).
final
maxTokens → int?
Output-token cap, sent as generationConfig.maxOutputTokens.
final
onPayload → FutureOr<Map<String, dynamic>?> Function(Map<String, dynamic> payload, Model model)?
Hook invoked with the fully built request payload right before sending; return a replacement map to override it, or null to send it as-is.
final
onResponse → FutureOr<void> Function(int statusCode, Map<String, String> headers, Model model)?
Hook invoked once the response headers are in, before the SSE body is consumed.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
temperature → double?
Sampling temperature, sent as generationConfig.temperature.
final
thinking → GoogleThinking?
Thinking configuration; only sent when Model.reasoning is true.
final
toolChoice → String?
Tool choice: 'auto', 'none', or 'any', mapped to Gemini's FunctionCallingConfigMode (AUTO / NONE / ANY). Only sent when the context has tools, per pi.
final
useParameters → bool
Use the legacy parameters field (OpenAPI 3.03 Schema, sanitized via pi's sanitizeForOpenApi) instead of parametersJsonSchema in function declarations. Needed for Cloud Code Assist with Claude models, where the API translates parameters into Anthropic's input_schema (pi's convertTools(tools, useParameters)).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited