تحديد الموقع الجغرافي للوصول إلى النموذج

انقر على مزوّد Gemini API لعرض المحتوى الخاص بالمزوّد والرمز البرمجي في هذه الصفحة.


تتوفّر نماذج الذكاء الاصطناعي التوليدي من 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 بيانات العملاء إلا في المنطقة التي تحدّدها لجميع ميزات الذكاء الاصطناعي التوليدي المتاحة بشكل عام على Vertex 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)