@@ -53,7 +53,8 @@ public final class GenerativeModel: Sendable {
53
53
/// Initializes a new remote model with the given parameters.
54
54
///
55
55
/// - 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}"`.
57
58
/// - firebaseInfo: Firebase data used by the SDK, including project ID and API key.
58
59
/// - apiConfig: Configuration for the backend API used by this model.
59
60
/// - generationConfig: The content generation parameters your model should use.
@@ -64,7 +65,7 @@ public final class GenerativeModel: Sendable {
64
65
/// only text content is supported.
65
66
/// - requestOptions: Configuration parameters for sending requests to the backend.
66
67
/// - urlSession: The `URLSession` to use for requests; defaults to `URLSession.shared`.
67
- init ( name : String ,
68
+ init ( modelResourceName : String ,
68
69
firebaseInfo: FirebaseInfo ,
69
70
apiConfig: APIConfig ,
70
71
generationConfig: GenerationConfig ? = nil ,
@@ -74,14 +75,7 @@ public final class GenerativeModel: Sendable {
74
75
systemInstruction: ModelContent ? = nil ,
75
76
requestOptions: RequestOptions ,
76
77
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
85
79
self . apiConfig = apiConfig
86
80
generativeAIService = GenerativeAIService (
87
81
firebaseInfo: firebaseInfo,
@@ -108,7 +102,7 @@ public final class GenerativeModel: Sendable {
108
102
` \( VertexLog . enableArgumentKey) ` as a launch argument in Xcode.
109
103
""" )
110
104
}
111
- VertexLog . debug ( code: . generativeModelInitialized, " Model \( name ) initialized. " )
105
+ VertexLog . debug ( code: . generativeModelInitialized, " Model \( modelResourceName ) initialized. " )
112
106
}
113
107
114
108
/// Generates content from String and/or image inputs, given to the model as a prompt, that are
0 commit comments