Haz clic en tu proveedor de Gemini API para ver el contenido y el código específicos del proveedor en esta página. |
Los modelos de IA generativa de Google están disponibles en regiones específicas.
Cuando inicialices el servicio de backend de Vertex AI Gemini API en tu código, puedes especificar de forma opcional la ubicación del modelo al que accedes en tus solicitudes. Si no especificas una ubicación, el valor predeterminado es us-central1
.
Consulta la lista de ubicaciones disponibles más adelante en esta página.
Firebase AI Logic aún no admite la ubicación global para Vertex AI.
Muestras de código
Ten en cuenta que en estos ejemplos se muestra el acceso a un modelo Gemini, pero también puedes especificar la ubicación cuando accedes a un modelo Imagen 3.
Reemplaza LOCATION por el código de ubicación (por ejemplo, europe-west4
) de la lista de ubicaciones disponibles que aparece más adelante en esta página.
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");
// ...
Ubicaciones disponibles
Google Cloud usa regiones. Google Cloud solo almacena los datos del cliente en la región que especifiques para todas las funciones de disponibilidad general de la IA generativa en Vertex AI.
La IA generativa en Vertex AI está disponible en las siguientes regiones: Es posible que algunos modelos o versiones específicas no estén disponibles en todas las ubicaciones (para obtener información detallada sobre la disponibilidad de las ubicaciones, consulta la documentación de Google Cloud).
Estados Unidos
- Columbus, Ohio (
us-east5
) - Dallas, Texas (
us-south1
) - Iowa (
us-central1
) - Las Vegas, Nevada - (
us-west4
) - Moncks Corner, Carolina del Sur (
us-east1
) - Virginia del Norte (
us-east4
) - Oregón (
us-west1
)
Canadá
- Montreal (
northamerica-northeast1
)
Sudamérica
- São Paulo, Brasil (
southamerica-east1
)
Europa
- Bélgica (
europe-west1
) - Finlandia (
europe-north1
) - Fráncfort, Alemania (
europe-west3
) - Londres, Reino Unido (
europe-west2
) - Madrid, España (
europe-southwest1
) - Milán, Italia (
europe-west8
) - Países Bajos (
europe-west4
) - París, Francia (
europe-west9
) - Varsovia, Polonia (
europe-central2
) - Zúrich, Suiza (
europe-west6
)
Asia-Pacífico
- Condado de Changhua, Taiwán (
asia-east1
) - Hong Kong, China (
asia-east2
) - Bombay, India (
asia-south1
) - Seúl, Corea (
asia-northeast3
) - Singapur (
asia-southeast1
) - Sídney, Australia (
australia-southeast1
) - Tokio, Japón (
asia-northeast1
)
Oriente Medio
- Dammam, Arabia Saudita (
me-central2
) - Doha, Catar (
me-central1
) - Tel Aviv, Israel (
me-west1
)