File tree Expand file tree Collapse file tree 9 files changed +11
-10
lines changed
Expand file tree Collapse file tree 9 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff 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`).
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 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.
You can’t perform that action at this time.
0 commit comments