Skip to content

Commit d967900

Browse files
committed
fixes
1 parent b8dd77e commit d967900

File tree

9 files changed

+11
-10
lines changed

9 files changed

+11
-10
lines changed

packages/vertexai/src/models/imagen-model.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2024 Google LLC
3+
* Copyright 2025 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

packages/vertexai/src/models/imagen-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2024 Google LLC
3+
* Copyright 2025 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

packages/vertexai/src/models/vertexai-model.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2024 Google LLC
3+
* Copyright 2025 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

packages/vertexai/src/models/vertexai-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { _isFirebaseServerApp } from '@firebase/app';
2626
*
2727
* @public
2828
*/
29-
export class VertexAIModel {
29+
export abstract class VertexAIModel {
3030
/**
3131
* The fully qualified model resource name to use for generating images
3232
* (e.g. `publishers/google/models/imagen-3.0-generate-001`).

packages/vertexai/src/requests/response-helpers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,11 @@ export async function handlePredictResponse<
216216
const images: T[] = [];
217217
let filteredReason: string | undefined = undefined;
218218

219+
// The backend should always send a non-empty array of predictions if the response was successful.
219220
if (!responseJson.predictions || responseJson.predictions?.length === 0) {
220221
throw new VertexAIError(
221-
VertexAIErrorCode.ERROR,
222-
"Predictions array is undefined or empty in response. Was 'includeRaiReason' enabled in the request?"
222+
VertexAIErrorCode.RESPONSE_ERROR,
223+
"No predictions or filtered reason received from Vertex AI. Please report this issue with the full error details at https://github.com/firebase/firebase-js-sdk/issues."
223224
);
224225
}
225226

packages/vertexai/src/types/imagen/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2024 Google LLC
3+
* Copyright 2025 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

packages/vertexai/src/types/imagen/internal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2024 Google LLC
3+
* Copyright 2025 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

packages/vertexai/src/types/imagen/requests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2024 Google LLC
3+
* Copyright 2025 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

packages/vertexai/src/types/imagen/responses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2024 Google LLC
3+
* Copyright 2025 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)