Skip to content

Commit 05c8294

Browse files
committed
Write reference documentation
1 parent 52bdd1c commit 05c8294

File tree

11 files changed

+286
-69
lines changed

11 files changed

+286
-69
lines changed

common/api-review/vertexai.api.md

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ export class ArraySchema extends Schema {
1818
toJSON(): SchemaRequest;
1919
}
2020

21-
// @public (undocumented)
21+
// @public
2222
export type Backend = GoogleAIBackend | VertexAIBackend;
2323

24-
// @public (undocumented)
24+
// @public
2525
export const BackendType: {
2626
readonly VERTEX_AI: "VERTEX_AI";
2727
readonly GOOGLE_AI: "GOOGLE_AI";
2828
};
2929

30-
// @public (undocumented)
30+
// @public
3131
export type BackendType = (typeof BackendType)[keyof typeof BackendType];
3232

3333
// @public
@@ -254,25 +254,20 @@ export interface FunctionResponsePart {
254254
// @public
255255
export interface GenAI {
256256
app: FirebaseApp;
257-
// (undocumented)
258257
backend: Backend;
259-
// @deprecated (undocumented)
258+
// @deprecated
260259
location: string;
261260
}
262261

263262
// @public
264-
class GenAIError extends FirebaseError {
263+
export class GenAIError extends FirebaseError {
265264
constructor(code: GenAIErrorCode, message: string, customErrorData?: CustomErrorData | undefined);
266265
// (undocumented)
267266
readonly code: GenAIErrorCode;
268267
// (undocumented)
269268
readonly customErrorData?: CustomErrorData | undefined;
270269
}
271270

272-
export { GenAIError }
273-
274-
export { GenAIError as VertexAIError }
275-
276271
// @public
277272
const enum GenAIErrorCode {
278273
API_NOT_ENABLED = "api-not-enabled",
@@ -295,7 +290,7 @@ export { GenAIErrorCode }
295290
export { GenAIErrorCode as VertexAIErrorCode }
296291

297292
// @public
298-
abstract class GenAIModel {
293+
export abstract class GenAIModel {
299294
// @internal
300295
protected constructor(genAI: GenAI, modelName: string);
301296
// @internal (undocumented)
@@ -305,13 +300,8 @@ abstract class GenAIModel {
305300
static normalizeModelName(modelName: string, backendType: BackendType): string;
306301
}
307302

308-
export { GenAIModel }
309-
310-
export { GenAIModel as VertexAIModel }
311-
312-
// @public (undocumented)
303+
// @public
313304
export interface GenAIOptions {
314-
// (undocumented)
315305
backend: Backend;
316306
}
317307

@@ -431,12 +421,12 @@ export function getImagenModel(genAI: GenAI, modelParams: ImagenModelParams, req
431421
// @public
432422
export function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI;
433423

434-
// @public (undocumented)
424+
// @public
435425
export type GoogleAIBackend = {
436426
backendType: typeof BackendType.GOOGLE_AI;
437427
};
438428

439-
// @public (undocumented)
429+
// @public
440430
export function googleAIBackend(): GoogleAIBackend;
441431

442432
// @public @deprecated (undocumented)
@@ -601,9 +591,6 @@ export interface InlineDataPart {
601591
videoMetadata?: VideoMetadata;
602592
}
603593

604-
// @public (undocumented)
605-
export type InstanceIdentifier = Backend;
606-
607594
// @public
608595
export class IntegerSchema extends Schema {
609596
constructor(schemaParams?: SchemaParams);
@@ -871,15 +858,21 @@ export interface UsageMetadata {
871858
// @public (undocumented)
872859
export type VertexAI = GenAI;
873860

874-
// @public (undocumented)
861+
// @public
875862
export type VertexAIBackend = {
876863
backendType: typeof BackendType.VERTEX_AI;
877864
location: string;
878865
};
879866

880-
// @public (undocumented)
867+
// @public
881868
export function vertexAIBackend(location?: string): VertexAIBackend;
882869

870+
// @public
871+
export const VertexAIError: typeof GenAIError;
872+
873+
// @public
874+
export const VertexAIModel: typeof GenAIModel;
875+
883876
// @public
884877
export interface VertexAIOptions {
885878
// (undocumented)

docs-devsite/vertexai.genai.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ https://github.com/firebase/firebase-js-sdk
1212
# GenAI interface
1313
An instance of the Firebase GenAI SDK.
1414

15+
Do not create this instance directly. Instead, use <code>[getGenAI()](./vertexai.md#getgenai_65c48ee)</code>.
16+
1517
<b>Signature:</b>
1618

1719
```typescript
@@ -23,8 +25,8 @@ export interface GenAI
2325
| Property | Type | Description |
2426
| --- | --- | --- |
2527
| [app](./vertexai.genai.md#genaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this <code>[GenAI](./vertexai.genai.md#genai_interface)</code> instance is associated with. |
26-
| [backend](./vertexai.genai.md#genaibackend) | [Backend](./vertexai.md#backend) | |
27-
| [location](./vertexai.genai.md#genailocation) | string | |
28+
| [backend](./vertexai.genai.md#genaibackend) | [Backend](./vertexai.md#backend) | A <code>[Backend](./vertexai.md#backend)</code> instance that specifies the backend configuration. |
29+
| [location](./vertexai.genai.md#genailocation) | string | The location configured for this GenAI service instance, relevant for Vertex AI backends. |
2830

2931
## GenAI.app
3032

@@ -38,6 +40,8 @@ app: FirebaseApp;
3840

3941
## GenAI.backend
4042

43+
A <code>[Backend](./vertexai.md#backend)</code> instance that specifies the backend configuration.
44+
4145
<b>Signature:</b>
4246

4347
```typescript
@@ -51,6 +55,8 @@ backend: Backend;
5155
> This is here to maintain backwards-compatibility. Use `GenAI.backend.location` instead.
5256
>
5357

58+
The location configured for this GenAI service instance, relevant for Vertex AI backends.
59+
5460
<b>Signature:</b>
5561

5662
```typescript

docs-devsite/vertexai.genaioptions.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# GenAIOptions interface
13+
Options interface for initializing the GenAI service using <code>[getGenAI()](./vertexai.md#getgenai_65c48ee)</code>.
14+
1315
<b>Signature:</b>
1416

1517
```typescript
@@ -20,10 +22,12 @@ export interface GenAIOptions
2022

2123
| Property | Type | Description |
2224
| --- | --- | --- |
23-
| [backend](./vertexai.genaioptions.md#genaioptionsbackend) | [Backend](./vertexai.md#backend) | |
25+
| [backend](./vertexai.genaioptions.md#genaioptionsbackend) | [Backend](./vertexai.md#backend) | The backend configuration to use for the GenAI service instance. Use <code>[googleAIBackend()](./vertexai.md#googleaibackend)</code> or <code>[vertexAIBackend()](./vertexai.md#vertexaibackend_d0a4534)</code> to create this configuration. |
2426

2527
## GenAIOptions.backend
2628

29+
The backend configuration to use for the GenAI service instance. Use <code>[googleAIBackend()](./vertexai.md#googleaibackend)</code> or <code>[vertexAIBackend()](./vertexai.md#vertexaibackend_d0a4534)</code> to create this configuration.
30+
2731
<b>Signature:</b>
2832

2933
```typescript

0 commit comments

Comments
 (0)