ציון המיקום שאליו צריך לגשת כדי לגשת למודל

לוחצים על ספק Gemini API כדי להציג בדף הזה את התוכן והקוד הספציפיים לספק.


מודלי ה-AI הגנרטיבי של Google זמינים באזורים ספציפיים.

כשמפעילים את שירות הקצה העורפי Vertex AI Gemini API בקוד, אפשר אופציונלי לציין את המיקום של המודל שאליו אתם ניגשים בבקשות. אם לא מציינים מיקום, ברירת המחדל היא us-central1. רשימת המיקומים הזמינים מופיעה בהמשך הדף.

Firebase AI Logic עדיין לא תומך במיקום הגלובלי של Vertex AI.

דוגמאות קוד

הערה: בדוגמאות האלה מוצגת גישה למודל Gemini, אבל אפשר גם לציין מיקום כשנכנסים למודל Imagen 3.

מחליפים את LOCATION בקוד המיקום (לדוגמה, europe-west4) מתוך רשימת המיקומים הזמינים בהמשך הדף.

Swift

// ...

// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
let ai = FirebaseAI.firebaseAI(backend: .vertexAI(location: "LOCATION"))

// Create a `GenerativeModel` instance with a model that supports your use case
let model = ai.generativeModel(modelName: "MODEL_NAME")

// ...

Kotlin

// ...

// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
val model = Firebase.ai(backend = GenerativeBackend.vertexAI(location = "LOCATION"))
                        .generativeModel("MODEL_NAME")

// ...

Java

// ...

// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.vertexAI("LOCATION"))
        .generativeModel("MODEL_NAME");

GenerativeModelFutures model = GenerativeModelFutures.from(ai);

// ...

Web

// ...

// Initialize FirebaseApp
const firebaseApp = initializeApp(firebaseConfig);

// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
const ai = getAI(firebaseApp, { backend: new VertexAIBackend(location: 'LOCATION') });

// Create a `GenerativeModel` instance with a model that supports your use case
const model = getGenerativeModel(ai, { model: 'MODEL_NAME' });

// ...

Dart

// ...

// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
final ai = await FirebaseAI.vertexAI(location: 'LOCATION');

// Create a `GenerativeModel` instance with a model that supports your use case
final model = ai.generativeModel(model: 'MODEL_NAME');

// ...

Unity

// ...

// Initialize the Vertex AI Gemini API backend service
// Specify the location for where you want to access the model
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.VertexAI(location: "LOCATION"));

// Create a `GenerativeModel` instance with a model that supports your use case
var model = ai.GetGenerativeModel(modelName: "MODEL_NAME");

// ...

מיקומים זמינים

ב-Google Cloud נעשה שימוש באזורים. Google Cloud שומר את נתוני הלקוחות רק באזור שציינתם לכל התכונות של AI גנרטיבי שזמינות באופן כללי ב-Vertex AI.

AI גנרטיבי ב-Vertex AI זמין באזורים הבאים. יכול להיות שחלק מהדגמים ו/או הגרסאות הספציפיות לא יהיו זמינים בכל המיקומים (לפרטים על הזמינות לפי מיקום, ראו מסמכי התיעוד של Google Cloud).

ארצות הברית

  • קולומבוס, אוהיו (us-east5)
  • דאלאס, טקסס (us-south1)
  • איווה (us-central1)
  • לאס וגאס, נבדה (us-west4)
  • מונקס קורנר, קרוליינה הדרומית (us-east1)
  • צפון וירג'יניה (us-east4)
  • אורגון (us-west1)

קנדה

  • מונטריאול (northamerica-northeast1)

דרום אמריקה

  • סאו פאולו, ברזיל (southamerica-east1)

אירופה

  • בלגיה (europe-west1)
  • פינלנד (europe-north1)
  • פרנקפורט, גרמניה (europe-west3)
  • לונדון, בריטניה (europe-west2)
  • מדריד, ספרד (europe-southwest1)
  • מילאנו, איטליה (europe-west8)
  • הולנד (europe-west4)
  • פריז, צרפת (europe-west9)
  • ורשה, פולין (europe-central2)
  • ציריך, שווייץ (europe-west6)

אסיה ואזור האוקיינוס השקט

  • מחוז צ'אנגהואה, טייוואן (asia-east1)
  • הונג קונג, סין (asia-east2)
  • מומבאי, הודו (asia-south1)
  • סיאול, קוריאה (asia-northeast3)
  • סינגפור (asia-southeast1)
  • סידני, אוסטרליה (australia-southeast1)
  • טוקיו, יפן (asia-northeast1)

המזרח התיכון

  • דמאם, ערב הסעודית (me-central2)
  • דוחה, קטאר (me-central1)
  • תל אביב, ישראל (me-west1)