Modele erişilecek konumu belirtin

Bu sayfada sağlayıcıya özgü içerikleri ve kodu görüntülemek için Gemini API sağlayıcınızı tıklayın.


Google'ın üretken yapay zeka modelleri belirli bölgelerde kullanılabilir.

Kodunuzda Vertex AI Gemini API arka uç hizmetini başlatırken isteğe bağlı olarak isteklerinizde eriştiğiniz modelin konumunu 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.

Firebase AI Logic, Vertex AI için küresel konumu 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

// ...

// 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");

// ...

Kullanılabildiği yerler

Google Cloud, bölgeleri kullanır. Google Cloud, Vertex AI'teki Üretken Yapay Zeka'nın herkese açık tüm özellikleri için müşteri verilerini yalnızca belirttiğiniz bölgede 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 (Konumla 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)