Registry / llm-agents / google-genai

google-genai

JSON →
library2.20.0pypypi✓ verified 25d ago

The Google GenAI Python SDK provides an interface for developers to integrate Google's generative models into their Python applications. Current version: 1.69.0, released on March 27, 2026. The SDK is actively maintained with regular updates, typically on a monthly basis.

pip install google-genai
INSTALL
IMPORT
SIG · GOOGLE-GENAI
G
google-genai
llm-agentspythonv2.20.0
Install
7.6s avg
Import
2033ms
Disk
67MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.20.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 2.100s · 68.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.6s · import 1.966s · 68MB
67MB installed
● package 67MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

genai
import google.genai as genai
import google.generativeai as genai

This script demonstrates how to configure the Google GenAI SDK with your API key and generate text using the 'gemini-1.5-flash' model.

import google.generativeai as genai # Configure the API key api_key = os.environ.get('GENAI_API_KEY') genai.configure(api_key=api_key) # Generate content using a model model = genai.GenerativeModel(model='gemini-1.5-flash') response = model.generate_text(prompt='Once upon a time') print(response.text)
Debug
Known issues
breakingBreaking change in Interactions API: Refactored TextContent annotations to use specific citation types in version 1.68.0.
fix
Update your code to use the new citation types as per the latest API documentation.
affects: 1.68.0
breakingBreaking change in Interactions API: Renamed ContentDelta unions in version 1.68.0.
fix
Modify your code to accommodate the new union names as specified in the updated API.
affects: 1.68.0
breakingThe 'google.generativeai' library is not found. This typically means the package is not installed in the environment where the script is executed.
fix
Install the 'google-generativeai' package using pip: `pip install google-generativeai`.
affects: all
breakingThe script failed with `ModuleNotFoundError: No module named 'google.generativeai'`, indicating that the required Python package is not installed in the environment.
fix
Install the 'google-generativeai' package using pip: `pip install google-generativeai`.
affects: 1.68.0
Upgrade
Version history
2.20.0latest on PyPI · released Aug 25, 2026
Audit
Dependencies
google-api-corerequiredRequired for API interactions
requestsrequiredNeeded for HTTP requests
Agent activity
32 hits · last 30 days
node
28
OpenAI (training)
1
Resources
google-genai — pip install google-genai · libregistry