python-genai  by googleapis

Python SDK for Google GenAI enables integration of generative models

created 7 months ago
2,177 stars

Top 21.1% on sourcepulse

GitHubView on GitHub
Project Summary

This Python SDK provides an interface for integrating Google's generative AI models, including Gemini and Vertex AI, into applications. It targets developers building AI-powered features, offering a comprehensive set of tools for text generation, image manipulation, function calling, and model tuning.

How It Works

The SDK leverages a client-based architecture, allowing users to instantiate clients for either the Gemini Developer API or Vertex AI. It abstracts the complexities of API interactions, providing methods for content generation, streaming responses, and managing model configurations. The library supports structured inputs and outputs, including Pydantic models and JSON schemas, and offers robust features for function calling and asynchronous operations.

Quick Start & Requirements

Highlighted Details

  • Supports both Gemini Developer API and Vertex AI APIs.
  • Enables function calling with automatic Python function execution or manual declaration.
  • Offers advanced features like image generation/upscaling/editing (Imagen), video generation (Veo), caching, and model tuning.
  • Provides synchronous and asynchronous interfaces for all major functionalities.
  • Supports structured output generation with JSON and Pydantic schemas, and enum responses.

Maintenance & Community

  • Developed and maintained by Google.
  • Links to documentation are provided.

Licensing & Compatibility

  • License details are not explicitly stated in the README, but it is a Google product.
  • Compatibility is for Python applications.

Limitations & Caveats

  • Image generation (Imagen), video generation (Veo), and some advanced features like upscaling/editing are behind allowlists or specific to Vertex AI.
  • The README does not specify Python version requirements beyond general compatibility.
Health Check
Last commit

1 day ago

Responsiveness

1 week

Pull Requests (30d)
81
Issues (30d)
73
Star History
652 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.