CommonGoogleGenPlugin class abstract

Constructors

CommonGoogleGenPlugin()

Properties

defaultsTtsToAudio → bool
Whether Interactions requests to text-to-speech models ask for audio by default (a {type: audio} response format). The Gemini API needs it; vertexAI sends its TTS models through generateContent.
no setter
generateContentTtsFormats → bool
Whether this plugin's generateContent TTS models take audioFormat (as generationConfig.responseFormat) and join streamed audio chunks into one part in the final response (vertexAI, as in JS). When false, audioFormat is dropped with a warning there and streamed chunks are returned as they arrived (googleAI, whose generateContent TTS models are all deprecated; its newer TTS models use the Interactions API).
no setter
hashCode → int
The hash code for this object.
no setterinherited
interactionSafetyBlockNoneAsOff → bool
Whether BLOCK_NONE is sent as off in Interactions safety_settings. The Gemini API rejects block_none (400) and off means the same there (googleAI); the platform accepts block_none.
no setter
knownModels → Map<String, ModelInfo>
Curated per-model capability metadata exposed by this plugin, keyed by bare model name.
no setter
name → String
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
store → bool?
The plugin-level store option, used when a request doesn't set store; null when not set. Interactions models treat null as false; generateContent models only send it when set (see supportsGenerateContentStore).
no setter
supportsGenerateContentStore → bool
Whether this plugin's generateContent API takes a top-level store (on the Gemini API it controls whether the server logs the request for the project). When false, store: true is dropped with a warning (the Gemini Enterprise Agent Platform has no such field).
no setter
supportsInteractionSafetySettings → bool
Whether Interactions requests send safety_settings (both plugins do). When false, permissive settings are dropped and blocking ones throw.
no setter
supportsServiceTier → bool
Whether this plugin sends the serviceTier option to the API. When false, it is dropped with a warning (the vertexAI plugin has no service tier option in JS).
no setter
supportsVertexOptions → bool
Whether this plugin uses the vertexAI-only options (location, labels, vertexRetrieval, payGo, videoFormat.gcsUri). When false (the Gemini API has no such fields), they are dropped with a warning (see warnDroppedVertexOptions).
no setter
unsupportedResentStepTypes → Set<String>
Server-side tool step types left out of a stateless (store: false) history on the Interactions API, because the server rejects them when they're sent back (vertexAI). A warning is logged once when any are left out.
no setter

Methods

createEmbedder(String embedderName) → Embedder
createModel(String modelName, SchemanticType customOptions) → Model
curatedModelMetadata({Set<String> discoveredNames = const {}}) → Iterable<ActionMetadata>
Returns action metadata for every knownModels entry whose bare name is not in discoveredNames, so a curated model stays listed when model discovery omits it or fails outright.
getApiClient([String? requestApiKey]) → Future<GenerativeLanguageBaseClient>
getApiClientForRequest(Map<String, dynamic>? config) → Future<GenerativeLanguageBaseClient>
The API client for a model request with config (the request's options). By default it only reads apiKey; vertexAI overrides it to apply the per-request location and payGo.
handleException(Object e, StackTrace stack) → GenkitException
init() → Future<List<Action>>
Called when the plugin is initialized.
inherited
list() → Future<List<ActionMetadata>>
Called to list actions provided by the plugin.
inherited
middleware() → List<GenerateMiddlewareDef>
Middleware provided by the plugin.
inherited
model(String name) → Model
inherited
modelInfoFor(String modelName) → ModelInfo
Returns the capability metadata for modelName.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(ActionType actionType, String name) → Action?
Called to resolve an action by name.
toString() → String
A string representation of this object.
inherited
usesInteractions(String modelName) → bool
Whether modelName is called through the Interactions API rather than generateContent (JS modelInteractionsMap).
vertexSearchDatastore(GeminiVertexDatastore datastore) → String
The full Vertex AI Search data store path for vertexRetrieval (JS vertexai toVertexAISearchDatastore). Only called when supportsVertexOptions is true.

Operators

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