@@ -25,27 +25,33 @@ public class VertexAI: NSObject {
2525
2626 /// The default `VertexAI` instance.
2727 ///
28+ /// - Parameter location: The region identifier, defaulting to `us-central1`; see [Vertex AI
29+ /// regions](https://cloud.google.com/vertex-ai/docs/general/locations#vertex-ai-regions) for a
30+ /// list of supported regions.
2831 /// - Returns: An instance of `VertexAI`, configured with the default `FirebaseApp`.
29- public static func vertexAI( ) -> VertexAI {
32+ public static func vertexAI( location : String = " us-central1 " ) -> VertexAI {
3033 guard let app = FirebaseApp . app ( ) else {
3134 fatalError ( " No instance of the default Firebase app was found. " )
3235 }
3336
34- return vertexAI ( app: app)
37+ return vertexAI ( app: app, location : location )
3538 }
3639
3740 /// Creates an instance of `VertexAI` configured with a custom `FirebaseApp`.
3841 ///
3942 /// - Parameters:
4043 /// - app: The custom `FirebaseApp` used for initialization.
44+ /// - location: The region identifier, defaulting to `us-central1`; see [Vertex AI
45+ /// regions](https://cloud.google.com/vertex-ai/docs/general/locations#vertex-ai-regions)
46+ /// for a list of supported regions.
4147 /// - Returns: A `VertexAI` instance, configured with the custom `FirebaseApp`.
42- public static func vertexAI( app: FirebaseApp ) -> VertexAI {
48+ public static func vertexAI( app: FirebaseApp , location : String = " us-central1 " ) -> VertexAI {
4349 guard let provider = ComponentType< VertexAIProvider> . instance( for: VertexAIProvider . self,
4450 in: app. container) else {
4551 fatalError ( " No \( VertexAIProvider . self) instance found for Firebase app: \( app. name) " )
4652 }
4753
48- return provider. vertexAI ( " us-central1 " )
54+ return provider. vertexAI ( location )
4955 }
5056
5157 /// Initializes a generative model with the given parameters.
0 commit comments