Skip to content

Commit 077229f

Browse files
authored
Merge 320316d into 6b035b7
2 parents 6b035b7 + 320316d commit 077229f

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

packages/vertexai/src/methods/generate-content.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ describe('generateContent()', () => {
231231
} as Response);
232232
await expect(
233233
generateContent(fakeApiSettings, 'model', fakeRequestParams)
234-
).to.be.rejectedWith(/firebasevertexai\.googleapis.*my-project/);
234+
).to.be.rejectedWith(
235+
/firebasevertexai\.googleapis[\s\S]*my-project[\s\S]*api-not-enabled/
236+
);
235237
expect(mockFetch).to.be.called;
236238
});
237239
});

packages/vertexai/src/requests/request.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,13 @@ export async function makeRequest(
166166
) {
167167
throw new VertexAIError(
168168
VertexAIErrorCode.API_NOT_ENABLED,
169-
`The Vertex AI for Firebase SDK requires the Firebase Vertex AI API ` +
170-
`firebasevertexai.googleapis.com to be enabled for your ` +
171-
`project. Get started in the Firebase Console` +
172-
` (https://console.firebase.google.com/project/${url.apiSettings.project}/genai/vertex)` +
173-
` or verify that the API is enabled in the Google Cloud` +
174-
` Console (https://console.developers.google.com/apis/api/firebasevertexai.googleapis.com/overview?project=${url.apiSettings.project}).`,
169+
`The Vertex AI in Firebase SDK requires the Vertex AI in Firebase
170+
API ('firebasevertexai.googleapis.com') to be enabled in your
171+
Firebase project. Enable this API by visiting the Firebase Console
172+
at https://console.firebase.google.com/project/${url.apiSettings.project}/genai/
173+
and clicking "Get started". If you enabled this API recently,
174+
wait a few minutes for the action to propagate to our systems and
175+
then retry.`,
175176
{
176177
status: response.status,
177178
statusText: response.statusText,

0 commit comments

Comments
 (0)