מודלים של AI גנרטיבי מבית Google נחשפים באמצעות נקודות קצה אזוריות ספציפיות.
כשמאתחלים את השירות Vertex AI, אפשר אופציונלי לציין את המיקום של נקודת הקצה של המודל שאליו אתם ניגשים בבקשות. אם לא מציינים מיקום, ברירת המחדל היא us-central1
. רשימת המיקומים הזמינים מופיעה בהמשך הדף.
Vertex AI in Firebase עדיין לא תומך בנקודת הקצה הגלובלית של Vertex AI.
דוגמאות קוד
הערה: בדוגמאות האלה מוצגת גישה למודל Gemini, אבל אפשר גם לציין מיקום כשנכנסים למודל Imagen 3.
מחליפים את LOCATION בקוד המיקום (לדוגמה, europe-west4
) מתוך רשימת המיקומים הזמינים בהמשך הדף.
Swift
import FirebaseVertexAI
// Initialize the Vertex AI service
// Specify the endpoint location for the model accessed by your requests
let vertex = VertexAI.vertexAI(location: "LOCATION")
// Create a `GenerativeModel` instance with a model that supports your use case
let model = vertex.generativeModel(modelName: "MODEL_NAME")
Kotlin
// Initialize the Vertex AI service
// Specify the endpoint location for the model accessed by your requests
val vertexAI = Firebase.vertexAI(location = "LOCATION")
// Create a `GenerativeModel` instance with a model that supports your use case
val generativeModel = vertexAI.generativeModel(modelName = "MODEL_NAME")
Java
// Initialize the Vertex AI service
// Specify the endpoint location for the model accessed by your requests
FirebaseVertexAI vertexAI = FirebaseVertexAI.getInstance("LOCATION");
// Create a `GenerativeModel` instance with a model that supports your use case
GenerativeModel gm = vertexAI.generativeModel("MODEL_NAME");
// Use the `GenerativeModelFutures` Java compatibility layer which offers
// support for `ListenableFuture` and Publisher APIs
GenerativeModelFutures model = GenerativeModelFutures.from(gm);
Web
import { initializeApp } from "firebase/app";
import { getVertexAI, getGenerativeModel } from "firebase/vertexai";
// TODO(developer) Replace the following with your app's Firebase configuration
// See: https://firebase.google.com/docs/web/learn-more#config-object
const firebaseConfig = {
// ...
};
// Initialize FirebaseApp
const firebaseApp = initializeApp(firebaseConfig);
// Initialize the Vertex AI service
// Specify the endpoint location for the model accessed by your requests
const vertexAI = getVertexAI(firebaseApp, { location: 'LOCATION' });
// Create a `GenerativeModel` instance with a model that supports your use case
const model = getGenerativeModel(vertexAI, { model: 'MODEL_NAME' });
Dart
import 'package:firebase_vertexai/firebase_vertexai.dart';
import 'package:firebase_core/firebase_core.dart';
// Initialize FirebaseApp
await Firebase.initializeApp();
// Initialize the Vertex AI service
// Specify the endpoint location for the model accessed by your requests
final vertexAI = await FirebaseVertexAI.instanceFor(location: 'LOCATION');
// Create a `GenerativeModel` instance with a model that supports your use case
final model = vertexAI.generativeModel(model: '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
)