下載或安裝程式庫即可使用 Gemini

本頁說明如何下載或安裝用於存取 Gemini 的程式庫。

Python
SDK:pip install google-generativeai
低階用戶端程式庫:pip install google-ai-generativelanguage
查看
執行 go get github.com/google/generative-ai-go
Node.js
npm install @google/generative-ai
網頁
import { GoogleGenerativeAI } from 'https://esm.run/@google/generative-ai' 新增至網頁應用程式
飛鏢 (Flutter)
Dart:執行 dart pub add google_generative_ai
Flutter:執行 flutter pub add google_generative_ai
Swift
使用 Swift Package Manager 將 generative-ai-swift 新增至 Xcode 專案。
Android
將依附元件
加入implementation("com.google.ai.client.generativeai:generativeai:0.3.0")至 Android 專案。