محل دسترسی به مدل را مشخص کنید

مدل‌های هوش مصنوعی مولد Google با استفاده از نقاط پایانی منطقه‌ای خاص در معرض دید قرار می‌گیرند.

هنگام راه اندازی سرویس Vertex AI ، می توانید به صورت اختیاری مکان نقطه پایانی را برای مدلی که به آن دسترسی دارید در درخواست های خود مشخص کنید. اگر مکانی را مشخص نکنید، پیش‌فرض us-central1 است. لیست مکان های موجود را در ادامه این صفحه مشاهده کنید.

Vertex AI در Firebase هنوز از نقطه پایانی جهانی برای Vertex AI پشتیبانی نمی کند.

نمونه کد

توجه داشته باشید که این نمونه‌ها دسترسی به مدل Gemini را نشان می‌دهند، اما می‌توانید هنگام دسترسی به مدل Imagen 3 مکان را نیز مشخص کنید.

LOCATION با کد مکان (به عنوان مثال، europe-west4 ) از لیست مکان های موجود در آینده در این صفحه جایگزین کنید.

سویفت

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 فقط داده‌های مشتری را در منطقه‌ای ذخیره می‌کند که شما برای همه ویژگی‌های عمومی در دسترس هوش مصنوعی در Vertex AI مشخص کرده‌اید.

هوش مصنوعی مولد در Vertex AI در مناطق زیر موجود است. برخی از مدل‌ها و/یا نسخه‌های خاص ممکن است در همه مکان‌ها در دسترس نباشند (برای در دسترس بودن مکان دقیق، به مستندات Google Cloud مراجعه کنید).

ایالات متحده آمریکا

  • کلمبوس، اوهایو ( us-east5 )
  • دالاس، تگزاس ( us-south1 )
  • آیووا ( us-central1 )
  • لاس وگاس، نوادا ( us-west4 )
  • Moncks Corner، کارولینای جنوبی ( 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 1)
  • هنگ کنگ، چین ( asia-east2 )
  • بمبئی، هند ( asia-south1 )
  • سئول، کره ( asia-northeast3 )
  • سنگاپور ( asia-southeast1 )
  • سیدنی، استرالیا ( australia-southeast1 )
  • توکیو، ژاپن ( asia-northeast1 1)

خاورمیانه

  • دمام، عربستان سعودی ( me-central2 )
  • دوحه، قطر ( me-central1 )
  • تل آویو، اسرائیل ( me-west1 )