ระบุตำแหน่งสำหรับการเข้าถึงโมเดล

คลิกผู้ให้บริการ Gemini API เพื่อดูเนื้อหาและโค้ดเฉพาะผู้ให้บริการในหน้านี้


โมเดล Generative 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 ใช้regions Google Cloud จะจัดเก็บข้อมูลลูกค้าเฉพาะในภูมิภาคที่คุณระบุสำหรับฟีเจอร์ Generative AI ทั้งหมดที่พร้อมให้บริการแก่ผู้ใช้ทั่วไปใน Vertex AI

Generative 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)