From deaf11dc63ca7c5300badeb29b23ff5ce8f9ecad Mon Sep 17 00:00:00 2001 From: Cynthia J Date: Wed, 23 Oct 2024 11:04:26 -0700 Subject: [PATCH 1/2] fix the url in the service not available error --- .../firebase_vertexai/firebase_vertexai/lib/src/error.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/firebase_vertexai/firebase_vertexai/lib/src/error.dart b/packages/firebase_vertexai/firebase_vertexai/lib/src/error.dart index 99adc850effc..d13e4527972e 100644 --- a/packages/firebase_vertexai/firebase_vertexai/lib/src/error.dart +++ b/packages/firebase_vertexai/firebase_vertexai/lib/src/error.dart @@ -56,12 +56,16 @@ final class ServiceApiNotEnabled implements VertexAIException { 'The Vertex AI in Firebase SDK requires the Vertex AI in Firebase API ' '(`firebasevertexai.googleapis.com`) to be enabled in your Firebase project. Enable this API ' 'by visiting the Firebase Console at ' - 'https://console.firebase.google.com/$_projectId/genai ' + 'https://console.firebase.google.com/project/${_getID()}/genai ' 'and clicking "Get started". If you enabled this API recently, wait a few minutes for the ' 'action to propagate to our systems and then retry.'; @override String toString() => message; + + String _getID() { + return _projectId.replaceAll('projects/', ''); + } } /// Exception thrown when the quota is exceeded. From 28db32434c88eda74c5a35b1189e7c706ad873df Mon Sep 17 00:00:00 2001 From: Cynthia J Date: Wed, 23 Oct 2024 14:13:05 -0700 Subject: [PATCH 2/2] Update packages/firebase_vertexai/firebase_vertexai/lib/src/error.dart Co-authored-by: Nate Bosch --- .../firebase_vertexai/firebase_vertexai/lib/src/error.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/firebase_vertexai/firebase_vertexai/lib/src/error.dart b/packages/firebase_vertexai/firebase_vertexai/lib/src/error.dart index d13e4527972e..c13a434d7610 100644 --- a/packages/firebase_vertexai/firebase_vertexai/lib/src/error.dart +++ b/packages/firebase_vertexai/firebase_vertexai/lib/src/error.dart @@ -56,14 +56,14 @@ final class ServiceApiNotEnabled implements VertexAIException { 'The Vertex AI in Firebase SDK requires the Vertex AI in Firebase API ' '(`firebasevertexai.googleapis.com`) to be enabled in your Firebase project. Enable this API ' 'by visiting the Firebase Console at ' - 'https://console.firebase.google.com/project/${_getID()}/genai ' + 'https://console.firebase.google.com/project/$_id/genai ' 'and clicking "Get started". If you enabled this API recently, wait a few minutes for the ' 'action to propagate to our systems and then retry.'; @override String toString() => message; - String _getID() { + String get _id { return _projectId.replaceAll('projects/', ''); } }