Skip to content

Commit 72961ec

Browse files
committed
add top-level comments
1 parent ec6ae3c commit 72961ec

File tree

6 files changed

+161
-26
lines changed

6 files changed

+161
-26
lines changed

common/api-review/ai.api.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const BackendType: {
104104
readonly GOOGLE_AI: "GOOGLE_AI";
105105
};
106106

107-
// @public (undocumented)
107+
// @public
108108
export type BackendType = (typeof BackendType)[keyof typeof BackendType];
109109

110110
// @public
@@ -123,7 +123,7 @@ export const BlockReason: {
123123
readonly PROHIBITED_CONTENT: "PROHIBITED_CONTENT";
124124
};
125125

126-
// @public (undocumented)
126+
// @public
127127
export type BlockReason = (typeof BlockReason)[keyof typeof BlockReason];
128128

129129
// @public
@@ -342,7 +342,7 @@ export const FinishReason: {
342342
readonly MALFORMED_FUNCTION_CALL: "MALFORMED_FUNCTION_CALL";
343343
};
344344

345-
// @public (undocumented)
345+
// @public
346346
export type FinishReason = (typeof FinishReason)[keyof typeof FinishReason];
347347

348348
// @public
@@ -656,7 +656,7 @@ export const HarmBlockMethod: {
656656
readonly PROBABILITY: "PROBABILITY";
657657
};
658658

659-
// @public (undocumented)
659+
// @public
660660
export type HarmBlockMethod = (typeof HarmBlockMethod)[keyof typeof HarmBlockMethod];
661661

662662
// @public
@@ -668,7 +668,7 @@ export const HarmBlockThreshold: {
668668
readonly OFF: "OFF";
669669
};
670670

671-
// @public (undocumented)
671+
// @public
672672
export type HarmBlockThreshold = (typeof HarmBlockThreshold)[keyof typeof HarmBlockThreshold];
673673

674674
// @public
@@ -679,7 +679,7 @@ export const HarmCategory: {
679679
readonly HARM_CATEGORY_DANGEROUS_CONTENT: "HARM_CATEGORY_DANGEROUS_CONTENT";
680680
};
681681

682-
// @public (undocumented)
682+
// @public
683683
export type HarmCategory = (typeof HarmCategory)[keyof typeof HarmCategory];
684684

685685
// @public
@@ -690,7 +690,7 @@ export const HarmProbability: {
690690
readonly HIGH: "HIGH";
691691
};
692692

693-
// @public (undocumented)
693+
// @public
694694
export type HarmProbability = (typeof HarmProbability)[keyof typeof HarmProbability];
695695

696696
// @public
@@ -702,7 +702,7 @@ export const HarmSeverity: {
702702
readonly HARM_SEVERITY_UNSUPPORTED: "HARM_SEVERITY_UNSUPPORTED";
703703
};
704704

705-
// @public (undocumented)
705+
// @public
706706
export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity];
707707

708708
// @beta
@@ -721,7 +721,7 @@ export const ImagenAspectRatio: {
721721
readonly PORTRAIT_9x16: "9:16";
722722
};
723723

724-
// @public (undocumented)
724+
// @beta
725725
export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio];
726726

727727
// @beta
@@ -785,7 +785,7 @@ export const ImagenPersonFilterLevel: {
785785
readonly ALLOW_ALL: "allow_all";
786786
};
787787

788-
// @public (undocumented)
788+
// @beta
789789
export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel];
790790

791791
// @beta
@@ -796,7 +796,7 @@ export const ImagenSafetyFilterLevel: {
796796
readonly BLOCK_NONE: "block_none";
797797
};
798798

799-
// @public (undocumented)
799+
// @beta
800800
export type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel];
801801

802802
// @beta
@@ -959,7 +959,7 @@ export const LiveResponseType: {
959959
TOOL_CALL_CANCELLATION: string;
960960
};
961961

962-
// @public (undocumented)
962+
// @beta
963963
export type LiveResponseType = (typeof LiveResponseType)[keyof typeof LiveResponseType];
964964

965965
// @beta
@@ -1009,7 +1009,7 @@ export const Modality: {
10091009
readonly DOCUMENT: "DOCUMENT";
10101010
};
10111011

1012-
// @public (undocumented)
1012+
// @public
10131013
export type Modality = (typeof Modality)[keyof typeof Modality];
10141014

10151015
// @public

