Библиотеки API Gemini

When building with the Gemini API, we recommend using the Google GenAI SDK . These are the official, production-ready libraries that we develop and maintain for the most popular languages. They are in General Availability and used in all our official documentation and examples.

Если вы впервые работаете с API Gemini, воспользуйтесь нашим руководством по быстрому запуску , чтобы начать работу.

Языковая поддержка и установка

The Google GenAI SDK is available for the Python, JavaScript/TypeScript, Go and Java languages. You can install each language's library using package managers, or visit their GitHub repos for further engagement:

Python

JavaScript

Идти

Java

  • Библиотека: google-genai

  • Репозиторий GitHub: googleapis/java-genai

  • Установка: Если вы используете Maven, добавьте следующее в ваши зависимости:

<dependencies>
  <dependency>
    <groupId>com.google.genai</groupId>
    <artifactId>google-genai</artifactId>
    <version>1.0.0</version>
  </dependency>
</dependencies>

C#

  • Библиотека: Google.GenAI

  • Репозиторий GitHub: googleapis/dotnet-genai

  • Установка: dotnet add package Google.GenAI

Общая доступность

As of May 2025, the Google GenAI SDK has reached General Availability (GA) across all supported platforms and are the recommended libraries to access the Gemini API. They are stable, fully supported for production use, and are actively maintained. They provide access to the latest features, and offer the best performance working with Gemini.

Если вы используете одну из наших устаревших библиотек, мы настоятельно рекомендуем вам перейти на неё, чтобы получить доступ к новейшим функциям и обеспечить наилучшую производительность при работе с Gemini. Для получения дополнительной информации ознакомьтесь с разделом, посвященным устаревшим библиотекам .

Устаревшие библиотеки и миграция

Если вы используете одну из наших устаревших библиотек, мы рекомендуем перейти на новые библиотеки .

Устаревшие библиотеки не предоставляют доступ к новейшим функциям (таким как Live API и Veo ) и считаются устаревшими с 30 ноября 2025 года.

Статус поддержки каждой устаревшей библиотеки различен и подробно описан в следующей таблице:

Язык Библиотека наследия Статус поддержки Рекомендуемая библиотека
Python google-generativeai Активная поддержка отсутствует. google-genai
JavaScript/TypeScript @google/generativeai Активная поддержка отсутствует. @google/genai
Идти google.golang.org/generative-ai Активная поддержка отсутствует. google.golang.org/genai
Дарт и Флаттер google_generative_ai Активная поддержка отсутствует. Используйте Genkit Dart или Firebase AI Logic.
Быстрый generative-ai-swift Активная поддержка отсутствует. Используйте логику искусственного интеллекта Firebase.
Android generative-ai-android Активная поддержка отсутствует. Используйте логику искусственного интеллекта Firebase.

Note for Java developers: There was no legacy Google-provided Java SDK for the Gemini API, so no migration from a previous Google library is required. You can start directly with the new library in the Language support and installation section.