cookbook  by google-gemini

Gemini API cookbook for practical examples and guides

created 1 year ago
14,172 stars

Top 3.6% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a structured learning path and practical examples for using the Google Gemini API, targeting developers and researchers looking to integrate advanced AI capabilities into their applications. It offers hands-on tutorials for quick integration and showcases complex use cases, enabling users to leverage multimodal AI, code execution, function calling, and media generation.

How It Works

The cookbook is organized into Quick Starts for foundational knowledge and step-by-step feature exploration, and Examples that demonstrate combining multiple Gemini API features or external tools for complex applications. It highlights recent additions like Gemini 2.5 models, Imagen, Veo, Live API, browser tool integration, and code execution, providing practical guidance on their implementation.

Quick Start & Requirements

  • Installation: Use official SDKs (Python, Go, Node.js, Dart, Android, Swift). For Python, install via pip install google-generativeai.
  • Prerequisites: A Google account and an API key from Google AI Studio.
  • Resources: Links to official documentation, demos, and the Google AI Developer Forum are provided.

Highlighted Details

  • Covers Gemini 2.5 models (Flash and Pro), Imagen, and Veo for media generation.
  • Features guides on Live API, browser tool integration, code execution, and function calling.
  • Includes examples for multimodal applications, animated story generation, and 3D spatial understanding.
  • Offers both direct REST API usage and official SDKs for integration.

Maintenance & Community

  • The repository is actively maintained by Google.
  • Contributions are welcome via CONTRIBUTING.md.
  • Support is available on the Google AI Developer Forum.

Licensing & Compatibility

  • The repository itself is likely under a permissive license (e.g., Apache 2.0, common for Google open-source projects), but the Gemini API usage is governed by Google's terms of service.
  • The new google-genai SDK (v1.0) is compatible with all Gemini API models and features, including Live API, improved tool usage, and media generation. It supports connection via Google AI Studio or Vertex AI.

Limitations & Caveats

  • The older google-generativeai package supports original Gemini models and Gemini 2 models with a limited feature set; all new features are in the new Google GenAI SDK. Migration guidance is available.
Health Check
Last commit

2 days ago

Responsiveness

1 week

Pull Requests (30d)
45
Issues (30d)
13
Star History
1,687 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.