docs-devsite/ai.md

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,25 +176,25 @@ The Firebase AI Web SDK.
176176
| Type Alias | Description |
177177
| --- | --- |
178178
| [AIErrorCode](./ai.md#aierrorcode) | Standardized error codes that [AIError](./ai.aierror.md#aierror_class) can have. |
179-
| [BackendType](./ai.md#backendtype) | |
180-
| [BlockReason](./ai.md#blockreason) | |
181-
| [FinishReason](./ai.md#finishreason) | |
179+
| [BackendType](./ai.md#backendtype) | An enum-like object containing constants that represent the supported backends for the Firebase AI SDK. |
180+
| [BlockReason](./ai.md#blockreason) | Reason that a prompt was blocked. |
181+
| [FinishReason](./ai.md#finishreason) | Reason that a candidate finished. |
182182
| [FunctionCallingMode](./ai.md#functioncallingmode) | |
183-
| [HarmBlockMethod](./ai.md#harmblockmethod) | |
184-
| [HarmBlockThreshold](./ai.md#harmblockthreshold) | |
185-
| [HarmCategory](./ai.md#harmcategory) | |
186-
| [HarmProbability](./ai.md#harmprobability) | |
187-
| [HarmSeverity](./ai.md#harmseverity) | |
188-
| [ImagenAspectRatio](./ai.md#imagenaspectratio) | |
189-
| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | |
190-
| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | |
183+
| [HarmBlockMethod](./ai.md#harmblockmethod) | This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)<!-- -->). |
184+
| [HarmBlockThreshold](./ai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. |
185+
| [HarmCategory](./ai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. |
186+
| [HarmProbability](./ai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. |
187+
| [HarmSeverity](./ai.md#harmseverity) | Harm severity levels. |
188+
| [ImagenAspectRatio](./ai.md#imagenaspectratio) | <b><i>(Public Preview)</i></b> Aspect ratios for Imagen images. |
189+
| [ImagenPersonFilterLevel](./ai.md#imagenpersonfilterlevel) | <b><i>(Public Preview)</i></b> A filter level controlling whether generation of images containing people or faces is allowed. |
190+
| [ImagenSafetyFilterLevel](./ai.md#imagensafetyfilterlevel) | <b><i>(Public Preview)</i></b> A filter level controlling how aggressively to filter sensitive content. |
191191
| [InferenceMode](./ai.md#inferencemode) | <b><i>(Public Preview)</i></b> Determines whether inference happens on-device or in-cloud. |
192192
| [Language](./ai.md#language) | <b><i>(Public Preview)</i></b> The programming language of the code. |
193193
| [LanguageModelMessageContentValue](./ai.md#languagemodelmessagecontentvalue) | <b><i>(Public Preview)</i></b> Content formats that can be provided as on-device message content. |
194194
| [LanguageModelMessageRole](./ai.md#languagemodelmessagerole) | <b><i>(Public Preview)</i></b> Allowable roles for on-device language model usage. |
195195
| [LanguageModelMessageType](./ai.md#languagemodelmessagetype) | <b><i>(Public Preview)</i></b> Allowable types for on-device language model messages. |
196-
| [LiveResponseType](./ai.md#liveresponsetype) | |
197-
| [Modality](./ai.md#modality) | |
196+
| [LiveResponseType](./ai.md#liveresponsetype) | <b><i>(Public Preview)</i></b> The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive)<!-- -->. |
197+
| [Modality](./ai.md#modality) | Content part modality. |
198198
| [Outcome](./ai.md#outcome) | <b><i>(Public Preview)</i></b> Represents the result of the code execution. |
199199
| [Part](./ai.md#part) | Content part - includes text, image/video, or function call/response part types. |
200200
| [ResponseModality](./ai.md#responsemodality) | <b><i>(Public Preview)</i></b> Generation modalities to be returned in generation responses. |
@@ -821,6 +821,10 @@ export type AIErrorCode = (typeof AIErrorCode)[keyof typeof AIErrorCode];
821821

822822
## BackendType
823823

824+
An enum-like object containing constants that represent the supported backends for the Firebase AI SDK.
825+
826+
This determines which backend service (Vertex AI Gemini API or Gemini Developer API) the SDK will communicate with. These values are assigned to the `backendType` property within the specific backend configuration objects ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class) or [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)<!-- -->) to identify which service to target.
827+
824828
<b>Signature:</b>
825829

826830
```typescript
@@ -829,6 +833,8 @@ export type BackendType = (typeof BackendType)[keyof typeof BackendType];
829833

830834
## BlockReason
831835

836+
Reason that a prompt was blocked.
837+
832838
<b>Signature:</b>
833839

834840
```typescript
@@ -837,6 +843,8 @@ export type BlockReason = (typeof BlockReason)[keyof typeof BlockReason];
837843

838844
## FinishReason
839845

846+
Reason that a candidate finished.
847+
840848
<b>Signature:</b>
841849

842850
```typescript
@@ -854,6 +862,8 @@ export type FunctionCallingMode = (typeof FunctionCallingMode)[keyof typeof Func
854862

855863
## HarmBlockMethod
856864

865+
This property is not supported in the Gemini Developer API ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)<!-- -->).
866+
857867
<b>Signature:</b>
858868

859869
```typescript
@@ -862,6 +872,8 @@ export type HarmBlockMethod = (typeof HarmBlockMethod)[keyof typeof HarmBlockMet
862872

863873
## HarmBlockThreshold
864874

875+
Threshold above which a prompt or candidate will be blocked.
876+
865877
<b>Signature:</b>
866878

867879
```typescript
@@ -870,6 +882,8 @@ export type HarmBlockThreshold = (typeof HarmBlockThreshold)[keyof typeof HarmBl
870882

871883
## HarmCategory
872884

885+
Harm categories that would cause prompts or candidates to be blocked.
886+
873887
<b>Signature:</b>
874888

875889
```typescript
@@ -878,6 +892,8 @@ export type HarmCategory = (typeof HarmCategory)[keyof typeof HarmCategory];
878892

879893
## HarmProbability
880894

895+
Probability that a prompt or candidate matches a harm category.
896+
881897
<b>Signature:</b>
882898

883899
```typescript
@@ -886,6 +902,8 @@ export type HarmProbability = (typeof HarmProbability)[keyof typeof HarmProbabil
886902

887903
## HarmSeverity
888904

905+
Harm severity levels.
906+
889907
<b>Signature:</b>
890908

891909
```typescript
@@ -894,6 +912,13 @@ export type HarmSeverity = (typeof HarmSeverity)[keyof typeof HarmSeverity];
894912

895913
## ImagenAspectRatio
896914

915+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
916+
>
917+
918+
Aspect ratios for Imagen images.
919+
920+
To specify an aspect ratio for generated images, set the `aspectRatio` property in your [ImagenGenerationConfig](./ai.imagengenerationconfig.md#imagengenerationconfig_interface)<!-- -->. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) for more details and examples of the supported aspect ratios.
921+
897922
<b>Signature:</b>
898923

899924
```typescript
@@ -902,6 +927,13 @@ export type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAs
902927

903928
## ImagenPersonFilterLevel
904929

930+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
931+
>
932+
933+
A filter level controlling whether generation of images containing people or faces is allowed.
934+
935+
See the <a href="http://firebase.google.com/docs/vertex-ai/generate-images">personGeneration</a> documentation for more details.
936+
905937
<b>Signature:</b>
906938

907939
```typescript
@@ -910,6 +942,13 @@ export type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typ
910942

911943
## ImagenSafetyFilterLevel
912944

945+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
946+
>
947+
948+
A filter level controlling how aggressively to filter sensitive content.
949+
950+
Text prompts provided as inputs and images (generated or uploaded) through Imagen on Vertex AI are assessed against a list of safety filters, which include 'harmful categories' (for example, `violence`<!-- -->, `sexual`<!-- -->, `derogatory`<!-- -->, and `toxic`<!-- -->). This filter level controls how aggressively to filter out potentially harmful content from responses. See the [documentation](http://firebase.google.com/docs/vertex-ai/generate-images) and the [Responsible AI and usage guidelines](https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters) for more details.
951+
913952
<b>Signature:</b>
914953

915954
```typescript
@@ -983,6 +1022,11 @@ export type LanguageModelMessageType = 'text' | 'image' | 'audio';
9831022

9841023
## LiveResponseType
9851024

1025+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
1026+
>
1027+
1028+
The types of responses that can be returned by [LiveSession.receive()](./ai.livesession.md#livesessionreceive)<!-- -->.
1029+
9861030
<b>Signature:</b>
9871031

9881032
```typescript
@@ -991,6 +1035,8 @@ export type LiveResponseType = (typeof LiveResponseType)[keyof typeof LiveRespon
9911035

9921036
## Modality
9931037

1038+
Content part modality.
1039+
9941040
<b>Signature:</b>
9951041

9961042
```typescript

packages/ai/src/public-types.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ export const BackendType = {
7373
GOOGLE_AI: 'GOOGLE_AI'
7474
} as const; // Using 'as const' makes the string values literal types
7575

76+
/**
77+
* An enum-like object containing constants that represent the supported backends
78+
* for the Firebase AI SDK.
79+
*
80+
* @remarks
81+
* This determines which backend service (Vertex AI Gemini API or Gemini Developer API)
82+
* the SDK will communicate with. These values are assigned to the `backendType` property
83+
* within the specific backend configuration objects ({@link GoogleAIBackend} or
84+
* {@link VertexAIBackend}) to identify which service to target.
85+
*
86+
* @public
87+
*/
7688
export type BackendType = (typeof BackendType)[keyof typeof BackendType];
7789

7890
/**

0 commit comments

Comments
 (0)