common library
Shared implementation for Genkit's Google model plugins.
Not public API. This library exists so genkit_vertexai can reuse the
Gemini request/response mapping, model catalog, and API client from this
package. It is not covered by this package's semantic-versioning
guarantees: anything here may change or disappear in any release, including
patch releases.
Applications should import package:genkit_google_genai/genkit_google_genai.dart
(or package:genkit_vertexai/genkit_vertexai.dart) instead.
Classes
- $AntigravityOptions
- Options for the Antigravity agent (e.g. antigravity-preview-09-2026).
- $GeminiAudioFormat
- $GeminiFileSearch
- $GeminiFunctionCallingConfig
- $GeminiGoogleSearch
- $GeminiImageConfig
- $GeminiImageOptions
- $GeminiLatLng
- $GeminiMultiSpeakerVoiceConfig
- $GeminiOptions
- $GeminiPrebuiltVoiceConfig
- $GeminiRetrievalConfig
- $GeminiSafetySettings
- $GeminiSpeakerVoiceConfig
- $GeminiSpeechConfig
- $GeminiThinkingConfig
- $GeminiTtsOptions
- $GeminiUrlContext
- $GeminiVertexDatastore
- $GeminiVertexRetrieval
- $GeminiVideoConfig
- $GeminiVideoFormat
- $GeminiVideoOptions
- Options for video generation models such as gemini-omni-1.1-flash. See https://ai.google.dev/gemini-api/docs/omni
- $GeminiVoiceConfig
- $GoogleGenAiEmbedderOptions
- $LyriaOptions
- Options for the Lyria music generation models (e.g. lyria-3.5).
- AntigravityOptions
- Options for the Antigravity agent (e.g. antigravity-preview-09-2026).
- CommonGoogleGenPlugin
- CustomClient
- GeminiAudioFormat
- GeminiFileSearch
- GeminiFunctionCallingConfig
- GeminiGoogleSearch
- GeminiImageConfig
- GeminiImageOptions
- GeminiLatLng
- GeminiMultiSpeakerVoiceConfig
- GeminiOptions
- GeminiPrebuiltVoiceConfig
- GeminiRetrievalConfig
- GeminiSafetySettings
- GeminiSpeakerVoiceConfig
- GeminiSpeechConfig
- GeminiThinkingConfig
- GeminiTtsOptions
- GeminiUrlContext
- GeminiVertexDatastore
- GeminiVertexRetrieval
- GeminiVideoConfig
- GeminiVideoFormat
- GeminiVideoOptions
- Options for video generation models such as gemini-omni-1.1-flash. See https://ai.google.dev/gemini-api/docs/omni
- GeminiVoiceConfig
- GenerativeLanguageBaseClient
- GoogleGenAiEmbedderOptions
- LyriaOptions
- Options for the Lyria music generation models (e.g. lyria-3.5).
- NonClosingClient
-
Delegates to a caller-owned client but ignores
close(), so a plugin's per-call cleanup never tears down an injected transport.
Enums
- GeminiModelFamily
- The generation modality a Gemini model name denotes.
- GeminiModelStage
-
Lifecycle stage of a curated model, in Genkit's
ModelInfo.stagevocabulary.
Extension Types
- CreateInteractionRequest
- Parameters for creating interactions.
Properties
- commonModelInfo → ModelInfo
-
final
-
geminiTtsSupports
→ Map<
String, dynamic> -
The capability profile every
-ttsGemini model advertises, curated or not.final -
geminiVideoSupports
→ Map<
String, dynamic> -
The capability profile every video generation model (
gemini-omni-*) advertises, curated or not (as in the JS plugin).final -
knownGeminiModels
→ Map<
String, ModelInfo> -
Curated capability metadata for the Gemini and Gemma models known to the
Gemini API (googleAI) plugin, keyed by bare model name (no plugin prefix).
final
- logger → Logger
-
final
-
lyriaSupports
→ Map<
String, dynamic> -
The capability profile every Lyria model advertises (as in JS): one turn,
text and image input, music (and the lyrics or caption as text) out.
final
Functions
-
createLyriaModel(
CommonGoogleGenPlugin plugin, String modelName, {ModelInfo? info, List< String> ? defaultModalities = const ['AUDIO', 'TEXT']}) → Model -
Creates the Lyria model
modelNameforplugin, withinfo(default: the googleAI catalog,lyriaModelInfo). -
embedWithEmbedContent(
GenerativeLanguageBaseClient service, {required String embedderName, required List< DocumentData> docs, GoogleGenAiEmbedderOptions? options, bool sendTaskTypeAndTitle = true}) → Future<List< Embedding> > -
Embeds each of
docswith the:embedContentmethod: one request per document, with its text and media as parts (the googleAI embedders, and gemini-embedding-2 and newer on vertexAI, as in JS). -
isEmbedderModelName(
String name) → bool -
Whether
name(bare or resource-prefixed) names an embedding model: any name containingembedding, such astext-embedding-004,gemini-embedding-2, ormultimodalembedding. -
isLyriaModelName(
String modelName) → bool -
Whether
modelName(bare, no plugin prefix) is a Lyria model. -
resetDroppedConfigFieldWarnings(
) → void - Forgets which dropped config fields were warned about.
-
resetDroppedResentStepsWarning(
) → void - Forgets that the dropped-steps warning was logged.
-
warnDroppedConfigField(
String model, String field) → void - Warns (once per model and field) that a config field isn't supported by the model and was ignored.