Google'ın üretken yapay zeka modelleri, belirli bölgesel uç noktalar kullanılarak kullanıma sunulur.
Vertex AI hizmetini başlatırken, isteklerinizde eriştiğiniz modelin uç nokta konumunu isteğe bağlı olarak belirtebilirsiniz. Bir konum belirtmezseniz varsayılan değer us-central1
olur. Bu sayfanın ilerleyen bölümlerinde kullanılabilir konumların listesini görebilirsiniz.
Vertex AI in Firebase, Vertex AI için global uç noktayı henüz desteklemiyor.
Kod örnekleri
Bu örneklerde bir Gemini modeline erişildiğinin gösterildiğini ancak Imagen 3 modeline erişirken de konumu belirtebileceğinizi unutmayın.
LOCATION değerini, bu sayfanın sonraki kısmındaki kullanılabilir konumlar listesinden konum koduyla (örneğin, europe-west4
) değiştirin.
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');
Kullanılabildiği yerler
Google Cloud, bölgesel uç noktaları tanımlamak için regions özelliğini kullanır. Google Cloud, Vertex AI'teki Üretken Yapay Zeka'nın herkese açık tüm özellikleri için yalnızca belirttiğiniz bölgede müşteri verilerini depolar.
Vertex AI'teki üretken yapay zeka aşağıdaki bölgelerde kullanılabilir. Bazı modeller ve/veya belirli sürümler her yerde kullanılamayabilir (Kullanılabilirlik durumuyla ilgili ayrıntılı bilgi için Google Cloud dokümanlarına bakın).
Amerika Birleşik Devletleri
- Columbus, Ohio (
us-east5
) - Dallas, Teksas (
us-south1
) - Iowa (
us-central1
) - Las Vegas, Nevada (
us-west4
) - Moncks Corner, Güney Carolina (
us-east1
) - Kuzey Virginia (
us-east4
) - Oregon (
us-west1
)
Kanada
- Montréal (
northamerica-northeast1
)
Güney Amerika
- Sao Paulo, Brezilya (
southamerica-east1
)
Avrupa
- Belçika (
europe-west1
) - Finlandiya (
europe-north1
) - Frankfurt, Almanya (
europe-west3
) - Londra, Birleşik Krallık (
europe-west2
) - Madrid, İspanya (
europe-southwest1
) - Milano, İtalya (
europe-west8
) - Hollanda (
europe-west4
) - Paris, Fransa (
europe-west9
) - Varşova, Polonya (
europe-central2
) - Zürih, İsviçre (
europe-west6
)
Asya-Pasifik
- Çanghua İlçesi, Tayvan (
asia-east1
) - Hong Kong, Çin (
asia-east2
) - Mumbai, Hindistan (
asia-south1
) - Seul, Güney Kore (
asia-northeast3
) - Singapur (
asia-southeast1
) - Sidney, Avustralya (
australia-southeast1
) - Tokyo, Japonya (
asia-northeast1
)
Orta Doğu
- Dammam, Suudi Arabistan (
me-central2
) - Doha, Katar (
me-central1
) - Tel Aviv, İsrail (
me-west1
)