Skip to main content

Genkit Google GenAI Plugin

Project description

Google GenAI Plugin

This Genkit plugin provides a unified interface for Google AI (Gemini) and Vertex AI models, embedding, and other services.

Setup environment

uv venv
source .venv/bin/activate
pip install genkit-plugins-google-genai

Configuration

Google AI (AI Studio)

To use Google AI models, obtain an API key from Google AI Studio and set it in your environment:

export GEMINI_API_KEY='<your-api-key>'

Vertex AI (Google Cloud)

To use Vertex AI models, ensure you have a Google Cloud project and Application Default Credentials (ADC) set up:

gcloud auth application-default login

Features

Dynamic Models

The plugin automatically discovers available models from the API upon initialization. You can use any model name supported by the API (e.g., googleai/gemini-2.0-flash-exp, vertexai/gemini-1.5-pro).

Dynamic Configuration

New or experimental parameters can be passed flexibly using model_validate to bypass strict schema checks:

from genkit.plugins.google_genai import GeminiConfigSchema

config = GeminiConfigSchema.model_validate({
    'temperature': 1.0,
    'response_modalities': ['TEXT', 'IMAGE'],
})

Examples

For comprehensive usage examples, see py/samples/google-genai-hello/README.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genkit_plugin_google_genai-0.5.0.tar.gz (47.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genkit_plugin_google_genai-0.5.0-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

Details for the file genkit_plugin_google_genai-0.5.0.tar.gz.

File metadata

File hashes

Hashes for genkit_plugin_google_genai-0.5.0.tar.gz
Algorithm Hash digest
SHA256 ff788f1a5395e89bc74d93b1a4f50ea7cde1accf7c6bb0ffd2a0a180d325c02b
MD5 6c76b534bf7616ec1e99b94e63e8129f
BLAKE2b-256 3255091a4c51fd758400e7648f19e116c2d14d9b8309284e4739d0c695e9c67e

See more details on using hashes here.

Provenance

The following attestation bundles were made for genkit_plugin_google_genai-0.5.0.tar.gz:

Publisher: publish_python.yml on firebase/genkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genkit_plugin_google_genai-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for genkit_plugin_google_genai-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3fcbde5ff88a7d52d2796eda487485e933e5126e347b0f5bdc4f55d18f20560
MD5 1e6b7f3e5fa87427cbe1b6cead861351
BLAKE2b-256 9c26323d2587fd383e6e92fc932a1f9e544a0f2f97940a62654e0029cd950a70

See more details on using hashes here.

Provenance

The following attestation bundles were made for genkit_plugin_google_genai-0.5.0-py3-none-any.whl:

Publisher: publish_python.yml on firebase/genkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page