Skip to content

Commit 47f1d3d

Browse files
committed
Adding docs
1 parent 55c05a0 commit 47f1d3d

File tree

85 files changed

+5680
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+5680
-15
lines changed

common/api-review/ai.api.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ export class BooleanSchema extends Schema {
112112

113113
// @public
114114
export class ChatSession {
115-
constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined);
115+
// Warning: (ae-forgotten-export) The symbol "ChromeAdapter" needs to be exported by the entry point index.d.ts
116+
constructor(apiSettings: ApiSettings, model: string, chromeAdapter: ChromeAdapter, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined);
116117
getHistory(): Promise<Content[]>;
117118
// (undocumented)
118119
model: string;
@@ -395,8 +396,9 @@ export interface GenerativeContentBlob {
395396

396397
// @public
397398
export class GenerativeModel extends AIModel {
398-
constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions);
399+
constructor(ai: AI, modelParams: ModelParams, chromeAdapter: ChromeAdapter, requestOptions?: RequestOptions);
399400
countTokens(request: CountTokensRequest | string | Array<string | Part>): Promise<CountTokensResponse>;
401+
static DEFAULT_HYBRID_IN_CLOUD_MODEL: string;
400402
generateContent(request: GenerateContentRequest | string | Array<string | Part>): Promise<GenerateContentResult>;
401403
generateContentStream(request: GenerateContentRequest | string | Array<string | Part>): Promise<GenerateContentStreamResult>;
402404
// (undocumented)
@@ -418,7 +420,7 @@ export class GenerativeModel extends AIModel {
418420
export function getAI(app?: FirebaseApp, options?: AIOptions): AI;
419421

420422
// @public
421-
export function getGenerativeModel(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel;
423+
export function getGenerativeModel(ai: AI, modelParams: ModelParams | HybridParams, requestOptions?: RequestOptions): GenerativeModel;
422424

423425
// @beta
424426
export function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel;
@@ -550,6 +552,13 @@ export enum HarmSeverity {
550552
HARM_SEVERITY_UNSUPPORTED = "HARM_SEVERITY_UNSUPPORTED"
551553
}
552554

555+
// @public
556+
export interface HybridParams {
557+
inCloudParams?: ModelParams;
558+
mode: InferenceMode;
559+
onDeviceParams?: OnDeviceParams;
560+
}
561+
553562
// @beta
554563
export enum ImagenAspectRatio {
555564
LANDSCAPE_16x9 = "16:9",
@@ -634,6 +643,9 @@ export interface ImagenSafetySettings {
634643
safetyFilterLevel?: ImagenSafetyFilterLevel;
635644
}
636645

646+
// @public
647+
export type InferenceMode = 'prefer_on_device' | 'only_on_device' | 'only_in_cloud';
648+
637649
// @public
638650
export interface InlineDataPart {
639651
// (undocumented)
@@ -708,6 +720,18 @@ export interface ObjectSchemaInterface extends SchemaInterface {
708720
type: SchemaType.OBJECT;
709721
}
710722

723+
// @public
724+
export interface OnDeviceParams {
725+
// Warning: (ae-forgotten-export) The symbol "LanguageModelCreateOptions" needs to be exported by the entry point index.d.ts
726+
//
727+
// (undocumented)
728+
createOptions?: LanguageModelCreateOptions;
729+
// Warning: (ae-forgotten-export) The symbol "LanguageModelPromptOptions" needs to be exported by the entry point index.d.ts
730+
//
731+
// (undocumented)
732+
promptOptions?: LanguageModelPromptOptions;
733+
}
734+
711735
// @public
712736
export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart;
713737

docs-devsite/_toc.yaml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ toc:
8080
path: /docs/reference/js/ai.groundingattribution.md
8181
- title: GroundingMetadata
8282
path: /docs/reference/js/ai.groundingmetadata.md
83+
- title: HybridParams
84+
path: /docs/reference/js/ai.hybridparams.md
8385
- title: ImagenGCSImage
8486
path: /docs/reference/js/ai.imagengcsimage.md
8587
- title: ImagenGenerationConfig
@@ -110,6 +112,8 @@ toc:
110112
path: /docs/reference/js/ai.objectschema.md
111113
- title: ObjectSchemaInterface
112114
path: /docs/reference/js/ai.objectschemainterface.md
115+
- title: OnDeviceParams
116+
path: /docs/reference/js/ai.ondeviceparams.md
113117
- title: PromptFeedback
114118
path: /docs/reference/js/ai.promptfeedback.md
115119
- title: RequestOptions
@@ -618,3 +622,154 @@ toc:
618622
path: /docs/reference/js/storage.uploadtask.md
619623
- title: UploadTaskSnapshot
620624
path: /docs/reference/js/storage.uploadtasksnapshot.md
625+
- title: vertexai
626+
path: /docs/reference/js/vertexai.md
627+
section:
628+
- title: AI
629+
path: /docs/reference/js/vertexai.ai.md
630+
- title: AIError
631+
path: /docs/reference/js/vertexai.aierror.md
632+
- title: AIModel
633+
path: /docs/reference/js/vertexai.aimodel.md
634+
- title: AIOptions
635+
path: /docs/reference/js/vertexai.aioptions.md
636+
- title: ArraySchema
637+
path: /docs/reference/js/vertexai.arrayschema.md
638+
- title: Backend
639+
path: /docs/reference/js/vertexai.backend.md
640+
- title: BaseParams
641+
path: /docs/reference/js/vertexai.baseparams.md
642+
- title: BooleanSchema
643+
path: /docs/reference/js/vertexai.booleanschema.md
644+
- title: ChatSession
645+
path: /docs/reference/js/vertexai.chatsession.md
646+
- title: Citation
647+
path: /docs/reference/js/vertexai.citation.md
648+
- title: CitationMetadata
649+
path: /docs/reference/js/vertexai.citationmetadata.md
650+
- title: Content
651+
path: /docs/reference/js/vertexai.content.md
652+
- title: CountTokensRequest
653+
path: /docs/reference/js/vertexai.counttokensrequest.md
654+
- title: CountTokensResponse
655+
path: /docs/reference/js/vertexai.counttokensresponse.md
656+
- title: CustomErrorData
657+
path: /docs/reference/js/vertexai.customerrordata.md
658+
- title: Date_2
659+
path: /docs/reference/js/vertexai.date_2.md
660+
- title: EnhancedGenerateContentResponse
661+
path: /docs/reference/js/vertexai.enhancedgeneratecontentresponse.md
662+
- title: ErrorDetails
663+
path: /docs/reference/js/vertexai.errordetails.md
664+
- title: FileData
665+
path: /docs/reference/js/vertexai.filedata.md
666+
- title: FileDataPart
667+
path: /docs/reference/js/vertexai.filedatapart.md
668+
- title: FunctionCall
669+
path: /docs/reference/js/vertexai.functioncall.md
670+
- title: FunctionCallingConfig
671+
path: /docs/reference/js/vertexai.functioncallingconfig.md
672+
- title: FunctionCallPart
673+
path: /docs/reference/js/vertexai.functioncallpart.md
674+
- title: FunctionDeclaration
675+
path: /docs/reference/js/vertexai.functiondeclaration.md
676+
- title: FunctionDeclarationsTool
677+
path: /docs/reference/js/vertexai.functiondeclarationstool.md
678+
- title: FunctionResponse
679+
path: /docs/reference/js/vertexai.functionresponse.md
680+
- title: FunctionResponsePart
681+
path: /docs/reference/js/vertexai.functionresponsepart.md
682+
- title: GenerateContentCandidate
683+
path: /docs/reference/js/vertexai.generatecontentcandidate.md
684+
- title: GenerateContentRequest
685+
path: /docs/reference/js/vertexai.generatecontentrequest.md
686+
- title: GenerateContentResponse
687+
path: /docs/reference/js/vertexai.generatecontentresponse.md
688+
- title: GenerateContentResult
689+
path: /docs/reference/js/vertexai.generatecontentresult.md
690+
- title: GenerateContentStreamResult
691+
path: /docs/reference/js/vertexai.generatecontentstreamresult.md
692+
- title: GenerationConfig
693+
path: /docs/reference/js/vertexai.generationconfig.md
694+
- title: GenerativeContentBlob
695+
path: /docs/reference/js/vertexai.generativecontentblob.md
696+
- title: GenerativeModel
697+
path: /docs/reference/js/vertexai.generativemodel.md
698+
- title: GoogleAIBackend
699+
path: /docs/reference/js/vertexai.googleaibackend.md
700+
- title: GroundingAttribution
701+
path: /docs/reference/js/vertexai.groundingattribution.md
702+
- title: GroundingMetadata
703+
path: /docs/reference/js/vertexai.groundingmetadata.md
704+
- title: HybridParams
705+
path: /docs/reference/js/vertexai.hybridparams.md
706+
- title: ImagenGCSImage
707+
path: /docs/reference/js/vertexai.imagengcsimage.md
708+
- title: ImagenGenerationConfig
709+
path: /docs/reference/js/vertexai.imagengenerationconfig.md
710+
- title: ImagenGenerationResponse
711+
path: /docs/reference/js/vertexai.imagengenerationresponse.md
712+
- title: ImagenImageFormat
713+
path: /docs/reference/js/vertexai.imagenimageformat.md
714+
- title: ImagenInlineImage
715+
path: /docs/reference/js/vertexai.imageninlineimage.md
716+
- title: ImagenModel
717+
path: /docs/reference/js/vertexai.imagenmodel.md
718+
- title: ImagenModelParams
719+
path: /docs/reference/js/vertexai.imagenmodelparams.md
720+
- title: ImagenSafetySettings
721+
path: /docs/reference/js/vertexai.imagensafetysettings.md
722+
- title: InlineDataPart
723+
path: /docs/reference/js/vertexai.inlinedatapart.md
724+
- title: IntegerSchema
725+
path: /docs/reference/js/vertexai.integerschema.md
726+
- title: ModalityTokenCount
727+
path: /docs/reference/js/vertexai.modalitytokencount.md
728+
- title: ModelParams
729+
path: /docs/reference/js/vertexai.modelparams.md
730+
- title: NumberSchema
731+
path: /docs/reference/js/vertexai.numberschema.md
732+
- title: ObjectSchema
733+
path: /docs/reference/js/vertexai.objectschema.md
734+
- title: ObjectSchemaInterface
735+
path: /docs/reference/js/vertexai.objectschemainterface.md
736+
- title: PromptFeedback
737+
path: /docs/reference/js/vertexai.promptfeedback.md
738+
- title: RequestOptions
739+
path: /docs/reference/js/vertexai.requestoptions.md
740+
- title: RetrievedContextAttribution
741+
path: /docs/reference/js/vertexai.retrievedcontextattribution.md
742+
- title: SafetyRating
743+
path: /docs/reference/js/vertexai.safetyrating.md
744+
- title: SafetySetting
745+
path: /docs/reference/js/vertexai.safetysetting.md
746+
- title: Schema
747+
path: /docs/reference/js/vertexai.schema.md
748+
- title: SchemaInterface
749+
path: /docs/reference/js/vertexai.schemainterface.md
750+
- title: SchemaParams
751+
path: /docs/reference/js/vertexai.schemaparams.md
752+
- title: SchemaRequest
753+
path: /docs/reference/js/vertexai.schemarequest.md
754+
- title: SchemaShared
755+
path: /docs/reference/js/vertexai.schemashared.md
756+
- title: Segment
757+
path: /docs/reference/js/vertexai.segment.md
758+
- title: StartChatParams
759+
path: /docs/reference/js/vertexai.startchatparams.md
760+
- title: StringSchema
761+
path: /docs/reference/js/vertexai.stringschema.md
762+
- title: TextPart
763+
path: /docs/reference/js/vertexai.textpart.md
764+
- title: ToolConfig
765+
path: /docs/reference/js/vertexai.toolconfig.md
766+
- title: UsageMetadata
767+
path: /docs/reference/js/vertexai.usagemetadata.md
768+
- title: VertexAIBackend
769+
path: /docs/reference/js/vertexai.vertexaibackend.md
770+
- title: VertexAIOptions
771+
path: /docs/reference/js/vertexai.vertexaioptions.md
772+
- title: VideoMetadata
773+
path: /docs/reference/js/vertexai.videometadata.md
774+
- title: WebAttribution
775+
path: /docs/reference/js/vertexai.webattribution.md

docs-devsite/ai.chatsession.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export declare class ChatSession
2222

2323
| Constructor | Modifiers | Description |
2424
| --- | --- | --- |
25-
| [(constructor)(apiSettings, model, params, requestOptions)](./ai.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the <code>ChatSession</code> class |
25+
| [(constructor)(apiSettings, model, chromeAdapter, params, requestOptions)](./ai.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the <code>ChatSession</code> class |
2626

2727
## Properties
2828

@@ -47,7 +47,7 @@ Constructs a new instance of the `ChatSession` class
4747
<b>Signature:</b>
4848

4949
```typescript
50-
constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined);
50+
constructor(apiSettings: ApiSettings, model: string, chromeAdapter: ChromeAdapter, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined);
5151
```
5252

5353
#### Parameters
@@ -56,6 +56,7 @@ constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams |
5656
| --- | --- | --- |
5757
| apiSettings | ApiSettings | |
5858
| model | string | |
59+
| chromeAdapter | ChromeAdapter | |
5960
| params | [StartChatParams](./ai.startchatparams.md#startchatparams_interface) \| undefined | |
6061
| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | |
6162

docs-devsite/ai.generativemodel.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ export declare class GenerativeModel extends AIModel
2323
2424
| Constructor | Modifiers | Description |
2525
| --- | --- | --- |
26-
| [(constructor)(ai, modelParams, requestOptions)](./ai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the <code>GenerativeModel</code> class |
26+
| [(constructor)(ai, modelParams, chromeAdapter, requestOptions)](./ai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the <code>GenerativeModel</code> class |
2727
2828
## Properties
2929
3030
| Property | Modifiers | Type | Description |
3131
| --- | --- | --- | --- |
32+
| [DEFAULT\_HYBRID\_IN\_CLOUD\_MODEL](./ai.generativemodel.md#generativemodeldefault_hybrid_in_cloud_model) | <code>static</code> | string | Defines the name of the default in-cloud model to use for hybrid inference. |
3233
| [generationConfig](./ai.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./ai.generationconfig.md#generationconfig_interface) | |
3334
| [requestOptions](./ai.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | |
3435
| [safetySettings](./ai.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./ai.safetysetting.md#safetysetting_interface)<!-- -->\[\] | |
@@ -52,7 +53,7 @@ Constructs a new instance of the `GenerativeModel` class
5253
<b>Signature:</b>
5354
5455
```typescript
55-
constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions);
56+
constructor(ai: AI, modelParams: ModelParams, chromeAdapter: ChromeAdapter, requestOptions?: RequestOptions);
5657
```
5758
5859
#### Parameters
@@ -61,8 +62,19 @@ constructor(ai: AI, modelParams: ModelParams, requestOptions?: RequestOptions);
6162
| --- | --- | --- |
6263
| ai | [AI](./ai.ai.md#ai_interface) | |
6364
| modelParams | [ModelParams](./ai.modelparams.md#modelparams_interface) | |
65+
| chromeAdapter | ChromeAdapter | |
6466
| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | |
6567
68+
## GenerativeModel.DEFAULT\_HYBRID\_IN\_CLOUD\_MODEL
69+
70+
Defines the name of the default in-cloud model to use for hybrid inference.
71+
72+
<b>Signature:</b>
73+
74+
```typescript
75+
static DEFAULT_HYBRID_IN_CLOUD_MODEL: string;
76+
```
77+
6678
## GenerativeModel.generationConfig
6779
6880
<b>Signature:</b>

docs-devsite/ai.hybridparams.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# HybridParams interface
13+
Toggles hybrid inference.
14+
15+
<b>Signature:</b>
16+
17+
```typescript
18+
export interface HybridParams
19+
```
20+
21+
## Properties
22+
23+
| Property | Type | Description |
24+
| --- | --- | --- |
25+
| [inCloudParams](./ai.hybridparams.md#hybridparamsincloudparams) | [ModelParams](./ai.modelparams.md#modelparams_interface) | Optional. Specifies advanced params for in-cloud inference. |
26+
| [mode](./ai.hybridparams.md#hybridparamsmode) | [InferenceMode](./ai.md#inferencemode) | Specifies on-device or in-cloud inference. Defaults to prefer on-device. |
27+
| [onDeviceParams](./ai.hybridparams.md#hybridparamsondeviceparams) | [OnDeviceParams](./ai.ondeviceparams.md#ondeviceparams_interface) | Optional. Specifies advanced params for on-device inference. |
28+
29+
## HybridParams.inCloudParams
30+
31+
Optional. Specifies advanced params for in-cloud inference.
32+
33+
<b>Signature:</b>
34+
35+
```typescript
36+
inCloudParams?: ModelParams;
37+
```
38+
39+
## HybridParams.mode
40+
41+
Specifies on-device or in-cloud inference. Defaults to prefer on-device.
42+
43+
<b>Signature:</b>
44+
45+
```typescript
46+
mode: InferenceMode;
47+
```
48+
49+
## HybridParams.onDeviceParams
50+
51+
Optional. Specifies advanced params for on-device inference.
52+
53+
<b>Signature:</b>
54+
55+
```typescript
56+
onDeviceParams?: OnDeviceParams;
57+
```

0 commit comments

Comments
 (0)