Các mô hình AI tạo sinh của Google được hiển thị bằng các điểm cuối theo khu vực cụ thể.
Khi khởi chạy dịch vụ Vertex AI, bạn có thể không bắt buộc chỉ định vị trí điểm cuối cho mô hình mà bạn đang truy cập trong các yêu cầu. Nếu bạn không chỉ định vị trí, giá trị mặc định sẽ là us-central1
. Xem danh sách các vị trí hiện có ở phần sau của trang này.
Vertex AI in Firebase chưa hỗ trợ điểm cuối toàn cục cho Vertex AI.
Mã mẫu
Xin lưu ý rằng các mẫu này cho thấy việc truy cập vào mô hình Gemini, nhưng bạn cũng có thể chỉ định vị trí khi truy cập vào mô hình Imagen 3.
Thay thế LOCATION bằng mã vị trí (ví dụ: europe-west4
) trong danh sách các vị trí có sẵn ở phần sau của trang này.
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');
Địa điểm cung cấp
Google Cloud sử dụng khu vực để xác định các điểm cuối theo khu vực. Google Cloud chỉ lưu trữ dữ liệu khách hàng trong khu vực mà bạn chỉ định cho tất cả các tính năng phổ biến của AI tạo sinh trên Vertex AI.
AI tạo sinh trên Vertex AI được cung cấp ở những khu vực sau. Một số mẫu và/hoặc phiên bản cụ thể có thể không có ở một số vị trí (để biết thông tin chi tiết về phạm vi cung cấp theo vị trí, hãy xem tài liệu về Google Cloud).
Hoa Kỳ
- Columbus, Ohio (
us-east5
) - Dallas, Texas (
us-south1
) - Iowa (
us-central1
) - Las Vegas, Nevada (
us-west4
) - Moncks Corner, South Carolina (
us-east1
) - Northern Virginia (
us-east4
) - Oregon (
us-west1
)
Canada
- Montréal (
northamerica-northeast1
)
Nam Mỹ
- Sao Paulo, Brazil (
southamerica-east1
)
Châu Âu
- Bỉ (
europe-west1
) - Phần Lan (
europe-north1
) - Frankfurt, Đức (
europe-west3
) - London, Vương quốc Anh (
europe-west2
) - Madrid, Tây Ban Nha (
europe-southwest1
) - Milan, Ý (
europe-west8
) - Hà Lan (
europe-west4
) - Paris, Pháp (
europe-west9
) - Warsaw, Ba Lan (
europe-central2
) - Zürich, Thuỵ Sĩ (
europe-west6
)
Châu Á Thái Bình Dương
- Huyện Chương Hóa, Đài Loan (
asia-east1
) - Hong Kong, Trung Quốc (
asia-east2
) - Mumbai, Ấn Độ (
asia-south1
) - Seoul, Hàn Quốc (
asia-northeast3
) - Singapore (
asia-southeast1
) - Sydney, Úc (
australia-southeast1
) - Tokyo, Nhật Bản (
asia-northeast1
)
Trung Đông
- Dammam, Ả Rập Xê Út (
me-central2
) - Doha, Qatar (
me-central1
) - Tel Aviv, Israel (
me-west1
)