1- import { VertexAIError } from "../errors" ;
2- import { VertexAI , VertexAIErrorCode } from "../public-types" ;
3- import { VertexAIService } from "../service" ;
4- import { ApiSettings } from "../types/internal" ;
1+ /**
2+ * @license
3+ * Copyright 2025 Google LLC
4+ *
5+ * Licensed under the Apache License, Version 2.0 (the "License");
6+ * you may not use this file except in compliance with the License.
7+ * You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+
18+ import { VertexAIError } from '../errors' ;
19+ import { VertexAI , VertexAIErrorCode } from '../public-types' ;
20+ import { VertexAIService } from '../service' ;
21+ import { ApiSettings } from '../types/internal' ;
522
623/**
724 * Base class for Vertex AI in Firebase model APIs.
@@ -10,7 +27,7 @@ import { ApiSettings } from "../types/internal";
1027 */
1128export class VertexAIModel {
1229 /**
13- * The fully qualified model resource name to use for generating images
30+ * The fully qualified model resource name to use for generating images
1431 * (e.g. `publishers/google/models/imagen-3.0-generate-001`).
1532 */
1633 readonly model : string ;
@@ -22,25 +39,22 @@ export class VertexAIModel {
2239
2340 /**
2441 * Constructs a new instance of the {@link VertexAIModel} class.
25- *
42+ *
2643 * This constructor should only be called from subclasses that provide
2744 * a model API.
2845 *
2946 * @param vertexAI - An instance of the Vertex AI in Firebase SDK.
3047 * @param modelName - The name of the model being used. It can be in one of the following formats:
3148 * - `my-model` (short name, will resolve to `publishers/google/models/my-model`)
3249 * - `models/my-model` (will resolve to `publishers/google/models/my-model`)
33- * - `publishers/my-publisher/models/my-model` (fully qualified model name)
34- *
50+ * - `publishers/my-publisher/models/my-model` (fully qualified model name)
51+ *
3552 * @throws If the `apiKey` or `projectId` fields are missing in your
3653 * Firebase config.
37- *
54+ *
3855 * @internal
3956 */
40- protected constructor (
41- vertexAI : VertexAI ,
42- modelName : string
43- ) {
57+ protected constructor ( vertexAI : VertexAI , modelName : string ) {
4458 this . model = VertexAIModel . normalizeModelName ( modelName ) ;
4559
4660 if ( ! vertexAI . app ?. options ?. apiKey ) {
@@ -73,7 +87,7 @@ export class VertexAIModel {
7387
7488 /**
7589 * Normalizes the given model name to a fully qualified model resource name.
76- *
90+ *
7791 * @param modelName - The model name to normalize.
7892 * @returns The fully qualified model resource name.
7993 */
@@ -94,4 +108,4 @@ export class VertexAIModel {
94108
95109 return model ;
96110 }
97- }
111+ }
0 commit comments