@@ -265,23 +265,33 @@ struct GenerativeAIService {
265265 private func logRPCError( _ error: RPCError) {
266266 // TODO(andrewheard): Remove this check after the Vertex AI in Firebase API launch.
267267 if error. isFirebaseMLServiceDisabledError ( ) {
268- VertexLog . error ( code : . vertexAIInFirebaseAPIDisabled , """
268+ let message = """
269269 The Vertex AI for Firebase SDK requires the Firebase ML API `firebaseml.googleapis.com` to \
270- be enabled for your project. Get started in the Firebase Console \
271- (https://console.firebase.google.com/project/ \( projectID) /genai/vertex) or verify that the \
272- API is enabled in the Google Cloud Console \
273- (https://console.developers.google.com/apis/api/firebaseml.googleapis.com/overview?project= \
274- \( projectID) ).
275- """ )
270+ be enabled for your project. Enable it by visiting the the Firebase Console at
271+ https://console.firebase.google.com/project/ \( projectID) /genai/vertex then retry. If you
272+ enabled this API recently, wait a few minutes for the action to propagate to our systems and
273+ retry.
274+ """
275+ #if DEBUG
276+ fatalError ( message)
277+ #else
278+ VertexLog . error ( code: . vertexAIInFirebaseAPIDisabled, message)
279+ #endif // DEBUG
276280 }
277281
278282 if error. isVertexAIInFirebaseServiceDisabledError ( ) {
279- VertexLog . error ( code : . vertexAIInFirebaseAPIDisabled , """
283+ let message = """
280284 The Vertex AI for Firebase SDK requires the Firebase Vertex AI API \
281- `firebasevertexai.googleapis.com` to be enabled for your project. Get started by visiting \
282- the Firebase Console at: \
283- https://console.firebase.google.com/project/ \( projectID) /genai/vertex
284- """ )
285+ `firebasevertexai.googleapis.com` to be enabled for your project. Enable it by visiting the \
286+ the Firebase Console at https://console.firebase.google.com/project/ \( projectID) /genai/vertex
287+ then retry. If you enabled this API recently, wait a few minutes for the action to propagate
288+ to our systems and retry.
289+ """
290+ #if DEBUG
291+ fatalError ( message)
292+ #else
293+ VertexLog . error ( code: . vertexAIInFirebaseAPIDisabled, message)
294+ #endif // DEBUG
285295 }
286296 }
287297
0 commit comments