Google Generative AI High level API client library and tools.
Project description
Google AI Python SDK for the Gemini API
The Google AI Python SDK is the easiest way for Python developers to build with the Gemini API. The Gemini API gives you access to Gemini models created by Google DeepMind. Gemini models are built from the ground up to be multimodal, so you can reason seamlessly across text, images, and code.
Get started with the Gemini API
- Go to Google AI Studio.
- Login with your Google account.
- Create an API key.
- Try a Python SDK quickstart in the Gemini API Cookbook.
- For detailed instructions, try the Python SDK tutorial on ai.google.dev.
Usage example
See the Gemini API Cookbook or ai.google.dev for complete code.
Install from PyPI.
pip install -U google-generativeai
Import the SDK and configure your API key.
import google.generativeai as genai
import os
genai.configure(api_key=os.environ["GOOGLE_API_KEY"])
Create a model and run a prompt.
model = genai.GenerativeModel('gemini-1.0-pro-latest')
response = model.generate_content("The opposite of hot is")
print(response.text)
Documentation
See the Gemini API Cookbook or ai.google.dev for complete documentation.
Contributing
See Contributing for more information on contributing to the Google AI Python SDK.
License
The contents of this repository are licensed under the Apache License, version 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for google_generativeai-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7be4b634afeb8b6bebde1af7271e94d2af84d2d28b5988c7ed9921733c40fe63 |
|
MD5 | 8412e458ab8663a57b27b58255c4a3ae |
|
BLAKE2b-256 | a2b8907a109a9ab3adbe97ba5a4dbd1fbd004222f4df81d70d1c43889b31d3c5 |