@@ -53,7 +53,8 @@ public final class GenerativeModel: Sendable {
5353 /// Initializes a new remote model with the given parameters.
5454 ///
5555 /// - Parameters:
56- /// - name: The name of the model to use, for example `"gemini-1.0-pro"`.
56+ /// - modelResourceName: The resource name of the model to use, for example
57+ /// `"projects/{project-id}/locations/{location-id}/publishers/google/models/{model-name}"`.
5758 /// - firebaseInfo: Firebase data used by the SDK, including project ID and API key.
5859 /// - apiConfig: Configuration for the backend API used by this model.
5960 /// - generationConfig: The content generation parameters your model should use.
@@ -64,7 +65,7 @@ public final class GenerativeModel: Sendable {
6465 /// only text content is supported.
6566 /// - requestOptions: Configuration parameters for sending requests to the backend.
6667 /// - urlSession: The `URLSession` to use for requests; defaults to `URLSession.shared`.
67- init ( name : String ,
68+ init ( modelResourceName : String ,
6869 firebaseInfo: FirebaseInfo ,
6970 apiConfig: APIConfig ,
7071 generationConfig: GenerationConfig ? = nil ,
@@ -74,14 +75,7 @@ public final class GenerativeModel: Sendable {
7475 systemInstruction: ModelContent ? = nil ,
7576 requestOptions: RequestOptions ,
7677 urlSession: URLSession = . shared) {
77- if !name. starts ( with: GenerativeModel . geminiModelNamePrefix) {
78- VertexLog . warning ( code: . unsupportedGeminiModel, """
79- Unsupported Gemini model " \( name) " ; see \
80- https://firebase.google.com/docs/vertex-ai/models for a list supported Gemini model names.
81- """ )
82- }
83-
84- modelResourceName = name
78+ self . modelResourceName = modelResourceName
8579 self . apiConfig = apiConfig
8680 generativeAIService = GenerativeAIService (
8781 firebaseInfo: firebaseInfo,
@@ -108,7 +102,7 @@ public final class GenerativeModel: Sendable {
108102 ` \( VertexLog . enableArgumentKey) ` as a launch argument in Xcode.
109103 """ )
110104 }
111- VertexLog . debug ( code: . generativeModelInitialized, " Model \( name ) initialized. " )
105+ VertexLog . debug ( code: . generativeModelInitialized, " Model \( modelResourceName ) initialized. " )
112106 }
113107
114108 /// Generates content from String and/or image inputs, given to the model as a prompt, that are
0 commit comments