From abb95bf002b3e2b0489ce14a12c42fcbd331320c Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Wed, 25 Sep 2024 09:11:26 -0700 Subject: [PATCH] rename all docs from vertexai-preview to vertexai fill out Schema builder refine design Update doc comments More fixes to doc comments Fixes based on testing fix error class Allow raw json in responseSchema set SchemaShared to public fix docs revert docs remove other added docs restore toc rerun docgen redo docs rename to vertexai remove old api preview fix some merge issues Update API reports Address some PR comments Address comments --- docs-devsite/_toc.yaml | 127 +++--- docs-devsite/index.md | 2 +- docs-devsite/vertexai-preview.chatsession.md | 138 ------ ...texai-preview.functiondeclarationschema.md | 70 --- ...eview.functiondeclarationschemaproperty.md | 125 ------ ...rtexai-preview.functiondeclarationstool.md | 35 -- ...rtexai-preview.generatecontentcandidate.md | 87 ---- .../vertexai-preview.generationconfig.md | 107 ----- .../vertexai-preview.generativemodel.md | 201 --------- docs-devsite/vertexai-preview.md | 397 ----------------- docs-devsite/vertexai.arrayschema.md | 57 +++ ...w.baseparams.md => vertexai.baseparams.md} | 4 +- docs-devsite/vertexai.booleanschema.md | 43 ++ docs-devsite/vertexai.chatsession.md | 138 ++++++ ...eview.citation.md => vertexai.citation.md} | 12 +- ...tadata.md => vertexai.citationmetadata.md} | 4 +- ...preview.content.md => vertexai.content.md} | 4 +- ...uest.md => vertexai.counttokensrequest.md} | 4 +- ...nse.md => vertexai.counttokensresponse.md} | 6 +- ...rordata.md => vertexai.customerrordata.md} | 10 +- ...i-preview.date_2.md => vertexai.date_2.md} | 6 +- ...rtexai.enhancedgeneratecontentresponse.md} | 6 +- ...rordetails.md => vertexai.errordetails.md} | 8 +- ...eview.filedata.md => vertexai.filedata.md} | 4 +- ...ledatapart.md => vertexai.filedatapart.md} | 12 +- ...nctioncall.md => vertexai.functioncall.md} | 6 +- ...g.md => vertexai.functioncallingconfig.md} | 4 +- ...llpart.md => vertexai.functioncallpart.md} | 10 +- ...ion.md => vertexai.functiondeclaration.md} | 12 +- .../vertexai.functiondeclarationstool.md | 35 ++ ...sponse.md => vertexai.functionresponse.md} | 6 +- ...rt.md => vertexai.functionresponsepart.md} | 10 +- .../vertexai.generatecontentcandidate.md | 87 ++++ ....md => vertexai.generatecontentrequest.md} | 12 +- ...md => vertexai.generatecontentresponse.md} | 8 +- ...t.md => vertexai.generatecontentresult.md} | 4 +- ...> vertexai.generatecontentstreamresult.md} | 6 +- docs-devsite/vertexai.generationconfig.md | 118 +++++ ...b.md => vertexai.generativecontentblob.md} | 4 +- docs-devsite/vertexai.generativemodel.md | 201 +++++++++ ...on.md => vertexai.groundingattribution.md} | 8 +- ...adata.md => vertexai.groundingmetadata.md} | 6 +- ...datapart.md => vertexai.inlinedatapart.md} | 10 +- docs-devsite/vertexai.integerschema.md | 43 ++ docs-devsite/vertexai.md | 412 ++++++++++++++++++ ...modelparams.md => vertexai.modelparams.md} | 12 +- docs-devsite/vertexai.numberschema.md | 43 ++ docs-devsite/vertexai.objectschema.md | 71 +++ .../vertexai.objectschemainterface.md | 43 ++ ...feedback.md => vertexai.promptfeedback.md} | 8 +- ...toptions.md => vertexai.requestoptions.md} | 8 +- ...> vertexai.retrievedcontextattribution.md} | 4 +- ...fetyrating.md => vertexai.safetyrating.md} | 14 +- ...tysetting.md => vertexai.safetysetting.md} | 6 +- docs-devsite/vertexai.schema.md | 250 +++++++++++ docs-devsite/vertexai.schemainterface.md | 36 ++ docs-devsite/vertexai.schemaparams.md | 21 + docs-devsite/vertexai.schemarequest.md | 47 ++ docs-devsite/vertexai.schemashared.md | 103 +++++ ...preview.segment.md => vertexai.segment.md} | 6 +- ...tparams.md => vertexai.startchatparams.md} | 12 +- docs-devsite/vertexai.stringschema.md | 57 +++ ...eview.textpart.md => vertexai.textpart.md} | 8 +- ...w.toolconfig.md => vertexai.toolconfig.md} | 4 +- ...emetadata.md => vertexai.usagemetadata.md} | 8 +- ...eview.vertexai.md => vertexai.vertexai.md} | 6 +- ...exaierror.md => vertexai.vertexaierror.md} | 19 +- ...options.md => vertexai.vertexaioptions.md} | 2 +- ...ometadata.md => vertexai.videometadata.md} | 4 +- ...ribution.md => vertexai.webattribution.md} | 4 +- packages/vertexai/src/api.ts | 4 +- packages/vertexai/src/errors.ts | 2 +- packages/vertexai/src/methods/chat-session.ts | 4 +- .../vertexai/src/models/generative-model.ts | 4 +- packages/vertexai/src/public-types.ts | 2 +- .../vertexai/src/requests/response-helpers.ts | 2 +- .../vertexai/src/requests/schema-builder.ts | 2 +- packages/vertexai/src/types/content.ts | 12 +- packages/vertexai/src/types/error.ts | 4 +- packages/vertexai/src/types/requests.ts | 19 +- packages/vertexai/src/types/responses.ts | 8 +- packages/vertexai/src/types/schema.ts | 14 +- yarn.lock | 2 +- 83 files changed, 2070 insertions(+), 1414 deletions(-) delete mode 100644 docs-devsite/vertexai-preview.chatsession.md delete mode 100644 docs-devsite/vertexai-preview.functiondeclarationschema.md delete mode 100644 docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md delete mode 100644 docs-devsite/vertexai-preview.functiondeclarationstool.md delete mode 100644 docs-devsite/vertexai-preview.generatecontentcandidate.md delete mode 100644 docs-devsite/vertexai-preview.generationconfig.md delete mode 100644 docs-devsite/vertexai-preview.generativemodel.md delete mode 100644 docs-devsite/vertexai-preview.md create mode 100644 docs-devsite/vertexai.arrayschema.md rename docs-devsite/{vertexai-preview.baseparams.md => vertexai.baseparams.md} (67%) create mode 100644 docs-devsite/vertexai.booleanschema.md create mode 100644 docs-devsite/vertexai.chatsession.md rename docs-devsite/{vertexai-preview.citation.md => vertexai.citation.md} (68%) rename docs-devsite/{vertexai-preview.citationmetadata.md => vertexai.citationmetadata.md} (64%) rename docs-devsite/{vertexai-preview.content.md => vertexai.content.md} (76%) rename docs-devsite/{vertexai-preview.counttokensrequest.md => vertexai.counttokensrequest.md} (68%) rename docs-devsite/{vertexai-preview.counttokensresponse.md => vertexai.counttokensresponse.md} (67%) rename docs-devsite/{vertexai-preview.customerrordata.md => vertexai.customerrordata.md} (54%) rename docs-devsite/{vertexai-preview.date_2.md => vertexai.date_2.md} (78%) rename docs-devsite/{vertexai-preview.enhancedgeneratecontentresponse.md => vertexai.enhancedgeneratecontentresponse.md} (61%) rename docs-devsite/{vertexai-preview.errordetails.md => vertexai.errordetails.md} (68%) rename docs-devsite/{vertexai-preview.filedata.md => vertexai.filedata.md} (81%) rename docs-devsite/{vertexai-preview.filedatapart.md => vertexai.filedatapart.md} (60%) rename docs-devsite/{vertexai-preview.functioncall.md => vertexai.functioncall.md} (57%) rename docs-devsite/{vertexai-preview.functioncallingconfig.md => vertexai.functioncallingconfig.md} (71%) rename docs-devsite/{vertexai-preview.functioncallpart.md => vertexai.functioncallpart.md} (59%) rename docs-devsite/{vertexai-preview.functiondeclaration.md => vertexai.functiondeclaration.md} (57%) create mode 100644 docs-devsite/vertexai.functiondeclarationstool.md rename docs-devsite/{vertexai-preview.functionresponse.md => vertexai.functionresponse.md} (50%) rename docs-devsite/{vertexai-preview.functionresponsepart.md => vertexai.functionresponsepart.md} (58%) create mode 100644 docs-devsite/vertexai.generatecontentcandidate.md rename docs-devsite/{vertexai-preview.generatecontentrequest.md => vertexai.generatecontentrequest.md} (54%) rename docs-devsite/{vertexai-preview.generatecontentresponse.md => vertexai.generatecontentresponse.md} (50%) rename docs-devsite/{vertexai-preview.generatecontentresult.md => vertexai.generatecontentresult.md} (69%) rename docs-devsite/{vertexai-preview.generatecontentstreamresult.md => vertexai.generatecontentstreamresult.md} (52%) create mode 100644 docs-devsite/vertexai.generationconfig.md rename docs-devsite/{vertexai-preview.generativecontentblob.md => vertexai.generativecontentblob.md} (76%) create mode 100644 docs-devsite/vertexai.generativemodel.md rename docs-devsite/{vertexai-preview.groundingattribution.md => vertexai.groundingattribution.md} (58%) rename docs-devsite/{vertexai-preview.groundingmetadata.md => vertexai.groundingmetadata.md} (66%) rename docs-devsite/{vertexai-preview.inlinedatapart.md => vertexai.inlinedatapart.md} (60%) create mode 100644 docs-devsite/vertexai.integerschema.md create mode 100644 docs-devsite/vertexai.md rename docs-devsite/{vertexai-preview.modelparams.md => vertexai.modelparams.md} (54%) create mode 100644 docs-devsite/vertexai.numberschema.md create mode 100644 docs-devsite/vertexai.objectschema.md create mode 100644 docs-devsite/vertexai.objectschemainterface.md rename docs-devsite/{vertexai-preview.promptfeedback.md => vertexai.promptfeedback.md} (66%) rename docs-devsite/{vertexai-preview.requestoptions.md => vertexai.requestoptions.md} (61%) rename docs-devsite/{vertexai-preview.retrievedcontextattribution.md => vertexai.retrievedcontextattribution.md} (76%) rename docs-devsite/{vertexai-preview.safetyrating.md => vertexai.safetyrating.md} (55%) rename docs-devsite/{vertexai-preview.safetysetting.md => vertexai.safetysetting.md} (66%) create mode 100644 docs-devsite/vertexai.schema.md create mode 100644 docs-devsite/vertexai.schemainterface.md create mode 100644 docs-devsite/vertexai.schemaparams.md create mode 100644 docs-devsite/vertexai.schemarequest.md create mode 100644 docs-devsite/vertexai.schemashared.md rename docs-devsite/{vertexai-preview.segment.md => vertexai.segment.md} (75%) rename docs-devsite/{vertexai-preview.startchatparams.md => vertexai.startchatparams.md} (51%) create mode 100644 docs-devsite/vertexai.stringschema.md rename docs-devsite/{vertexai-preview.textpart.md => vertexai.textpart.md} (72%) rename docs-devsite/{vertexai-preview.toolconfig.md => vertexai.toolconfig.md} (71%) rename docs-devsite/{vertexai-preview.usagemetadata.md => vertexai.usagemetadata.md} (63%) rename docs-devsite/{vertexai-preview.vertexai.md => vertexai.vertexai.md} (62%) rename docs-devsite/{vertexai-preview.vertexaierror.md => vertexai.vertexaierror.md} (57%) rename docs-devsite/{vertexai-preview.vertexaioptions.md => vertexai.vertexaioptions.md} (87%) rename docs-devsite/{vertexai-preview.videometadata.md => vertexai.videometadata.md} (66%) rename docs-devsite/{vertexai-preview.webattribution.md => vertexai.webattribution.md} (79%) diff --git a/docs-devsite/_toc.yaml b/docs-devsite/_toc.yaml index 3a04923f8de..a27f2832eb7 100644 --- a/docs-devsite/_toc.yaml +++ b/docs-devsite/_toc.yaml @@ -455,105 +455,124 @@ toc: path: /docs/reference/js/storage.uploadtask.md - title: UploadTaskSnapshot path: /docs/reference/js/storage.uploadtasksnapshot.md - - title: vertexai-preview - path: /docs/reference/js/vertexai-preview.md + - title: vertexai + path: /docs/reference/js/vertexai.md section: + - title: ArraySchema + path: /docs/reference/js/vertexai.arrayschema.md - title: BaseParams - path: /docs/reference/js/vertexai-preview.baseparams.md + path: /docs/reference/js/vertexai.baseparams.md + - title: BooleanSchema + path: /docs/reference/js/vertexai.booleanschema.md - title: ChatSession - path: /docs/reference/js/vertexai-preview.chatsession.md + path: /docs/reference/js/vertexai.chatsession.md - title: Citation - path: /docs/reference/js/vertexai-preview.citation.md + path: /docs/reference/js/vertexai.citation.md - title: CitationMetadata - path: /docs/reference/js/vertexai-preview.citationmetadata.md + path: /docs/reference/js/vertexai.citationmetadata.md - title: Content - path: /docs/reference/js/vertexai-preview.content.md + path: /docs/reference/js/vertexai.content.md - title: CountTokensRequest - path: /docs/reference/js/vertexai-preview.counttokensrequest.md + path: /docs/reference/js/vertexai.counttokensrequest.md - title: CountTokensResponse - path: /docs/reference/js/vertexai-preview.counttokensresponse.md + path: /docs/reference/js/vertexai.counttokensresponse.md - title: CustomErrorData - path: /docs/reference/js/vertexai-preview.customerrordata.md + path: /docs/reference/js/vertexai.customerrordata.md - title: Date_2 - path: /docs/reference/js/vertexai-preview.date_2.md + path: /docs/reference/js/vertexai.date_2.md - title: EnhancedGenerateContentResponse - path: /docs/reference/js/vertexai-preview.enhancedgeneratecontentresponse.md + path: /docs/reference/js/vertexai.enhancedgeneratecontentresponse.md - title: ErrorDetails - path: /docs/reference/js/vertexai-preview.errordetails.md + path: /docs/reference/js/vertexai.errordetails.md - title: FileData - path: /docs/reference/js/vertexai-preview.filedata.md + path: /docs/reference/js/vertexai.filedata.md - title: FileDataPart - path: /docs/reference/js/vertexai-preview.filedatapart.md + path: /docs/reference/js/vertexai.filedatapart.md - title: FunctionCall - path: /docs/reference/js/vertexai-preview.functioncall.md + path: /docs/reference/js/vertexai.functioncall.md - title: FunctionCallingConfig - path: /docs/reference/js/vertexai-preview.functioncallingconfig.md + path: /docs/reference/js/vertexai.functioncallingconfig.md - title: FunctionCallPart - path: /docs/reference/js/vertexai-preview.functioncallpart.md + path: /docs/reference/js/vertexai.functioncallpart.md - title: FunctionDeclaration - path: /docs/reference/js/vertexai-preview.functiondeclaration.md - - title: FunctionDeclarationSchema - path: /docs/reference/js/vertexai-preview.functiondeclarationschema.md - - title: FunctionDeclarationSchemaProperty - path: >- - /docs/reference/js/vertexai-preview.functiondeclarationschemaproperty.md + path: /docs/reference/js/vertexai.functiondeclaration.md - title: FunctionDeclarationsTool - path: /docs/reference/js/vertexai-preview.functiondeclarationstool.md + path: /docs/reference/js/vertexai.functiondeclarationstool.md - title: FunctionResponse - path: /docs/reference/js/vertexai-preview.functionresponse.md + path: /docs/reference/js/vertexai.functionresponse.md - title: FunctionResponsePart - path: /docs/reference/js/vertexai-preview.functionresponsepart.md + path: /docs/reference/js/vertexai.functionresponsepart.md - title: GenerateContentCandidate - path: /docs/reference/js/vertexai-preview.generatecontentcandidate.md + path: /docs/reference/js/vertexai.generatecontentcandidate.md - title: GenerateContentRequest - path: /docs/reference/js/vertexai-preview.generatecontentrequest.md + path: /docs/reference/js/vertexai.generatecontentrequest.md - title: GenerateContentResponse - path: /docs/reference/js/vertexai-preview.generatecontentresponse.md + path: /docs/reference/js/vertexai.generatecontentresponse.md - title: GenerateContentResult - path: /docs/reference/js/vertexai-preview.generatecontentresult.md + path: /docs/reference/js/vertexai.generatecontentresult.md - title: GenerateContentStreamResult - path: /docs/reference/js/vertexai-preview.generatecontentstreamresult.md + path: /docs/reference/js/vertexai.generatecontentstreamresult.md - title: GenerationConfig - path: /docs/reference/js/vertexai-preview.generationconfig.md + path: /docs/reference/js/vertexai.generationconfig.md - title: GenerativeContentBlob - path: /docs/reference/js/vertexai-preview.generativecontentblob.md + path: /docs/reference/js/vertexai.generativecontentblob.md - title: GenerativeModel - path: /docs/reference/js/vertexai-preview.generativemodel.md + path: /docs/reference/js/vertexai.generativemodel.md - title: GroundingAttribution - path: /docs/reference/js/vertexai-preview.groundingattribution.md + path: /docs/reference/js/vertexai.groundingattribution.md - title: GroundingMetadata - path: /docs/reference/js/vertexai-preview.groundingmetadata.md + path: /docs/reference/js/vertexai.groundingmetadata.md - title: InlineDataPart - path: /docs/reference/js/vertexai-preview.inlinedatapart.md + path: /docs/reference/js/vertexai.inlinedatapart.md + - title: IntegerSchema + path: /docs/reference/js/vertexai.integerschema.md - title: ModelParams - path: /docs/reference/js/vertexai-preview.modelparams.md + path: /docs/reference/js/vertexai.modelparams.md + - title: NumberSchema + path: /docs/reference/js/vertexai.numberschema.md + - title: ObjectSchema + path: /docs/reference/js/vertexai.objectschema.md + - title: ObjectSchemaInterface + path: /docs/reference/js/vertexai.objectschemainterface.md - title: PromptFeedback - path: /docs/reference/js/vertexai-preview.promptfeedback.md + path: /docs/reference/js/vertexai.promptfeedback.md - title: RequestOptions - path: /docs/reference/js/vertexai-preview.requestoptions.md + path: /docs/reference/js/vertexai.requestoptions.md - title: RetrievedContextAttribution - path: /docs/reference/js/vertexai-preview.retrievedcontextattribution.md + path: /docs/reference/js/vertexai.retrievedcontextattribution.md - title: SafetyRating - path: /docs/reference/js/vertexai-preview.safetyrating.md + path: /docs/reference/js/vertexai.safetyrating.md - title: SafetySetting - path: /docs/reference/js/vertexai-preview.safetysetting.md + path: /docs/reference/js/vertexai.safetysetting.md + - title: Schema + path: /docs/reference/js/vertexai.schema.md + - title: SchemaInterface + path: /docs/reference/js/vertexai.schemainterface.md + - title: SchemaParams + path: /docs/reference/js/vertexai.schemaparams.md + - title: SchemaRequest + path: /docs/reference/js/vertexai.schemarequest.md + - title: SchemaShared + path: /docs/reference/js/vertexai.schemashared.md - title: Segment - path: /docs/reference/js/vertexai-preview.segment.md + path: /docs/reference/js/vertexai.segment.md - title: StartChatParams - path: /docs/reference/js/vertexai-preview.startchatparams.md + path: /docs/reference/js/vertexai.startchatparams.md + - title: StringSchema + path: /docs/reference/js/vertexai.stringschema.md - title: TextPart - path: /docs/reference/js/vertexai-preview.textpart.md + path: /docs/reference/js/vertexai.textpart.md - title: ToolConfig - path: /docs/reference/js/vertexai-preview.toolconfig.md + path: /docs/reference/js/vertexai.toolconfig.md - title: UsageMetadata - path: /docs/reference/js/vertexai-preview.usagemetadata.md + path: /docs/reference/js/vertexai.usagemetadata.md - title: VertexAI - path: /docs/reference/js/vertexai-preview.vertexai.md + path: /docs/reference/js/vertexai.vertexai.md - title: VertexAIError - path: /docs/reference/js/vertexai-preview.vertexaierror.md + path: /docs/reference/js/vertexai.vertexaierror.md - title: VertexAIOptions - path: /docs/reference/js/vertexai-preview.vertexaioptions.md + path: /docs/reference/js/vertexai.vertexaioptions.md - title: VideoMetadata - path: /docs/reference/js/vertexai-preview.videometadata.md + path: /docs/reference/js/vertexai.videometadata.md - title: WebAttribution - path: /docs/reference/js/vertexai-preview.webattribution.md + path: /docs/reference/js/vertexai.webattribution.md diff --git a/docs-devsite/index.md b/docs-devsite/index.md index 0064652e792..82fdb36f076 100644 --- a/docs-devsite/index.md +++ b/docs-devsite/index.md @@ -27,5 +27,5 @@ https://github.com/firebase/firebase-js-sdk | [@firebase/performance](./performance.md#performance_package) | The Firebase Performance Monitoring Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/remote-config](./remote-config.md#remote-config_package) | The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environment. | | [@firebase/storage](./storage.md#storage_package) | Cloud Storage for Firebase | -| [@firebase/vertexai-preview](./vertexai-preview.md#vertexai-preview_package) | The Vertex AI in Firebase Web SDK. | +| [@firebase/vertexai](./vertexai.md#vertexai_package) | The Vertex AI in Firebase Web SDK. | diff --git a/docs-devsite/vertexai-preview.chatsession.md b/docs-devsite/vertexai-preview.chatsession.md deleted file mode 100644 index d8dc691d186..00000000000 --- a/docs-devsite/vertexai-preview.chatsession.md +++ /dev/null @@ -1,138 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# ChatSession class -ChatSession class that enables sending chat messages and stores history of sent and received messages so far. - -Signature: - -```typescript -export declare class ChatSession -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(apiSettings, model, params, requestOptions)](./vertexai-preview.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [model](./vertexai-preview.chatsession.md#chatsessionmodel) | | string | | -| [params](./vertexai-preview.chatsession.md#chatsessionparams) | | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) \| undefined | | -| [requestOptions](./vertexai-preview.chatsession.md#chatsessionrequestoptions) | | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) \| undefined | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [getHistory()](./vertexai-preview.chatsession.md#chatsessiongethistory) | | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. | -| [sendMessage(request)](./vertexai-preview.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) | -| [sendMessageStream(request)](./vertexai-preview.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | - -## ChatSession.(constructor) - -Constructs a new instance of the `ChatSession` class - -Signature: - -```typescript -constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| apiSettings | ApiSettings | | -| model | string | | -| params | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) \| undefined | | -| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) \| undefined | | - -## ChatSession.model - -Signature: - -```typescript -model: string; -``` - -## ChatSession.params - -Signature: - -```typescript -params?: StartChatParams | undefined; -``` - -## ChatSession.requestOptions - -Signature: - -```typescript -requestOptions?: RequestOptions | undefined; -``` - -## ChatSession.getHistory() - -Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. - -Signature: - -```typescript -getHistory(): Promise; -``` -Returns: - -Promise<[Content](./vertexai-preview.content.md#content_interface)\[\]> - -## ChatSession.sendMessage() - -Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) - -Signature: - -```typescript -sendMessage(request: string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface)> - -## ChatSession.sendMessageStream() - -Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. - -Signature: - -```typescript -sendMessageStream(request: string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface)> - diff --git a/docs-devsite/vertexai-preview.functiondeclarationschema.md b/docs-devsite/vertexai-preview.functiondeclarationschema.md deleted file mode 100644 index 7d0e5809d41..00000000000 --- a/docs-devsite/vertexai-preview.functiondeclarationschema.md +++ /dev/null @@ -1,70 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FunctionDeclarationSchema interface -Schema for parameters passed to [FunctionDeclaration.parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters). - -Signature: - -```typescript -export interface FunctionDeclarationSchema -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [description](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemadescription) | string | Optional. Description of the parameter. | -| [properties](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemaproperties) | { \[k: string\]: [FunctionDeclarationSchemaProperty](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemaproperty_interface); } | The format of the parameter. | -| [required](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschemarequired) | string\[\] | Optional. Array of required parameters. | -| [type](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschematype) | [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | The type of the parameter. | - -## FunctionDeclarationSchema.description - -Optional. Description of the parameter. - -Signature: - -```typescript -description?: string; -``` - -## FunctionDeclarationSchema.properties - -The format of the parameter. - -Signature: - -```typescript -properties: { - [k: string]: FunctionDeclarationSchemaProperty; - }; -``` - -## FunctionDeclarationSchema.required - -Optional. Array of required parameters. - -Signature: - -```typescript -required?: string[]; -``` - -## FunctionDeclarationSchema.type - -The type of the parameter. - -Signature: - -```typescript -type: FunctionDeclarationSchemaType; -``` diff --git a/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md b/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md deleted file mode 100644 index ac2e1262dd0..00000000000 --- a/docs-devsite/vertexai-preview.functiondeclarationschemaproperty.md +++ /dev/null @@ -1,125 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FunctionDeclarationSchemaProperty interface -Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed. - -Signature: - -```typescript -export interface FunctionDeclarationSchemaProperty -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [description](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertydescription) | string | Optional. The description of the property. | -| [enum](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyenum) | string\[\] | Optional. The enum of the property. | -| [example](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyexample) | unknown | Optional. The example of the property. | -| [format](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyformat) | string | Optional. The format of the property. | -| [items](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyitems) | [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Optional. The items of the property. [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | -| [nullable](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertynullable) | boolean | Optional. Whether the property is nullable. | -| [properties](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyproperties) | { \[k: string\]: [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface); } | Optional. Map of [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface). | -| [required](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertyrequired) | string\[\] | Optional. Array of required property. | -| [type](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemapropertytype) | [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | Optional. The type of the property. [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype). | - -## FunctionDeclarationSchemaProperty.description - -Optional. The description of the property. - -Signature: - -```typescript -description?: string; -``` - -## FunctionDeclarationSchemaProperty.enum - -Optional. The enum of the property. - -Signature: - -```typescript -enum?: string[]; -``` - -## FunctionDeclarationSchemaProperty.example - -Optional. The example of the property. - -Signature: - -```typescript -example?: unknown; -``` - -## FunctionDeclarationSchemaProperty.format - -Optional. The format of the property. - -Signature: - -```typescript -format?: string; -``` - -## FunctionDeclarationSchemaProperty.items - -Optional. The items of the property. [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) - -Signature: - -```typescript -items?: FunctionDeclarationSchema; -``` - -## FunctionDeclarationSchemaProperty.nullable - -Optional. Whether the property is nullable. - -Signature: - -```typescript -nullable?: boolean; -``` - -## FunctionDeclarationSchemaProperty.properties - -Optional. Map of [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface). - -Signature: - -```typescript -properties?: { - [k: string]: FunctionDeclarationSchema; - }; -``` - -## FunctionDeclarationSchemaProperty.required - -Optional. Array of required property. - -Signature: - -```typescript -required?: string[]; -``` - -## FunctionDeclarationSchemaProperty.type - -Optional. The type of the property. [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype). - -Signature: - -```typescript -type?: FunctionDeclarationSchemaType; -``` diff --git a/docs-devsite/vertexai-preview.functiondeclarationstool.md b/docs-devsite/vertexai-preview.functiondeclarationstool.md deleted file mode 100644 index d1af4351a23..00000000000 --- a/docs-devsite/vertexai-preview.functiondeclarationstool.md +++ /dev/null @@ -1,35 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# FunctionDeclarationsTool interface -A `FunctionDeclarationsTool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. - -Signature: - -```typescript -export declare interface FunctionDeclarationsTool -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [functionDeclarations](./vertexai-preview.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./vertexai-preview.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | - -## FunctionDeclarationsTool.functionDeclarations - -Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. - -Signature: - -```typescript -functionDeclarations?: FunctionDeclaration[]; -``` diff --git a/docs-devsite/vertexai-preview.generatecontentcandidate.md b/docs-devsite/vertexai-preview.generatecontentcandidate.md deleted file mode 100644 index 9f36fab1e87..00000000000 --- a/docs-devsite/vertexai-preview.generatecontentcandidate.md +++ /dev/null @@ -1,87 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerateContentCandidate interface -A candidate returned as part of a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). - -Signature: - -```typescript -export interface GenerateContentCandidate -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [citationMetadata](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatecitationmetadata) | [CitationMetadata](./vertexai-preview.citationmetadata.md#citationmetadata_interface) | | -| [content](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatecontent) | [Content](./vertexai-preview.content.md#content_interface) | | -| [finishMessage](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatefinishmessage) | string | | -| [finishReason](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatefinishreason) | [FinishReason](./vertexai-preview.md#finishreason) | | -| [groundingMetadata](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./vertexai-preview.groundingmetadata.md#groundingmetadata_interface) | | -| [index](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidateindex) | number | | -| [safetyRatings](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface)\[\] | | - -## GenerateContentCandidate.citationMetadata - -Signature: - -```typescript -citationMetadata?: CitationMetadata; -``` - -## GenerateContentCandidate.content - -Signature: - -```typescript -content: Content; -``` - -## GenerateContentCandidate.finishMessage - -Signature: - -```typescript -finishMessage?: string; -``` - -## GenerateContentCandidate.finishReason - -Signature: - -```typescript -finishReason?: FinishReason; -``` - -## GenerateContentCandidate.groundingMetadata - -Signature: - -```typescript -groundingMetadata?: GroundingMetadata; -``` - -## GenerateContentCandidate.index - -Signature: - -```typescript -index: number; -``` - -## GenerateContentCandidate.safetyRatings - -Signature: - -```typescript -safetyRatings?: SafetyRating[]; -``` diff --git a/docs-devsite/vertexai-preview.generationconfig.md b/docs-devsite/vertexai-preview.generationconfig.md deleted file mode 100644 index b14dfea053b..00000000000 --- a/docs-devsite/vertexai-preview.generationconfig.md +++ /dev/null @@ -1,107 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerationConfig interface -Config options for content-related requests - -Signature: - -```typescript -export interface GenerationConfig -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [candidateCount](./vertexai-preview.generationconfig.md#generationconfigcandidatecount) | number | | -| [frequencyPenalty](./vertexai-preview.generationconfig.md#generationconfigfrequencypenalty) | number | | -| [maxOutputTokens](./vertexai-preview.generationconfig.md#generationconfigmaxoutputtokens) | number | | -| [presencePenalty](./vertexai-preview.generationconfig.md#generationconfigpresencepenalty) | number | | -| [responseMimeType](./vertexai-preview.generationconfig.md#generationconfigresponsemimetype) | string | Output response mimetype of the generated candidate text. Supported mimetypes are text/plain (default, text output) and application/json (JSON response in the candidates). The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. | -| [stopSequences](./vertexai-preview.generationconfig.md#generationconfigstopsequences) | string\[\] | | -| [temperature](./vertexai-preview.generationconfig.md#generationconfigtemperature) | number | | -| [topK](./vertexai-preview.generationconfig.md#generationconfigtopk) | number | | -| [topP](./vertexai-preview.generationconfig.md#generationconfigtopp) | number | | - -## GenerationConfig.candidateCount - -Signature: - -```typescript -candidateCount?: number; -``` - -## GenerationConfig.frequencyPenalty - -Signature: - -```typescript -frequencyPenalty?: number; -``` - -## GenerationConfig.maxOutputTokens - -Signature: - -```typescript -maxOutputTokens?: number; -``` - -## GenerationConfig.presencePenalty - -Signature: - -```typescript -presencePenalty?: number; -``` - -## GenerationConfig.responseMimeType - -Output response mimetype of the generated candidate text. Supported mimetypes are `text/plain` (default, text output) and `application/json` (JSON response in the candidates). The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. - -Signature: - -```typescript -responseMimeType?: string; -``` - -## GenerationConfig.stopSequences - -Signature: - -```typescript -stopSequences?: string[]; -``` - -## GenerationConfig.temperature - -Signature: - -```typescript -temperature?: number; -``` - -## GenerationConfig.topK - -Signature: - -```typescript -topK?: number; -``` - -## GenerationConfig.topP - -Signature: - -```typescript -topP?: number; -``` diff --git a/docs-devsite/vertexai-preview.generativemodel.md b/docs-devsite/vertexai-preview.generativemodel.md deleted file mode 100644 index a50fac631cc..00000000000 --- a/docs-devsite/vertexai-preview.generativemodel.md +++ /dev/null @@ -1,201 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# GenerativeModel class -Class for generative model APIs. - -Signature: - -```typescript -export declare class GenerativeModel -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai-preview.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [generationConfig](./vertexai-preview.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | | -| [model](./vertexai-preview.generativemodel.md#generativemodelmodel) | | string | | -| [requestOptions](./vertexai-preview.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | -| [safetySettings](./vertexai-preview.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface)\[\] | | -| [systemInstruction](./vertexai-preview.generativemodel.md#generativemodelsysteminstruction) | | [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.generativemodel.md#generativemodeltoolconfig) | | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.generativemodel.md#generativemodeltools) | | [Tool](./vertexai-preview.md#tool)\[\] | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [countTokens(request)](./vertexai-preview.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. | -| [generateContent(request)](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | -| [generateContentStream(request)](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. | -| [startChat(startChatParams)](./vertexai-preview.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | - -## GenerativeModel.(constructor) - -Constructs a new instance of the `GenerativeModel` class - -Signature: - -```typescript -constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vertexAI | [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | | -| modelParams | [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | | -| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | - -## GenerativeModel.generationConfig - -Signature: - -```typescript -generationConfig: GenerationConfig; -``` - -## GenerativeModel.model - -Signature: - -```typescript -model: string; -``` - -## GenerativeModel.requestOptions - -Signature: - -```typescript -requestOptions?: RequestOptions; -``` - -## GenerativeModel.safetySettings - -Signature: - -```typescript -safetySettings: SafetySetting[]; -``` - -## GenerativeModel.systemInstruction - -Signature: - -```typescript -systemInstruction?: Content; -``` - -## GenerativeModel.toolConfig - -Signature: - -```typescript -toolConfig?: ToolConfig; -``` - -## GenerativeModel.tools - -Signature: - -```typescript -tools?: Tool[]; -``` - -## GenerativeModel.countTokens() - -Counts the tokens in the provided request. - -Signature: - -```typescript -countTokens(request: CountTokensRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [CountTokensRequest](./vertexai-preview.counttokensrequest.md#counttokensrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[CountTokensResponse](./vertexai-preview.counttokensresponse.md#counttokensresponse_interface)> - -## GenerativeModel.generateContent() - -Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). - -Signature: - -```typescript -generateContent(request: GenerateContentRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface)> - -## GenerativeModel.generateContentStream() - -Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. - -Signature: - -```typescript -generateContentStream(request: GenerateContentRequest | string | Array): Promise; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| request | [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai-preview.md#part)> | | - -Returns: - -Promise<[GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface)> - -## GenerativeModel.startChat() - -Gets a new [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. - -Signature: - -```typescript -startChat(startChatParams?: StartChatParams): ChatSession; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| startChatParams | [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) | | - -Returns: - -[ChatSession](./vertexai-preview.chatsession.md#chatsession_class) - diff --git a/docs-devsite/vertexai-preview.md b/docs-devsite/vertexai-preview.md deleted file mode 100644 index 27829c8ad2e..00000000000 --- a/docs-devsite/vertexai-preview.md +++ /dev/null @@ -1,397 +0,0 @@ -Project: /docs/reference/js/_project.yaml -Book: /docs/reference/_book.yaml -page_type: reference - -{% comment %} -DO NOT EDIT THIS FILE! -This is generated by the JS SDK team, and any local changes will be -overwritten. Changes should be made in the source code at -https://github.com/firebase/firebase-js-sdk -{% endcomment %} - -# vertexai-preview package -The Vertex AI in Firebase Web SDK. - -## Functions - -| Function | Description | -| --- | --- | -| function(app, ...) | -| [getVertexAI(app, options)](./vertexai-preview.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance for the given app. | -| function(vertexAI, ...) | -| [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai-preview.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | - -## Classes - -| Class | Description | -| --- | --- | -| [ChatSession](./vertexai-preview.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | -| [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) | Class for generative model APIs. | -| [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) | Error class for the Vertex AI in Firebase SDK. | - -## Enumerations - -| Enumeration | Description | -| --- | --- | -| [BlockReason](./vertexai-preview.md#blockreason) | Reason that a prompt was blocked. | -| [FinishReason](./vertexai-preview.md#finishreason) | Reason that a candidate finished. | -| [FunctionCallingMode](./vertexai-preview.md#functioncallingmode) | | -| [FunctionDeclarationSchemaType](./vertexai-preview.md#functiondeclarationschematype) | Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ | -| [HarmBlockMethod](./vertexai-preview.md#harmblockmethod) | | -| [HarmBlockThreshold](./vertexai-preview.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | -| [HarmCategory](./vertexai-preview.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | -| [HarmProbability](./vertexai-preview.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | -| [HarmSeverity](./vertexai-preview.md#harmseverity) | Harm severity levels. | -| [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) can have. | - -## Interfaces - -| Interface | Description | -| --- | --- | -| [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | -| [Citation](./vertexai-preview.citation.md#citation_interface) | A single citation. | -| [CitationMetadata](./vertexai-preview.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface). | -| [Content](./vertexai-preview.content.md#content_interface) | Content type for both prompts and response candidates. | -| [CountTokensRequest](./vertexai-preview.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens) | -| [CountTokensResponse](./vertexai-preview.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens). | -| [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) | Details object that contains data originating from a bad HTTP response. | -| [Date\_2](./vertexai-preview.date_2.md#date_2_interface) | Protobuf google.type.Date | -| [EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | -| [ErrorDetails](./vertexai-preview.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | -| [FileData](./vertexai-preview.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | -| [FileDataPart](./vertexai-preview.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./vertexai-preview.filedata.md#filedata_interface) | -| [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | -| [FunctionCallingConfig](./vertexai-preview.functioncallingconfig.md#functioncallingconfig_interface) | | -| [FunctionCallPart](./vertexai-preview.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface). | -| [FunctionDeclaration](./vertexai-preview.functiondeclaration.md#functiondeclaration_interface) | Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client. | -| [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Schema for parameters passed to [FunctionDeclaration.parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters). | -| [FunctionDeclarationSchemaProperty](./vertexai-preview.functiondeclarationschemaproperty.md#functiondeclarationschemaproperty_interface) | Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed. | -| [FunctionDeclarationsTool](./vertexai-preview.functiondeclarationstool.md#functiondeclarationstool_interface) | A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. | -| [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) made based on model prediction. | -| [FunctionResponsePart](./vertexai-preview.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface). | -| [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | -| [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) | Request sent through [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) | -| [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) | Individual response from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream). generateContentStream() will return one in each chunk until the stream is done. | -| [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface) | Result object returned from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) call. | -| [GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. | -| [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | Config options for content-related requests | -| [GenerativeContentBlob](./vertexai-preview.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | -| [GroundingAttribution](./vertexai-preview.groundingattribution.md#groundingattribution_interface) | | -| [GroundingMetadata](./vertexai-preview.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | -| [InlineDataPart](./vertexai-preview.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | -| [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). | -| [PromptFeedback](./vertexai-preview.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | -| [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). | -| [RetrievedContextAttribution](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) | -| [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | -| [Segment](./vertexai-preview.segment.md#segment_interface) | | -| [StartChatParams](./vertexai-preview.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./vertexai-preview.generativemodel.md#generativemodelstartchat). | -| [TextPart](./vertexai-preview.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | -| [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | -| [UsageMetadata](./vertexai-preview.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). | -| [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | -| [VertexAIOptions](./vertexai-preview.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Vertex AI in Firebase SDK. | -| [VideoMetadata](./vertexai-preview.videometadata.md#videometadata_interface) | Describes the input video content. | -| [WebAttribution](./vertexai-preview.webattribution.md#webattribution_interface) | | - -## Variables - -| Variable | Description | -| --- | --- | -| [POSSIBLE\_ROLES](./vertexai-preview.md#possible_roles) | Possible roles. | - -## Type Aliases - -| Type Alias | Description | -| --- | --- | -| [Part](./vertexai-preview.md#part) | Content part - includes text, image/video, or function call/response part types. | -| [Role](./vertexai-preview.md#role) | Role is the producer of the content. | -| [Tool](./vertexai-preview.md#tool) | Defines a tool that model can call to access external knowledge. | - -## function(app, ...) - -### getVertexAI(app, options) {:#getvertexai_04094cf} - -Returns a [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance for the given app. - -Signature: - -```typescript -export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | -| options | [VertexAIOptions](./vertexai-preview.vertexaioptions.md#vertexaioptions_interface) | | - -Returns: - -[VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) - -## function(vertexAI, ...) - -### getGenerativeModel(vertexAI, modelParams, requestOptions) {:#getgenerativemodel_e3037c9} - -Returns a [GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. - -Signature: - -```typescript -export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; -``` - -#### Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| vertexAI | [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) | | -| modelParams | [ModelParams](./vertexai-preview.modelparams.md#modelparams_interface) | | -| requestOptions | [RequestOptions](./vertexai-preview.requestoptions.md#requestoptions_interface) | | - -Returns: - -[GenerativeModel](./vertexai-preview.generativemodel.md#generativemodel_class) - -## POSSIBLE\_ROLES - -Possible roles. - -Signature: - -```typescript -POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] -``` - -## Part - -Content part - includes text, image/video, or function call/response part types. - -Signature: - -```typescript -export declare type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; -``` - -## Role - -Role is the producer of the content. - -Signature: - -```typescript -export declare type Role = (typeof POSSIBLE_ROLES)[number]; -``` - -## Tool - -Defines a tool that model can call to access external knowledge. - -Signature: - -```typescript -export declare type Tool = FunctionDeclarationsTool; -``` - -## BlockReason - -Reason that a prompt was blocked. - -Signature: - -```typescript -export declare enum BlockReason -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCKED\_REASON\_UNSPECIFIED | "BLOCKED_REASON_UNSPECIFIED" | | -| OTHER | "OTHER" | | -| SAFETY | "SAFETY" | | - -## FinishReason - -Reason that a candidate finished. - -Signature: - -```typescript -export declare enum FinishReason -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| FINISH\_REASON\_UNSPECIFIED | "FINISH_REASON_UNSPECIFIED" | | -| MAX\_TOKENS | "MAX_TOKENS" | | -| OTHER | "OTHER" | | -| RECITATION | "RECITATION" | | -| SAFETY | "SAFETY" | | -| STOP | "STOP" | | - -## FunctionCallingMode - - -Signature: - -```typescript -export declare enum FunctionCallingMode -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ANY | "ANY" | | -| AUTO | "AUTO" | | -| MODE\_UNSPECIFIED | "MODE_UNSPECIFIED" | | -| NONE | "NONE" | | - -## FunctionDeclarationSchemaType - -Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ - -Signature: - -```typescript -export declare enum FunctionDeclarationSchemaType -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ARRAY | "ARRAY" | Array type. | -| BOOLEAN | "BOOLEAN" | Boolean type. | -| INTEGER | "INTEGER" | Integer type. | -| NUMBER | "NUMBER" | Number type. | -| OBJECT | "OBJECT" | Object type. | -| STRING | "STRING" | String type. | - -## HarmBlockMethod - - -Signature: - -```typescript -export declare enum HarmBlockMethod -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_BLOCK\_METHOD\_UNSPECIFIED | "HARM_BLOCK_METHOD_UNSPECIFIED" | | -| PROBABILITY | "PROBABILITY" | | -| SEVERITY | "SEVERITY" | | - -## HarmBlockThreshold - -Threshold above which a prompt or candidate will be blocked. - -Signature: - -```typescript -export declare enum HarmBlockThreshold -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | | -| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | | -| BLOCK\_NONE | "BLOCK_NONE" | | -| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | | -| HARM\_BLOCK\_THRESHOLD\_UNSPECIFIED | "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | | - -## HarmCategory - -Harm categories that would cause prompts or candidates to be blocked. - -Signature: - -```typescript -export declare enum HarmCategory -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT" | | -| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT" | | -| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH" | | -| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | | -| HARM\_CATEGORY\_UNSPECIFIED | "HARM_CATEGORY_UNSPECIFIED" | | - -## HarmProbability - -Probability that a prompt or candidate matches a harm category. - -Signature: - -```typescript -export declare enum HarmProbability -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_PROBABILITY\_UNSPECIFIED | "HARM_PROBABILITY_UNSPECIFIED" | | -| HIGH | "HIGH" | | -| LOW | "LOW" | | -| MEDIUM | "MEDIUM" | | -| NEGLIGIBLE | "NEGLIGIBLE" | | - -## HarmSeverity - -Harm severity levels. - -Signature: - -```typescript -export declare enum HarmSeverity -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | | -| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | | -| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | | -| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | | -| HARM\_SEVERITY\_UNSPECIFIED | "HARM_SEVERITY_UNSPECIFIED" | | - -## VertexAIErrorCode - -Standardized error codes that [VertexAIError](./vertexai-preview.vertexaierror.md#vertexaierror_class) can have. - -Signature: - -```typescript -export declare const enum VertexAIErrorCode -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| ERROR | "error" | A generic error occurred. | -| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | -| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | -| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | -| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | -| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | -| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | -| REQUEST\_ERROR | "request-error" | An error occurred in a request. | -| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | - diff --git a/docs-devsite/vertexai.arrayschema.md b/docs-devsite/vertexai.arrayschema.md new file mode 100644 index 00000000000..8f228baf9e8 --- /dev/null +++ b/docs-devsite/vertexai.arrayschema.md @@ -0,0 +1,57 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ArraySchema class +Schema class for "array" types. The `items` param should refer to the type of item that can be a member of the array. + +Signature: + +```typescript +export declare class ArraySchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams, items)](./vertexai.arrayschema.md#arrayschemaconstructor) | | Constructs a new instance of the ArraySchema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [items](./vertexai.arrayschema.md#arrayschemaitems) | | [TypedSchema](./vertexai.md#typedschema) | | + +## ArraySchema.(constructor) + +Constructs a new instance of the `ArraySchema` class + +Signature: + +```typescript +constructor(schemaParams: SchemaParams, items: TypedSchema); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| items | [TypedSchema](./vertexai.md#typedschema) | | + +## ArraySchema.items + +Signature: + +```typescript +items: TypedSchema; +``` diff --git a/docs-devsite/vertexai-preview.baseparams.md b/docs-devsite/vertexai.baseparams.md similarity index 67% rename from docs-devsite/vertexai-preview.baseparams.md rename to docs-devsite/vertexai.baseparams.md index 6756c919ccc..382ec825210 100644 --- a/docs-devsite/vertexai-preview.baseparams.md +++ b/docs-devsite/vertexai.baseparams.md @@ -22,8 +22,8 @@ export interface BaseParams | Property | Type | Description | | --- | --- | --- | -| [generationConfig](./vertexai-preview.baseparams.md#baseparamsgenerationconfig) | [GenerationConfig](./vertexai-preview.generationconfig.md#generationconfig_interface) | | -| [safetySettings](./vertexai-preview.baseparams.md#baseparamssafetysettings) | [SafetySetting](./vertexai-preview.safetysetting.md#safetysetting_interface)\[\] | | +| [generationConfig](./vertexai.baseparams.md#baseparamsgenerationconfig) | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | | +| [safetySettings](./vertexai.baseparams.md#baseparamssafetysettings) | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface)\[\] | | ## BaseParams.generationConfig diff --git a/docs-devsite/vertexai.booleanschema.md b/docs-devsite/vertexai.booleanschema.md new file mode 100644 index 00000000000..89449f26142 --- /dev/null +++ b/docs-devsite/vertexai.booleanschema.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# BooleanSchema class +Schema class for "boolean" types. + +Signature: + +```typescript +export declare class BooleanSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.booleanschema.md#booleanschemaconstructor) | | Constructs a new instance of the BooleanSchema class | + +## BooleanSchema.(constructor) + +Constructs a new instance of the `BooleanSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + diff --git a/docs-devsite/vertexai.chatsession.md b/docs-devsite/vertexai.chatsession.md new file mode 100644 index 00000000000..cc5a75ace16 --- /dev/null +++ b/docs-devsite/vertexai.chatsession.md @@ -0,0 +1,138 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ChatSession class +ChatSession class that enables sending chat messages and stores history of sent and received messages so far. + +Signature: + +```typescript +export declare class ChatSession +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(apiSettings, model, params, requestOptions)](./vertexai.chatsession.md#chatsessionconstructor) | | Constructs a new instance of the ChatSession class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [model](./vertexai.chatsession.md#chatsessionmodel) | | string | | +| [params](./vertexai.chatsession.md#chatsessionparams) | | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) \| undefined | | +| [requestOptions](./vertexai.chatsession.md#chatsessionrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [getHistory()](./vertexai.chatsession.md#chatsessiongethistory) | | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. | +| [sendMessage(request)](./vertexai.chatsession.md#chatsessionsendmessage) | | Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | +| [sendMessageStream(request)](./vertexai.chatsession.md#chatsessionsendmessagestream) | | Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. | + +## ChatSession.(constructor) + +Constructs a new instance of the `ChatSession` class + +Signature: + +```typescript +constructor(apiSettings: ApiSettings, model: string, params?: StartChatParams | undefined, requestOptions?: RequestOptions | undefined); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| apiSettings | ApiSettings | | +| model | string | | +| params | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) \| undefined | | +| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) \| undefined | | + +## ChatSession.model + +Signature: + +```typescript +model: string; +``` + +## ChatSession.params + +Signature: + +```typescript +params?: StartChatParams | undefined; +``` + +## ChatSession.requestOptions + +Signature: + +```typescript +requestOptions?: RequestOptions | undefined; +``` + +## ChatSession.getHistory() + +Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. + +Signature: + +```typescript +getHistory(): Promise; +``` +Returns: + +Promise<[Content](./vertexai.content.md#content_interface)\[\]> + +## ChatSession.sendMessage() + +Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) + +Signature: + +```typescript +sendMessage(request: string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface)> + +## ChatSession.sendMessageStream() + +Sends a chat message and receives the response as a [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. + +Signature: + +```typescript +sendMessageStream(request: string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> + diff --git a/docs-devsite/vertexai-preview.citation.md b/docs-devsite/vertexai.citation.md similarity index 68% rename from docs-devsite/vertexai-preview.citation.md rename to docs-devsite/vertexai.citation.md index 10a615ee247..b5f5a19f231 100644 --- a/docs-devsite/vertexai-preview.citation.md +++ b/docs-devsite/vertexai.citation.md @@ -22,12 +22,12 @@ export interface Citation | Property | Type | Description | | --- | --- | --- | -| [endIndex](./vertexai-preview.citation.md#citationendindex) | number | | -| [license](./vertexai-preview.citation.md#citationlicense) | string | | -| [publicationDate](./vertexai-preview.citation.md#citationpublicationdate) | Date | | -| [startIndex](./vertexai-preview.citation.md#citationstartindex) | number | | -| [title](./vertexai-preview.citation.md#citationtitle) | string | | -| [uri](./vertexai-preview.citation.md#citationuri) | string | | +| [endIndex](./vertexai.citation.md#citationendindex) | number | | +| [license](./vertexai.citation.md#citationlicense) | string | | +| [publicationDate](./vertexai.citation.md#citationpublicationdate) | Date | | +| [startIndex](./vertexai.citation.md#citationstartindex) | number | | +| [title](./vertexai.citation.md#citationtitle) | string | | +| [uri](./vertexai.citation.md#citationuri) | string | | ## Citation.endIndex diff --git a/docs-devsite/vertexai-preview.citationmetadata.md b/docs-devsite/vertexai.citationmetadata.md similarity index 64% rename from docs-devsite/vertexai-preview.citationmetadata.md rename to docs-devsite/vertexai.citationmetadata.md index fa740ca1af7..e3d41a37d98 100644 --- a/docs-devsite/vertexai-preview.citationmetadata.md +++ b/docs-devsite/vertexai.citationmetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CitationMetadata interface -Citation metadata that may be found on a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface). +Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). Signature: @@ -22,7 +22,7 @@ export interface CitationMetadata | Property | Type | Description | | --- | --- | --- | -| [citations](./vertexai-preview.citationmetadata.md#citationmetadatacitations) | [Citation](./vertexai-preview.citation.md#citation_interface)\[\] | | +| [citations](./vertexai.citationmetadata.md#citationmetadatacitations) | [Citation](./vertexai.citation.md#citation_interface)\[\] | | ## CitationMetadata.citations diff --git a/docs-devsite/vertexai-preview.content.md b/docs-devsite/vertexai.content.md similarity index 76% rename from docs-devsite/vertexai-preview.content.md rename to docs-devsite/vertexai.content.md index 26198a3951f..7a4634a62bc 100644 --- a/docs-devsite/vertexai-preview.content.md +++ b/docs-devsite/vertexai.content.md @@ -22,8 +22,8 @@ export interface Content | Property | Type | Description | | --- | --- | --- | -| [parts](./vertexai-preview.content.md#contentparts) | [Part](./vertexai-preview.md#part)\[\] | | -| [role](./vertexai-preview.content.md#contentrole) | [Role](./vertexai-preview.md#role) | | +| [parts](./vertexai.content.md#contentparts) | [Part](./vertexai.md#part)\[\] | | +| [role](./vertexai.content.md#contentrole) | [Role](./vertexai.md#role) | | ## Content.parts diff --git a/docs-devsite/vertexai-preview.counttokensrequest.md b/docs-devsite/vertexai.counttokensrequest.md similarity index 68% rename from docs-devsite/vertexai-preview.counttokensrequest.md rename to docs-devsite/vertexai.counttokensrequest.md index 07e5f0d85f3..db519b7eb11 100644 --- a/docs-devsite/vertexai-preview.counttokensrequest.md +++ b/docs-devsite/vertexai.counttokensrequest.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CountTokensRequest interface -Params for calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens) +Params for calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens) Signature: @@ -22,7 +22,7 @@ export interface CountTokensRequest | Property | Type | Description | | --- | --- | --- | -| [contents](./vertexai-preview.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | +| [contents](./vertexai.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | ## CountTokensRequest.contents diff --git a/docs-devsite/vertexai-preview.counttokensresponse.md b/docs-devsite/vertexai.counttokensresponse.md similarity index 67% rename from docs-devsite/vertexai-preview.counttokensresponse.md rename to docs-devsite/vertexai.counttokensresponse.md index d097d5aacff..2978f9a45bb 100644 --- a/docs-devsite/vertexai-preview.counttokensresponse.md +++ b/docs-devsite/vertexai.counttokensresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # CountTokensResponse interface -Response from calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens). +Response from calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens). Signature: @@ -22,8 +22,8 @@ export interface CountTokensResponse | Property | Type | Description | | --- | --- | --- | -| [totalBillableCharacters](./vertexai-preview.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request. | -| [totalTokens](./vertexai-preview.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | +| [totalBillableCharacters](./vertexai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | The total number of billable characters counted across all instances from the request. | +| [totalTokens](./vertexai.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. | ## CountTokensResponse.totalBillableCharacters diff --git a/docs-devsite/vertexai-preview.customerrordata.md b/docs-devsite/vertexai.customerrordata.md similarity index 54% rename from docs-devsite/vertexai-preview.customerrordata.md rename to docs-devsite/vertexai.customerrordata.md index f0af0574161..701b1b84c49 100644 --- a/docs-devsite/vertexai-preview.customerrordata.md +++ b/docs-devsite/vertexai.customerrordata.md @@ -22,10 +22,10 @@ export interface CustomErrorData | Property | Type | Description | | --- | --- | --- | -| [errorDetails](./vertexai-preview.customerrordata.md#customerrordataerrordetails) | [ErrorDetails](./vertexai-preview.errordetails.md#errordetails_interface)\[\] | Optional additional details about the error. | -| [response](./vertexai-preview.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) | -| [status](./vertexai-preview.customerrordata.md#customerrordatastatus) | number | HTTP status code of the error response. | -| [statusText](./vertexai-preview.customerrordata.md#customerrordatastatustext) | string | HTTP status text of the error response. | +| [errorDetails](./vertexai.customerrordata.md#customerrordataerrordetails) | [ErrorDetails](./vertexai.errordetails.md#errordetails_interface)\[\] | Optional additional details about the error. | +| [response](./vertexai.customerrordata.md#customerrordataresponse) | [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | +| [status](./vertexai.customerrordata.md#customerrordatastatus) | number | HTTP status code of the error response. | +| [statusText](./vertexai.customerrordata.md#customerrordatastatustext) | string | HTTP status text of the error response. | ## CustomErrorData.errorDetails @@ -39,7 +39,7 @@ errorDetails?: ErrorDetails[]; ## CustomErrorData.response -Response from a [GenerateContentRequest](./vertexai-preview.generatecontentrequest.md#generatecontentrequest_interface) +Response from a [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) Signature: diff --git a/docs-devsite/vertexai-preview.date_2.md b/docs-devsite/vertexai.date_2.md similarity index 78% rename from docs-devsite/vertexai-preview.date_2.md rename to docs-devsite/vertexai.date_2.md index 5af031447c4..cf073bb86fe 100644 --- a/docs-devsite/vertexai-preview.date_2.md +++ b/docs-devsite/vertexai.date_2.md @@ -22,9 +22,9 @@ export interface Date | Property | Type | Description | | --- | --- | --- | -| [day](./vertexai-preview.date_2.md#date_2day) | number | | -| [month](./vertexai-preview.date_2.md#date_2month) | number | | -| [year](./vertexai-preview.date_2.md#date_2year) | number | | +| [day](./vertexai.date_2.md#date_2day) | number | | +| [month](./vertexai.date_2.md#date_2month) | number | | +| [year](./vertexai.date_2.md#date_2year) | number | | ## Date\_2.day diff --git a/docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md b/docs-devsite/vertexai.enhancedgeneratecontentresponse.md similarity index 61% rename from docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md rename to docs-devsite/vertexai.enhancedgeneratecontentresponse.md index 132c5ed0be2..535fb9def8f 100644 --- a/docs-devsite/vertexai-preview.enhancedgeneratecontentresponse.md +++ b/docs-devsite/vertexai.enhancedgeneratecontentresponse.md @@ -17,14 +17,14 @@ Response object wrapped with helper methods. ```typescript export interface EnhancedGenerateContentResponse extends GenerateContentResponse ``` -Extends: [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface) +Extends: [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [functionCalls](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface)\[\] \| undefined | | -| [text](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | +| [functionCalls](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () => [FunctionCall](./vertexai.functioncall.md#functioncall_interface)\[\] \| undefined | | +| [text](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. | ## EnhancedGenerateContentResponse.functionCalls diff --git a/docs-devsite/vertexai-preview.errordetails.md b/docs-devsite/vertexai.errordetails.md similarity index 68% rename from docs-devsite/vertexai-preview.errordetails.md rename to docs-devsite/vertexai.errordetails.md index 45e84a618ab..68959343439 100644 --- a/docs-devsite/vertexai-preview.errordetails.md +++ b/docs-devsite/vertexai.errordetails.md @@ -22,10 +22,10 @@ export interface ErrorDetails | Property | Type | Description | | --- | --- | --- | -| ["@type"](./vertexai-preview.errordetails.md#errordetails"@type") | string | | -| [domain](./vertexai-preview.errordetails.md#errordetailsdomain) | string | The domain where the error occurred. | -| [metadata](./vertexai-preview.errordetails.md#errordetailsmetadata) | Record<string, unknown> | Additional metadata about the error. | -| [reason](./vertexai-preview.errordetails.md#errordetailsreason) | string | The reason for the error. | +| ["@type"](./vertexai.errordetails.md#errordetails"@type") | string | | +| [domain](./vertexai.errordetails.md#errordetailsdomain) | string | The domain where the error occurred. | +| [metadata](./vertexai.errordetails.md#errordetailsmetadata) | Record<string, unknown> | Additional metadata about the error. | +| [reason](./vertexai.errordetails.md#errordetailsreason) | string | The reason for the error. | ## ErrorDetails."@type" diff --git a/docs-devsite/vertexai-preview.filedata.md b/docs-devsite/vertexai.filedata.md similarity index 81% rename from docs-devsite/vertexai-preview.filedata.md rename to docs-devsite/vertexai.filedata.md index 577b4b1910d..7e000174692 100644 --- a/docs-devsite/vertexai-preview.filedata.md +++ b/docs-devsite/vertexai.filedata.md @@ -22,8 +22,8 @@ export interface FileData | Property | Type | Description | | --- | --- | --- | -| [fileUri](./vertexai-preview.filedata.md#filedatafileuri) | string | | -| [mimeType](./vertexai-preview.filedata.md#filedatamimetype) | string | | +| [fileUri](./vertexai.filedata.md#filedatafileuri) | string | | +| [mimeType](./vertexai.filedata.md#filedatamimetype) | string | | ## FileData.fileUri diff --git a/docs-devsite/vertexai-preview.filedatapart.md b/docs-devsite/vertexai.filedatapart.md similarity index 60% rename from docs-devsite/vertexai-preview.filedatapart.md rename to docs-devsite/vertexai.filedatapart.md index e03c056f588..74512fa6d29 100644 --- a/docs-devsite/vertexai-preview.filedatapart.md +++ b/docs-devsite/vertexai.filedatapart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FileDataPart interface -Content part interface if the part represents [FileData](./vertexai-preview.filedata.md#filedata_interface) +Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) Signature: @@ -22,11 +22,11 @@ export interface FileDataPart | Property | Type | Description | | --- | --- | --- | -| [fileData](./vertexai-preview.filedatapart.md#filedatapartfiledata) | [FileData](./vertexai-preview.filedata.md#filedata_interface) | | -| [functionCall](./vertexai-preview.filedatapart.md#filedatapartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.filedatapart.md#filedatapartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.filedatapart.md#filedatapartinlinedata) | never | | -| [text](./vertexai-preview.filedatapart.md#filedataparttext) | never | | +| [fileData](./vertexai.filedatapart.md#filedatapartfiledata) | [FileData](./vertexai.filedata.md#filedata_interface) | | +| [functionCall](./vertexai.filedatapart.md#filedatapartfunctioncall) | never | | +| [functionResponse](./vertexai.filedatapart.md#filedatapartfunctionresponse) | never | | +| [inlineData](./vertexai.filedatapart.md#filedatapartinlinedata) | never | | +| [text](./vertexai.filedatapart.md#filedataparttext) | never | | ## FileDataPart.fileData diff --git a/docs-devsite/vertexai-preview.functioncall.md b/docs-devsite/vertexai.functioncall.md similarity index 57% rename from docs-devsite/vertexai-preview.functioncall.md rename to docs-devsite/vertexai.functioncall.md index 60e0ea50dc4..ca7bc015438 100644 --- a/docs-devsite/vertexai-preview.functioncall.md +++ b/docs-devsite/vertexai.functioncall.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCall interface -A predicted [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. +A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. Signature: @@ -22,8 +22,8 @@ export interface FunctionCall | Property | Type | Description | | --- | --- | --- | -| [args](./vertexai-preview.functioncall.md#functioncallargs) | object | | -| [name](./vertexai-preview.functioncall.md#functioncallname) | string | | +| [args](./vertexai.functioncall.md#functioncallargs) | object | | +| [name](./vertexai.functioncall.md#functioncallname) | string | | ## FunctionCall.args diff --git a/docs-devsite/vertexai-preview.functioncallingconfig.md b/docs-devsite/vertexai.functioncallingconfig.md similarity index 71% rename from docs-devsite/vertexai-preview.functioncallingconfig.md rename to docs-devsite/vertexai.functioncallingconfig.md index 1965fb76e95..3724fec5bf7 100644 --- a/docs-devsite/vertexai-preview.functioncallingconfig.md +++ b/docs-devsite/vertexai.functioncallingconfig.md @@ -21,8 +21,8 @@ export interface FunctionCallingConfig | Property | Type | Description | | --- | --- | --- | -| [allowedFunctionNames](./vertexai-preview.functioncallingconfig.md#functioncallingconfigallowedfunctionnames) | string\[\] | | -| [mode](./vertexai-preview.functioncallingconfig.md#functioncallingconfigmode) | [FunctionCallingMode](./vertexai-preview.md#functioncallingmode) | | +| [allowedFunctionNames](./vertexai.functioncallingconfig.md#functioncallingconfigallowedfunctionnames) | string\[\] | | +| [mode](./vertexai.functioncallingconfig.md#functioncallingconfigmode) | [FunctionCallingMode](./vertexai.md#functioncallingmode) | | ## FunctionCallingConfig.allowedFunctionNames diff --git a/docs-devsite/vertexai-preview.functioncallpart.md b/docs-devsite/vertexai.functioncallpart.md similarity index 59% rename from docs-devsite/vertexai-preview.functioncallpart.md rename to docs-devsite/vertexai.functioncallpart.md index 5da204692f9..af8ccf1109a 100644 --- a/docs-devsite/vertexai-preview.functioncallpart.md +++ b/docs-devsite/vertexai.functioncallpart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionCallPart interface -Content part interface if the part represents a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface). +Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). Signature: @@ -22,10 +22,10 @@ export interface FunctionCallPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) | | -| [functionResponse](./vertexai-preview.functioncallpart.md#functioncallpartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.functioncallpart.md#functioncallpartinlinedata) | never | | -| [text](./vertexai-preview.functioncallpart.md#functioncallparttext) | never | | +| [functionCall](./vertexai.functioncallpart.md#functioncallpartfunctioncall) | [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | | +| [functionResponse](./vertexai.functioncallpart.md#functioncallpartfunctionresponse) | never | | +| [inlineData](./vertexai.functioncallpart.md#functioncallpartinlinedata) | never | | +| [text](./vertexai.functioncallpart.md#functioncallparttext) | never | | ## FunctionCallPart.functionCall diff --git a/docs-devsite/vertexai-preview.functiondeclaration.md b/docs-devsite/vertexai.functiondeclaration.md similarity index 57% rename from docs-devsite/vertexai-preview.functiondeclaration.md rename to docs-devsite/vertexai.functiondeclaration.md index e178c7e8bc3..211c1dd868d 100644 --- a/docs-devsite/vertexai-preview.functiondeclaration.md +++ b/docs-devsite/vertexai.functiondeclaration.md @@ -22,18 +22,18 @@ export declare interface FunctionDeclaration | Property | Type | Description | | --- | --- | --- | -| [description](./vertexai-preview.functiondeclaration.md#functiondeclarationdescription) | string | Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. | -| [name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. | -| [parameters](./vertexai-preview.functiondeclaration.md#functiondeclarationparameters) | [FunctionDeclarationSchema](./vertexai-preview.functiondeclarationschema.md#functiondeclarationschema_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | +| [description](./vertexai.functiondeclaration.md#functiondeclarationdescription) | string | Description and purpose of the function. Model uses it to decide how and whether to call the function. | +| [name](./vertexai.functiondeclaration.md#functiondeclarationname) | string | The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. | +| [parameters](./vertexai.functiondeclaration.md#functiondeclarationparameters) | [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. Parameter names are case-sensitive. For a function with no parameters, this can be left unset. | ## FunctionDeclaration.description -Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. +Description and purpose of the function. Model uses it to decide how and whether to call the function. Signature: ```typescript -description?: string; +description: string; ``` ## FunctionDeclaration.name @@ -53,5 +53,5 @@ Optional. Describes the parameters to this function in JSON Schema Object format Signature: ```typescript -parameters?: FunctionDeclarationSchema; +parameters?: ObjectSchemaInterface; ``` diff --git a/docs-devsite/vertexai.functiondeclarationstool.md b/docs-devsite/vertexai.functiondeclarationstool.md new file mode 100644 index 00000000000..5e728046639 --- /dev/null +++ b/docs-devsite/vertexai.functiondeclarationstool.md @@ -0,0 +1,35 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FunctionDeclarationsTool interface +A `FunctionDeclarationsTool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. + +Signature: + +```typescript +export declare interface FunctionDeclarationsTool +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [functionDeclarations](./vertexai.functiondeclarationstool.md#functiondeclarationstoolfunctiondeclarations) | [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface)\[\] | Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. | + +## FunctionDeclarationsTool.functionDeclarations + +Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating [FunctionCall](./vertexai.functioncall.md#functioncall_interface) in the response. User should provide a [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) for each function call in the next turn. Based on the function responses, the model will generate the final response back to the user. Maximum 64 function declarations can be provided. + +Signature: + +```typescript +functionDeclarations?: FunctionDeclaration[]; +``` diff --git a/docs-devsite/vertexai-preview.functionresponse.md b/docs-devsite/vertexai.functionresponse.md similarity index 50% rename from docs-devsite/vertexai-preview.functionresponse.md rename to docs-devsite/vertexai.functionresponse.md index d89ace08df1..0ca553e0e6b 100644 --- a/docs-devsite/vertexai-preview.functionresponse.md +++ b/docs-devsite/vertexai.functionresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponse interface -The result output from a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai-preview.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai-preview.functioncall.md#functioncall_interface) made based on model prediction. +The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. Signature: @@ -22,8 +22,8 @@ export interface FunctionResponse | Property | Type | Description | | --- | --- | --- | -| [name](./vertexai-preview.functionresponse.md#functionresponsename) | string | | -| [response](./vertexai-preview.functionresponse.md#functionresponseresponse) | object | | +| [name](./vertexai.functionresponse.md#functionresponsename) | string | | +| [response](./vertexai.functionresponse.md#functionresponseresponse) | object | | ## FunctionResponse.name diff --git a/docs-devsite/vertexai-preview.functionresponsepart.md b/docs-devsite/vertexai.functionresponsepart.md similarity index 58% rename from docs-devsite/vertexai-preview.functionresponsepart.md rename to docs-devsite/vertexai.functionresponsepart.md index 4e246d625f6..1905c98cdc7 100644 --- a/docs-devsite/vertexai-preview.functionresponsepart.md +++ b/docs-devsite/vertexai.functionresponsepart.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # FunctionResponsePart interface -Content part interface if the part represents [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface). +Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). Signature: @@ -22,10 +22,10 @@ export interface FunctionResponsePart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.functionresponsepart.md#functionresponsepartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./vertexai-preview.functionresponse.md#functionresponse_interface) | | -| [inlineData](./vertexai-preview.functionresponsepart.md#functionresponsepartinlinedata) | never | | -| [text](./vertexai-preview.functionresponsepart.md#functionresponseparttext) | never | | +| [functionCall](./vertexai.functionresponsepart.md#functionresponsepartfunctioncall) | never | | +| [functionResponse](./vertexai.functionresponsepart.md#functionresponsepartfunctionresponse) | [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | | +| [inlineData](./vertexai.functionresponsepart.md#functionresponsepartinlinedata) | never | | +| [text](./vertexai.functionresponsepart.md#functionresponseparttext) | never | | ## FunctionResponsePart.functionCall diff --git a/docs-devsite/vertexai.generatecontentcandidate.md b/docs-devsite/vertexai.generatecontentcandidate.md new file mode 100644 index 00000000000..a30eef55485 --- /dev/null +++ b/docs-devsite/vertexai.generatecontentcandidate.md @@ -0,0 +1,87 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerateContentCandidate interface +A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). + +Signature: + +```typescript +export interface GenerateContentCandidate +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [citationMetadata](./vertexai.generatecontentcandidate.md#generatecontentcandidatecitationmetadata) | [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | | +| [content](./vertexai.generatecontentcandidate.md#generatecontentcandidatecontent) | [Content](./vertexai.content.md#content_interface) | | +| [finishMessage](./vertexai.generatecontentcandidate.md#generatecontentcandidatefinishmessage) | string | | +| [finishReason](./vertexai.generatecontentcandidate.md#generatecontentcandidatefinishreason) | [FinishReason](./vertexai.md#finishreason) | | +| [groundingMetadata](./vertexai.generatecontentcandidate.md#generatecontentcandidategroundingmetadata) | [GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface) | | +| [index](./vertexai.generatecontentcandidate.md#generatecontentcandidateindex) | number | | +| [safetyRatings](./vertexai.generatecontentcandidate.md#generatecontentcandidatesafetyratings) | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface)\[\] | | + +## GenerateContentCandidate.citationMetadata + +Signature: + +```typescript +citationMetadata?: CitationMetadata; +``` + +## GenerateContentCandidate.content + +Signature: + +```typescript +content: Content; +``` + +## GenerateContentCandidate.finishMessage + +Signature: + +```typescript +finishMessage?: string; +``` + +## GenerateContentCandidate.finishReason + +Signature: + +```typescript +finishReason?: FinishReason; +``` + +## GenerateContentCandidate.groundingMetadata + +Signature: + +```typescript +groundingMetadata?: GroundingMetadata; +``` + +## GenerateContentCandidate.index + +Signature: + +```typescript +index: number; +``` + +## GenerateContentCandidate.safetyRatings + +Signature: + +```typescript +safetyRatings?: SafetyRating[]; +``` diff --git a/docs-devsite/vertexai-preview.generatecontentrequest.md b/docs-devsite/vertexai.generatecontentrequest.md similarity index 54% rename from docs-devsite/vertexai-preview.generatecontentrequest.md rename to docs-devsite/vertexai.generatecontentrequest.md index 68ce52340e8..31f1103a2e2 100644 --- a/docs-devsite/vertexai-preview.generatecontentrequest.md +++ b/docs-devsite/vertexai.generatecontentrequest.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentRequest interface -Request sent through [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) +Request sent through [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) Signature: ```typescript export interface GenerateContentRequest extends BaseParams ``` -Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [contents](./vertexai-preview.generatecontentrequest.md#generatecontentrequestcontents) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | -| [systemInstruction](./vertexai-preview.generatecontentrequest.md#generatecontentrequestsysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.generatecontentrequest.md#generatecontentrequesttoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.generatecontentrequest.md#generatecontentrequesttools) | [Tool](./vertexai-preview.md#tool)\[\] | | +| [contents](./vertexai.generatecontentrequest.md#generatecontentrequestcontents) | [Content](./vertexai.content.md#content_interface)\[\] | | +| [systemInstruction](./vertexai.generatecontentrequest.md#generatecontentrequestsysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.generatecontentrequest.md#generatecontentrequesttoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.generatecontentrequest.md#generatecontentrequesttools) | [Tool](./vertexai.md#tool)\[\] | | ## GenerateContentRequest.contents diff --git a/docs-devsite/vertexai-preview.generatecontentresponse.md b/docs-devsite/vertexai.generatecontentresponse.md similarity index 50% rename from docs-devsite/vertexai-preview.generatecontentresponse.md rename to docs-devsite/vertexai.generatecontentresponse.md index cb0fb0e3209..304674c9b6f 100644 --- a/docs-devsite/vertexai-preview.generatecontentresponse.md +++ b/docs-devsite/vertexai.generatecontentresponse.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentResponse interface -Individual response from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream). `generateContentStream()` will return one in each chunk until the stream is done. +Individual response from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream). `generateContentStream()` will return one in each chunk until the stream is done. Signature: @@ -22,9 +22,9 @@ export interface GenerateContentResponse | Property | Type | Description | | --- | --- | --- | -| [candidates](./vertexai-preview.generatecontentresponse.md#generatecontentresponsecandidates) | [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface)\[\] | | -| [promptFeedback](./vertexai-preview.generatecontentresponse.md#generatecontentresponsepromptfeedback) | [PromptFeedback](./vertexai-preview.promptfeedback.md#promptfeedback_interface) | | -| [usageMetadata](./vertexai-preview.generatecontentresponse.md#generatecontentresponseusagemetadata) | [UsageMetadata](./vertexai-preview.usagemetadata.md#usagemetadata_interface) | | +| [candidates](./vertexai.generatecontentresponse.md#generatecontentresponsecandidates) | [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface)\[\] | | +| [promptFeedback](./vertexai.generatecontentresponse.md#generatecontentresponsepromptfeedback) | [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | | +| [usageMetadata](./vertexai.generatecontentresponse.md#generatecontentresponseusagemetadata) | [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | | ## GenerateContentResponse.candidates diff --git a/docs-devsite/vertexai-preview.generatecontentresult.md b/docs-devsite/vertexai.generatecontentresult.md similarity index 69% rename from docs-devsite/vertexai-preview.generatecontentresult.md rename to docs-devsite/vertexai.generatecontentresult.md index 87249a5bc55..3e162f9ebb2 100644 --- a/docs-devsite/vertexai-preview.generatecontentresult.md +++ b/docs-devsite/vertexai.generatecontentresult.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentResult interface -Result object returned from [GenerativeModel.generateContent()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontent) call. +Result object returned from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) call. Signature: @@ -22,7 +22,7 @@ export interface GenerateContentResult | Property | Type | Description | | --- | --- | --- | -| [response](./vertexai-preview.generatecontentresult.md#generatecontentresultresponse) | [EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | | +| [response](./vertexai.generatecontentresult.md#generatecontentresultresponse) | [EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | | ## GenerateContentResult.response diff --git a/docs-devsite/vertexai-preview.generatecontentstreamresult.md b/docs-devsite/vertexai.generatecontentstreamresult.md similarity index 52% rename from docs-devsite/vertexai-preview.generatecontentstreamresult.md rename to docs-devsite/vertexai.generatecontentstreamresult.md index 6fd46600079..340abb1d0bd 100644 --- a/docs-devsite/vertexai-preview.generatecontentstreamresult.md +++ b/docs-devsite/vertexai.generatecontentstreamresult.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # GenerateContentStreamResult interface -Result object returned from [GenerativeModel.generateContentStream()](./vertexai-preview.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over `stream` to get chunks as they come in and/or use the `response` promise to get the aggregated response when the stream is done. +Result object returned from [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over `stream` to get chunks as they come in and/or use the `response` promise to get the aggregated response when the stream is done. Signature: @@ -22,8 +22,8 @@ export interface GenerateContentStreamResult | Property | Type | Description | | --- | --- | --- | -| [response](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresultresponse) | Promise<[EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | -| [stream](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresultstream) | AsyncGenerator<[EnhancedGenerateContentResponse](./vertexai-preview.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | +| [response](./vertexai.generatecontentstreamresult.md#generatecontentstreamresultresponse) | Promise<[EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | +| [stream](./vertexai.generatecontentstreamresult.md#generatecontentstreamresultstream) | AsyncGenerator<[EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface)> | | ## GenerateContentStreamResult.response diff --git a/docs-devsite/vertexai.generationconfig.md b/docs-devsite/vertexai.generationconfig.md new file mode 100644 index 00000000000..3c3d0a14ffa --- /dev/null +++ b/docs-devsite/vertexai.generationconfig.md @@ -0,0 +1,118 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerationConfig interface +Config options for content-related requests + +Signature: + +```typescript +export interface GenerationConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [candidateCount](./vertexai.generationconfig.md#generationconfigcandidatecount) | number | | +| [frequencyPenalty](./vertexai.generationconfig.md#generationconfigfrequencypenalty) | number | | +| [maxOutputTokens](./vertexai.generationconfig.md#generationconfigmaxoutputtokens) | number | | +| [presencePenalty](./vertexai.generationconfig.md#generationconfigpresencepenalty) | number | | +| [responseMimeType](./vertexai.generationconfig.md#generationconfigresponsemimetype) | string | Output response MIME type of the generated candidate text. Supported MIME types are text/plain (default, text output), application/json (JSON response in the candidates), and text/x.enum. | +| [responseSchema](./vertexai.generationconfig.md#generationconfigresponseschema) | [TypedSchema](./vertexai.md#typedschema) \| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like Schema.string() or Schema.object() or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum. | +| [stopSequences](./vertexai.generationconfig.md#generationconfigstopsequences) | string\[\] | | +| [temperature](./vertexai.generationconfig.md#generationconfigtemperature) | number | | +| [topK](./vertexai.generationconfig.md#generationconfigtopk) | number | | +| [topP](./vertexai.generationconfig.md#generationconfigtopp) | number | | + +## GenerationConfig.candidateCount + +Signature: + +```typescript +candidateCount?: number; +``` + +## GenerationConfig.frequencyPenalty + +Signature: + +```typescript +frequencyPenalty?: number; +``` + +## GenerationConfig.maxOutputTokens + +Signature: + +```typescript +maxOutputTokens?: number; +``` + +## GenerationConfig.presencePenalty + +Signature: + +```typescript +presencePenalty?: number; +``` + +## GenerationConfig.responseMimeType + +Output response MIME type of the generated candidate text. Supported MIME types are `text/plain` (default, text output), `application/json` (JSON response in the candidates), and `text/x.enum`. + +Signature: + +```typescript +responseMimeType?: string; +``` + +## GenerationConfig.responseSchema + +Output response schema of the generated candidate text. This value can be a class generated with a [Schema](./vertexai.schema.md#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) interface.
Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. + +Signature: + +```typescript +responseSchema?: TypedSchema | SchemaRequest; +``` + +## GenerationConfig.stopSequences + +Signature: + +```typescript +stopSequences?: string[]; +``` + +## GenerationConfig.temperature + +Signature: + +```typescript +temperature?: number; +``` + +## GenerationConfig.topK + +Signature: + +```typescript +topK?: number; +``` + +## GenerationConfig.topP + +Signature: + +```typescript +topP?: number; +``` diff --git a/docs-devsite/vertexai-preview.generativecontentblob.md b/docs-devsite/vertexai.generativecontentblob.md similarity index 76% rename from docs-devsite/vertexai-preview.generativecontentblob.md rename to docs-devsite/vertexai.generativecontentblob.md index b5dcb272027..dfcd098291f 100644 --- a/docs-devsite/vertexai-preview.generativecontentblob.md +++ b/docs-devsite/vertexai.generativecontentblob.md @@ -22,8 +22,8 @@ export interface GenerativeContentBlob | Property | Type | Description | | --- | --- | --- | -| [data](./vertexai-preview.generativecontentblob.md#generativecontentblobdata) | string | Image as a base64 string. | -| [mimeType](./vertexai-preview.generativecontentblob.md#generativecontentblobmimetype) | string | | +| [data](./vertexai.generativecontentblob.md#generativecontentblobdata) | string | Image as a base64 string. | +| [mimeType](./vertexai.generativecontentblob.md#generativecontentblobmimetype) | string | | ## GenerativeContentBlob.data diff --git a/docs-devsite/vertexai.generativemodel.md b/docs-devsite/vertexai.generativemodel.md new file mode 100644 index 00000000000..7105f9c100b --- /dev/null +++ b/docs-devsite/vertexai.generativemodel.md @@ -0,0 +1,201 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# GenerativeModel class +Class for generative model APIs. + +Signature: + +```typescript +export declare class GenerativeModel +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(vertexAI, modelParams, requestOptions)](./vertexai.generativemodel.md#generativemodelconstructor) | | Constructs a new instance of the GenerativeModel class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [generationConfig](./vertexai.generativemodel.md#generativemodelgenerationconfig) | | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | | +| [model](./vertexai.generativemodel.md#generativemodelmodel) | | string | | +| [requestOptions](./vertexai.generativemodel.md#generativemodelrequestoptions) | | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | +| [safetySettings](./vertexai.generativemodel.md#generativemodelsafetysettings) | | [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface)\[\] | | +| [systemInstruction](./vertexai.generativemodel.md#generativemodelsysteminstruction) | | [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.generativemodel.md#generativemodeltoolconfig) | | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.generativemodel.md#generativemodeltools) | | [Tool](./vertexai.md#tool)\[\] | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [countTokens(request)](./vertexai.generativemodel.md#generativemodelcounttokens) | | Counts the tokens in the provided request. | +| [generateContent(request)](./vertexai.generativemodel.md#generativemodelgeneratecontent) | | Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [generateContentStream(request)](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) | | Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. | +| [startChat(startChatParams)](./vertexai.generativemodel.md#generativemodelstartchat) | | Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. | + +## GenerativeModel.(constructor) + +Constructs a new instance of the `GenerativeModel` class + +Signature: + +```typescript +constructor(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | | +| modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | +| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | + +## GenerativeModel.generationConfig + +Signature: + +```typescript +generationConfig: GenerationConfig; +``` + +## GenerativeModel.model + +Signature: + +```typescript +model: string; +``` + +## GenerativeModel.requestOptions + +Signature: + +```typescript +requestOptions?: RequestOptions; +``` + +## GenerativeModel.safetySettings + +Signature: + +```typescript +safetySettings: SafetySetting[]; +``` + +## GenerativeModel.systemInstruction + +Signature: + +```typescript +systemInstruction?: Content; +``` + +## GenerativeModel.toolConfig + +Signature: + +```typescript +toolConfig?: ToolConfig; +``` + +## GenerativeModel.tools + +Signature: + +```typescript +tools?: Tool[]; +``` + +## GenerativeModel.countTokens() + +Counts the tokens in the provided request. + +Signature: + +```typescript +countTokens(request: CountTokensRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [CountTokensRequest](./vertexai.counttokensrequest.md#counttokensrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[CountTokensResponse](./vertexai.counttokensresponse.md#counttokensresponse_interface)> + +## GenerativeModel.generateContent() + +Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). + +Signature: + +```typescript +generateContent(request: GenerateContentRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface)> + +## GenerativeModel.generateContentStream() + +Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. + +Signature: + +```typescript +generateContentStream(request: GenerateContentRequest | string | Array): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| request | [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) \| string \| Array<string \| [Part](./vertexai.md#part)> | | + +Returns: + +Promise<[GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface)> + +## GenerativeModel.startChat() + +Gets a new [ChatSession](./vertexai.chatsession.md#chatsession_class) instance which can be used for multi-turn chats. + +Signature: + +```typescript +startChat(startChatParams?: StartChatParams): ChatSession; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| startChatParams | [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) | | + +Returns: + +[ChatSession](./vertexai.chatsession.md#chatsession_class) + diff --git a/docs-devsite/vertexai-preview.groundingattribution.md b/docs-devsite/vertexai.groundingattribution.md similarity index 58% rename from docs-devsite/vertexai-preview.groundingattribution.md rename to docs-devsite/vertexai.groundingattribution.md index 2c7d2f09e0b..b72d8150635 100644 --- a/docs-devsite/vertexai-preview.groundingattribution.md +++ b/docs-devsite/vertexai.groundingattribution.md @@ -21,10 +21,10 @@ export interface GroundingAttribution | Property | Type | Description | | --- | --- | --- | -| [confidenceScore](./vertexai-preview.groundingattribution.md#groundingattributionconfidencescore) | number | | -| [retrievedContext](./vertexai-preview.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | -| [segment](./vertexai-preview.groundingattribution.md#groundingattributionsegment) | [Segment](./vertexai-preview.segment.md#segment_interface) | | -| [web](./vertexai-preview.groundingattribution.md#groundingattributionweb) | [WebAttribution](./vertexai-preview.webattribution.md#webattribution_interface) | | +| [confidenceScore](./vertexai.groundingattribution.md#groundingattributionconfidencescore) | number | | +| [retrievedContext](./vertexai.groundingattribution.md#groundingattributionretrievedcontext) | [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | +| [segment](./vertexai.groundingattribution.md#groundingattributionsegment) | [Segment](./vertexai.segment.md#segment_interface) | | +| [web](./vertexai.groundingattribution.md#groundingattributionweb) | [WebAttribution](./vertexai.webattribution.md#webattribution_interface) | | ## GroundingAttribution.confidenceScore diff --git a/docs-devsite/vertexai-preview.groundingmetadata.md b/docs-devsite/vertexai.groundingmetadata.md similarity index 66% rename from docs-devsite/vertexai-preview.groundingmetadata.md rename to docs-devsite/vertexai.groundingmetadata.md index 5f40a00457d..186f00d29a7 100644 --- a/docs-devsite/vertexai-preview.groundingmetadata.md +++ b/docs-devsite/vertexai.groundingmetadata.md @@ -22,9 +22,9 @@ export interface GroundingMetadata | Property | Type | Description | | --- | --- | --- | -| [groundingAttributions](./vertexai-preview.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./vertexai-preview.groundingattribution.md#groundingattribution_interface)\[\] | | -| [retrievalQueries](./vertexai-preview.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | -| [webSearchQueries](./vertexai-preview.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | | +| [groundingAttributions](./vertexai.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./vertexai.groundingattribution.md#groundingattribution_interface)\[\] | | +| [retrievalQueries](./vertexai.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | | +| [webSearchQueries](./vertexai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | | ## GroundingMetadata.groundingAttributions diff --git a/docs-devsite/vertexai-preview.inlinedatapart.md b/docs-devsite/vertexai.inlinedatapart.md similarity index 60% rename from docs-devsite/vertexai-preview.inlinedatapart.md rename to docs-devsite/vertexai.inlinedatapart.md index ae05f80ddb7..0cb064fc357 100644 --- a/docs-devsite/vertexai-preview.inlinedatapart.md +++ b/docs-devsite/vertexai.inlinedatapart.md @@ -22,11 +22,11 @@ export interface InlineDataPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.inlinedatapart.md#inlinedatapartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./vertexai-preview.generativecontentblob.md#generativecontentblob_interface) | | -| [text](./vertexai-preview.inlinedatapart.md#inlinedataparttext) | never | | -| [videoMetadata](./vertexai-preview.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./vertexai-preview.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | +| [functionCall](./vertexai.inlinedatapart.md#inlinedatapartfunctioncall) | never | | +| [functionResponse](./vertexai.inlinedatapart.md#inlinedatapartfunctionresponse) | never | | +| [inlineData](./vertexai.inlinedatapart.md#inlinedatapartinlinedata) | [GenerativeContentBlob](./vertexai.generativecontentblob.md#generativecontentblob_interface) | | +| [text](./vertexai.inlinedatapart.md#inlinedataparttext) | never | | +| [videoMetadata](./vertexai.inlinedatapart.md#inlinedatapartvideometadata) | [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Applicable if inlineData is a video. | ## InlineDataPart.functionCall diff --git a/docs-devsite/vertexai.integerschema.md b/docs-devsite/vertexai.integerschema.md new file mode 100644 index 00000000000..4822bdd618b --- /dev/null +++ b/docs-devsite/vertexai.integerschema.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# IntegerSchema class +Schema class for "integer" types. + +Signature: + +```typescript +export declare class IntegerSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.integerschema.md#integerschemaconstructor) | | Constructs a new instance of the IntegerSchema class | + +## IntegerSchema.(constructor) + +Constructs a new instance of the `IntegerSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + diff --git a/docs-devsite/vertexai.md b/docs-devsite/vertexai.md new file mode 100644 index 00000000000..d7eed6f2f86 --- /dev/null +++ b/docs-devsite/vertexai.md @@ -0,0 +1,412 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# vertexai package +The Vertex AI in Firebase Web SDK. + +## Functions + +| Function | Description | +| --- | --- | +| function(app, ...) | +| [getVertexAI(app, options)](./vertexai.md#getvertexai_04094cf) | Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. | +| function(vertexAI, ...) | +| [getGenerativeModel(vertexAI, modelParams, requestOptions)](./vertexai.md#getgenerativemodel_e3037c9) | Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. | + +## Classes + +| Class | Description | +| --- | --- | +| [ArraySchema](./vertexai.arrayschema.md#arrayschema_class) | Schema class for "array" types. The items param should refer to the type of item that can be a member of the array. | +| [BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) | Schema class for "boolean" types. | +| [ChatSession](./vertexai.chatsession.md#chatsession_class) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. | +| [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) | Class for generative model APIs. | +| [IntegerSchema](./vertexai.integerschema.md#integerschema_class) | Schema class for "integer" types. | +| [NumberSchema](./vertexai.numberschema.md#numberschema_class) | Schema class for "number" types. | +| [ObjectSchema](./vertexai.objectschema.md#objectschema_class) | Schema class for "object" types. The properties param must be a map of Schema objects. | +| [Schema](./vertexai.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with JSON.stringify() into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) | +| [StringSchema](./vertexai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. | +| [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) | Error class for the Vertex AI in Firebase SDK. | + +## Enumerations + +| Enumeration | Description | +| --- | --- | +| [BlockReason](./vertexai.md#blockreason) | Reason that a prompt was blocked. | +| [FinishReason](./vertexai.md#finishreason) | Reason that a candidate finished. | +| [FunctionCallingMode](./vertexai.md#functioncallingmode) | | +| [HarmBlockMethod](./vertexai.md#harmblockmethod) | | +| [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | Threshold above which a prompt or candidate will be blocked. | +| [HarmCategory](./vertexai.md#harmcategory) | Harm categories that would cause prompts or candidates to be blocked. | +| [HarmProbability](./vertexai.md#harmprobability) | Probability that a prompt or candidate matches a harm category. | +| [HarmSeverity](./vertexai.md#harmseverity) | Harm severity levels. | +| [SchemaType](./vertexai.md#schematype) | Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) | +| [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [BaseParams](./vertexai.baseparams.md#baseparams_interface) | Base parameters for a number of methods. | +| [Citation](./vertexai.citation.md#citation_interface) | A single citation. | +| [CitationMetadata](./vertexai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface). | +| [Content](./vertexai.content.md#content_interface) | Content type for both prompts and response candidates. | +| [CountTokensRequest](./vertexai.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens) | +| [CountTokensResponse](./vertexai.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./vertexai.generativemodel.md#generativemodelcounttokens). | +| [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) | Details object that contains data originating from a bad HTTP response. | +| [Date\_2](./vertexai.date_2.md#date_2_interface) | Protobuf google.type.Date | +| [EnhancedGenerateContentResponse](./vertexai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponse_interface) | Response object wrapped with helper methods. | +| [ErrorDetails](./vertexai.errordetails.md#errordetails_interface) | Details object that may be included in an error response. | +| [FileData](./vertexai.filedata.md#filedata_interface) | Data pointing to a file uploaded on Google Cloud Storage. | +| [FileDataPart](./vertexai.filedatapart.md#filedatapart_interface) | Content part interface if the part represents [FileData](./vertexai.filedata.md#filedata_interface) | +| [FunctionCall](./vertexai.functioncall.md#functioncall_interface) | A predicted [FunctionCall](./vertexai.functioncall.md#functioncall_interface) returned from the model that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing the parameters and their values. | +| [FunctionCallingConfig](./vertexai.functioncallingconfig.md#functioncallingconfig_interface) | | +| [FunctionCallPart](./vertexai.functioncallpart.md#functioncallpart_interface) | Content part interface if the part represents a [FunctionCall](./vertexai.functioncall.md#functioncall_interface). | +| [FunctionDeclaration](./vertexai.functiondeclaration.md#functiondeclaration_interface) | Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client. | +| [FunctionDeclarationsTool](./vertexai.functiondeclarationstool.md#functiondeclarationstool_interface) | A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. | +| [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface) | The result output from a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) that contains a string representing the [FunctionDeclaration.name](./vertexai.functiondeclaration.md#functiondeclarationname) and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall](./vertexai.functioncall.md#functioncall_interface) made based on model prediction. | +| [FunctionResponsePart](./vertexai.functionresponsepart.md#functionresponsepart_interface) | Content part interface if the part represents [FunctionResponse](./vertexai.functionresponse.md#functionresponse_interface). | +| [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | A candidate returned as part of a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [GenerateContentRequest](./vertexai.generatecontentrequest.md#generatecontentrequest_interface) | Request sent through [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) | +| [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface) | Individual response from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream). generateContentStream() will return one in each chunk until the stream is done. | +| [GenerateContentResult](./vertexai.generatecontentresult.md#generatecontentresult_interface) | Result object returned from [GenerativeModel.generateContent()](./vertexai.generativemodel.md#generativemodelgeneratecontent) call. | +| [GenerateContentStreamResult](./vertexai.generatecontentstreamresult.md#generatecontentstreamresult_interface) | Result object returned from [GenerativeModel.generateContentStream()](./vertexai.generativemodel.md#generativemodelgeneratecontentstream) call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. | +| [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | Config options for content-related requests | +| [GenerativeContentBlob](./vertexai.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. | +| [GroundingAttribution](./vertexai.groundingattribution.md#groundingattribution_interface) | | +| [GroundingMetadata](./vertexai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned to client when grounding is enabled. | +| [InlineDataPart](./vertexai.inlinedatapart.md#inlinedatapart_interface) | Content part interface if the part represents an image. | +| [ModelParams](./vertexai.modelparams.md#modelparams_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | +| [ObjectSchemaInterface](./vertexai.objectschemainterface.md#objectschemainterface_interface) | Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. | +| [PromptFeedback](./vertexai.promptfeedback.md#promptfeedback_interface) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings. | +| [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). | +| [RetrievedContextAttribution](./vertexai.retrievedcontextattribution.md#retrievedcontextattribution_interface) | | +| [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface) | A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) | +| [SafetySetting](./vertexai.safetysetting.md#safetysetting_interface) | Safety setting that can be sent as part of request parameters. | +| [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | Interface for [Schema](./vertexai.schema.md#schema_class) class. | +| [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. | +| [SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface) | Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. | +| [SchemaShared](./vertexai.schemashared.md#schemashared_interface) | Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. | +| [Segment](./vertexai.segment.md#segment_interface) | | +| [StartChatParams](./vertexai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./vertexai.generativemodel.md#generativemodelstartchat). | +| [TextPart](./vertexai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. | +| [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. | +| [UsageMetadata](./vertexai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). | +| [VertexAI](./vertexai.vertexai.md#vertexai_interface) | An instance of the Vertex AI in Firebase SDK. | +| [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | Options when initializing the Vertex AI in Firebase SDK. | +| [VideoMetadata](./vertexai.videometadata.md#videometadata_interface) | Describes the input video content. | +| [WebAttribution](./vertexai.webattribution.md#webattribution_interface) | | + +## Variables + +| Variable | Description | +| --- | --- | +| [POSSIBLE\_ROLES](./vertexai.md#possible_roles) | Possible roles. | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [Part](./vertexai.md#part) | Content part - includes text, image/video, or function call/response part types. | +| [Role](./vertexai.md#role) | Role is the producer of the content. | +| [Tool](./vertexai.md#tool) | Defines a tool that model can call to access external knowledge. | +| [TypedSchema](./vertexai.md#typedschema) | A type that includes all specific Schema types. | + +## function(app, ...) + +### getVertexAI(app, options) {:#getvertexai_04094cf} + +Returns a [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance for the given app. + +Signature: + +```typescript +export declare function getVertexAI(app?: FirebaseApp, options?: VertexAIOptions): VertexAI; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) to use. | +| options | [VertexAIOptions](./vertexai.vertexaioptions.md#vertexaioptions_interface) | | + +Returns: + +[VertexAI](./vertexai.vertexai.md#vertexai_interface) + +## function(vertexAI, ...) + +### getGenerativeModel(vertexAI, modelParams, requestOptions) {:#getgenerativemodel_e3037c9} + +Returns a [GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) class with methods for inference and other functionality. + +Signature: + +```typescript +export declare function getGenerativeModel(vertexAI: VertexAI, modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vertexAI | [VertexAI](./vertexai.vertexai.md#vertexai_interface) | | +| modelParams | [ModelParams](./vertexai.modelparams.md#modelparams_interface) | | +| requestOptions | [RequestOptions](./vertexai.requestoptions.md#requestoptions_interface) | | + +Returns: + +[GenerativeModel](./vertexai.generativemodel.md#generativemodel_class) + +## POSSIBLE\_ROLES + +Possible roles. + +Signature: + +```typescript +POSSIBLE_ROLES: readonly ["user", "model", "function", "system"] +``` + +## Part + +Content part - includes text, image/video, or function call/response part types. + +Signature: + +```typescript +export declare type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart; +``` + +## Role + +Role is the producer of the content. + +Signature: + +```typescript +export declare type Role = (typeof POSSIBLE_ROLES)[number]; +``` + +## Tool + +Defines a tool that model can call to access external knowledge. + +Signature: + +```typescript +export declare type Tool = FunctionDeclarationsTool; +``` + +## TypedSchema + +A type that includes all specific Schema types. + +Signature: + +```typescript +export declare type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema; +``` + +## BlockReason + +Reason that a prompt was blocked. + +Signature: + +```typescript +export declare enum BlockReason +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| OTHER | "OTHER" | | +| SAFETY | "SAFETY" | | + +## FinishReason + +Reason that a candidate finished. + +Signature: + +```typescript +export declare enum FinishReason +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| MAX\_TOKENS | "MAX_TOKENS" | | +| OTHER | "OTHER" | | +| RECITATION | "RECITATION" | | +| SAFETY | "SAFETY" | | +| STOP | "STOP" | | + +## FunctionCallingMode + + +Signature: + +```typescript +export declare enum FunctionCallingMode +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ANY | "ANY" | | +| AUTO | "AUTO" | | +| NONE | "NONE" | | + +## HarmBlockMethod + + +Signature: + +```typescript +export declare enum HarmBlockMethod +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| PROBABILITY | "PROBABILITY" | | +| SEVERITY | "SEVERITY" | | + +## HarmBlockThreshold + +Threshold above which a prompt or candidate will be blocked. + +Signature: + +```typescript +export declare enum HarmBlockThreshold +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| BLOCK\_LOW\_AND\_ABOVE | "BLOCK_LOW_AND_ABOVE" | | +| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE" | | +| BLOCK\_NONE | "BLOCK_NONE" | | +| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH" | | + +## HarmCategory + +Harm categories that would cause prompts or candidates to be blocked. + +Signature: + +```typescript +export declare enum HarmCategory +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT" | | +| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT" | | +| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH" | | +| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | | + +## HarmProbability + +Probability that a prompt or candidate matches a harm category. + +Signature: + +```typescript +export declare enum HarmProbability +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HIGH | "HIGH" | | +| LOW | "LOW" | | +| MEDIUM | "MEDIUM" | | +| NEGLIGIBLE | "NEGLIGIBLE" | | + +## HarmSeverity + +Harm severity levels. + +Signature: + +```typescript +export declare enum HarmSeverity +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| HARM\_SEVERITY\_HIGH | "HARM_SEVERITY_HIGH" | | +| HARM\_SEVERITY\_LOW | "HARM_SEVERITY_LOW" | | +| HARM\_SEVERITY\_MEDIUM | "HARM_SEVERITY_MEDIUM" | | +| HARM\_SEVERITY\_NEGLIGIBLE | "HARM_SEVERITY_NEGLIGIBLE" | | + +## SchemaType + +Contains the list of OpenAPI data types as defined by the [OpenAPI specification](https://swagger.io/docs/specification/data-models/data-types/) + +Signature: + +```typescript +export declare enum SchemaType +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| ARRAY | "array" | Array type. | +| BOOLEAN | "boolean" | Boolean type. | +| INTEGER | "integer" | Integer type. | +| NUMBER | "number" | Number type. | +| OBJECT | "object" | Object type. | +| STRING | "string" | String type. | + +## VertexAIErrorCode + +Standardized error codes that [VertexAIError](./vertexai.vertexaierror.md#vertexaierror_class) can have. + +Signature: + +```typescript +export declare const enum VertexAIErrorCode +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| API\_NOT\_ENABLED | "api-not-enabled" | An error due to the Firebase API not being enabled in the Console. | +| ERROR | "error" | A generic error occurred. | +| FETCH\_ERROR | "fetch-error" | An error occurred while performing a fetch. | +| INVALID\_CONTENT | "invalid-content" | An error associated with a Content object. | +| INVALID\_SCHEMA | "invalid-schema" | An error due to invalid Schema input. | +| NO\_API\_KEY | "no-api-key" | An error occurred due to a missing Firebase API key. | +| NO\_MODEL | "no-model" | An error occurred due to a model name not being specified during initialization. | +| NO\_PROJECT\_ID | "no-project-id" | An error occurred due to a missing project ID. | +| PARSE\_FAILED | "parse-failed" | An error occurred while parsing. | +| REQUEST\_ERROR | "request-error" | An error occurred in a request. | +| RESPONSE\_ERROR | "response-error" | An error occurred in a response. | + diff --git a/docs-devsite/vertexai-preview.modelparams.md b/docs-devsite/vertexai.modelparams.md similarity index 54% rename from docs-devsite/vertexai-preview.modelparams.md rename to docs-devsite/vertexai.modelparams.md index 34d68f86714..590bc14e435 100644 --- a/docs-devsite/vertexai-preview.modelparams.md +++ b/docs-devsite/vertexai.modelparams.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # ModelParams interface -Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). Signature: ```typescript export interface ModelParams extends BaseParams ``` -Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [model](./vertexai-preview.modelparams.md#modelparamsmodel) | string | | -| [systemInstruction](./vertexai-preview.modelparams.md#modelparamssysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.modelparams.md#modelparamstoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.modelparams.md#modelparamstools) | [Tool](./vertexai-preview.md#tool)\[\] | | +| [model](./vertexai.modelparams.md#modelparamsmodel) | string | | +| [systemInstruction](./vertexai.modelparams.md#modelparamssysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.modelparams.md#modelparamstoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.modelparams.md#modelparamstools) | [Tool](./vertexai.md#tool)\[\] | | ## ModelParams.model diff --git a/docs-devsite/vertexai.numberschema.md b/docs-devsite/vertexai.numberschema.md new file mode 100644 index 00000000000..8fdd9374652 --- /dev/null +++ b/docs-devsite/vertexai.numberschema.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# NumberSchema class +Schema class for "number" types. + +Signature: + +```typescript +export declare class NumberSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.numberschema.md#numberschemaconstructor) | | Constructs a new instance of the NumberSchema class | + +## NumberSchema.(constructor) + +Constructs a new instance of the `NumberSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + diff --git a/docs-devsite/vertexai.objectschema.md b/docs-devsite/vertexai.objectschema.md new file mode 100644 index 00000000000..8731960b220 --- /dev/null +++ b/docs-devsite/vertexai.objectschema.md @@ -0,0 +1,71 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ObjectSchema class +Schema class for "object" types. The `properties` param must be a map of `Schema` objects. + +Signature: + +```typescript +export declare class ObjectSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams, properties, optionalProperties)](./vertexai.objectschema.md#objectschemaconstructor) | | Constructs a new instance of the ObjectSchema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [optionalProperties](./vertexai.objectschema.md#objectschemaoptionalproperties) | | string\[\] | | +| [properties](./vertexai.objectschema.md#objectschemaproperties) | | { \[k: string\]: [TypedSchema](./vertexai.md#typedschema); } | | + +## ObjectSchema.(constructor) + +Constructs a new instance of the `ObjectSchema` class + +Signature: + +```typescript +constructor(schemaParams: SchemaParams, properties: { + [k: string]: TypedSchema; + }, optionalProperties?: string[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| properties | { \[k: string\]: [TypedSchema](./vertexai.md#typedschema); } | | +| optionalProperties | string\[\] | | + +## ObjectSchema.optionalProperties + +Signature: + +```typescript +optionalProperties: string[]; +``` + +## ObjectSchema.properties + +Signature: + +```typescript +properties: { + [k: string]: TypedSchema; + }; +``` diff --git a/docs-devsite/vertexai.objectschemainterface.md b/docs-devsite/vertexai.objectschemainterface.md new file mode 100644 index 00000000000..6a4e052d183 --- /dev/null +++ b/docs-devsite/vertexai.objectschemainterface.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ObjectSchemaInterface interface +Interface for [ObjectSchema](./vertexai.objectschema.md#objectschema_class) class. + +Signature: + +```typescript +export interface ObjectSchemaInterface extends SchemaInterface +``` +Extends: [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [optionalProperties](./vertexai.objectschemainterface.md#objectschemainterfaceoptionalproperties) | string\[\] | | +| [type](./vertexai.objectschemainterface.md#objectschemainterfacetype) | [SchemaType.OBJECT](./vertexai.md#schematypeobject_enummember) | | + +## ObjectSchemaInterface.optionalProperties + +Signature: + +```typescript +optionalProperties?: string[]; +``` + +## ObjectSchemaInterface.type + +Signature: + +```typescript +type: SchemaType.OBJECT; +``` diff --git a/docs-devsite/vertexai-preview.promptfeedback.md b/docs-devsite/vertexai.promptfeedback.md similarity index 66% rename from docs-devsite/vertexai-preview.promptfeedback.md rename to docs-devsite/vertexai.promptfeedback.md index cb27f10c8c3..369ef02051d 100644 --- a/docs-devsite/vertexai-preview.promptfeedback.md +++ b/docs-devsite/vertexai.promptfeedback.md @@ -22,16 +22,16 @@ export interface PromptFeedback | Property | Type | Description | | --- | --- | --- | -| [blockReason](./vertexai-preview.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./vertexai-preview.md#blockreason) | | -| [blockReasonMessage](./vertexai-preview.promptfeedback.md#promptfeedbackblockreasonmessage) | string | | -| [safetyRatings](./vertexai-preview.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./vertexai-preview.safetyrating.md#safetyrating_interface)\[\] | | +| [blockReason](./vertexai.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./vertexai.md#blockreason) | | +| [blockReasonMessage](./vertexai.promptfeedback.md#promptfeedbackblockreasonmessage) | string | | +| [safetyRatings](./vertexai.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./vertexai.safetyrating.md#safetyrating_interface)\[\] | | ## PromptFeedback.blockReason Signature: ```typescript -blockReason: BlockReason; +blockReason?: BlockReason; ``` ## PromptFeedback.blockReasonMessage diff --git a/docs-devsite/vertexai-preview.requestoptions.md b/docs-devsite/vertexai.requestoptions.md similarity index 61% rename from docs-devsite/vertexai-preview.requestoptions.md rename to docs-devsite/vertexai.requestoptions.md index 550ec44ce96..5647df804b5 100644 --- a/docs-devsite/vertexai-preview.requestoptions.md +++ b/docs-devsite/vertexai.requestoptions.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # RequestOptions interface -Params passed to [getGenerativeModel()](./vertexai-preview.md#getgenerativemodel_e3037c9). +Params passed to [getGenerativeModel()](./vertexai.md#getgenerativemodel_e3037c9). Signature: @@ -22,8 +22,8 @@ export interface RequestOptions | Property | Type | Description | | --- | --- | --- | -| [baseUrl](./vertexai-preview.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebaseml.googleapis.com | -| [timeout](./vertexai-preview.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. | +| [baseUrl](./vertexai.requestoptions.md#requestoptionsbaseurl) | string | Base url for endpoint. Defaults to https://firebaseml.googleapis.com | +| [timeout](./vertexai.requestoptions.md#requestoptionstimeout) | number | Request timeout in milliseconds. Defaults to 180 seconds (180000ms). | ## RequestOptions.baseUrl @@ -37,7 +37,7 @@ baseUrl?: string; ## RequestOptions.timeout -Request timeout in milliseconds. +Request timeout in milliseconds. Defaults to 180 seconds (180000ms). Signature: diff --git a/docs-devsite/vertexai-preview.retrievedcontextattribution.md b/docs-devsite/vertexai.retrievedcontextattribution.md similarity index 76% rename from docs-devsite/vertexai-preview.retrievedcontextattribution.md rename to docs-devsite/vertexai.retrievedcontextattribution.md index 0a121cdc004..e36bfacb3ec 100644 --- a/docs-devsite/vertexai-preview.retrievedcontextattribution.md +++ b/docs-devsite/vertexai.retrievedcontextattribution.md @@ -21,8 +21,8 @@ export interface RetrievedContextAttribution | Property | Type | Description | | --- | --- | --- | -| [title](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattributiontitle) | string | | -| [uri](./vertexai-preview.retrievedcontextattribution.md#retrievedcontextattributionuri) | string | | +| [title](./vertexai.retrievedcontextattribution.md#retrievedcontextattributiontitle) | string | | +| [uri](./vertexai.retrievedcontextattribution.md#retrievedcontextattributionuri) | string | | ## RetrievedContextAttribution.title diff --git a/docs-devsite/vertexai-preview.safetyrating.md b/docs-devsite/vertexai.safetyrating.md similarity index 55% rename from docs-devsite/vertexai-preview.safetyrating.md rename to docs-devsite/vertexai.safetyrating.md index 65b1bc8fb42..b5f204bef2c 100644 --- a/docs-devsite/vertexai-preview.safetyrating.md +++ b/docs-devsite/vertexai.safetyrating.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # SafetyRating interface -A safety rating associated with a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface) +A safety rating associated with a [GenerateContentCandidate](./vertexai.generatecontentcandidate.md#generatecontentcandidate_interface) Signature: @@ -22,12 +22,12 @@ export interface SafetyRating | Property | Type | Description | | --- | --- | --- | -| [blocked](./vertexai-preview.safetyrating.md#safetyratingblocked) | boolean | | -| [category](./vertexai-preview.safetyrating.md#safetyratingcategory) | [HarmCategory](./vertexai-preview.md#harmcategory) | | -| [probability](./vertexai-preview.safetyrating.md#safetyratingprobability) | [HarmProbability](./vertexai-preview.md#harmprobability) | | -| [probabilityScore](./vertexai-preview.safetyrating.md#safetyratingprobabilityscore) | number | | -| [severity](./vertexai-preview.safetyrating.md#safetyratingseverity) | [HarmSeverity](./vertexai-preview.md#harmseverity) | | -| [severityScore](./vertexai-preview.safetyrating.md#safetyratingseverityscore) | number | | +| [blocked](./vertexai.safetyrating.md#safetyratingblocked) | boolean | | +| [category](./vertexai.safetyrating.md#safetyratingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | +| [probability](./vertexai.safetyrating.md#safetyratingprobability) | [HarmProbability](./vertexai.md#harmprobability) | | +| [probabilityScore](./vertexai.safetyrating.md#safetyratingprobabilityscore) | number | | +| [severity](./vertexai.safetyrating.md#safetyratingseverity) | [HarmSeverity](./vertexai.md#harmseverity) | | +| [severityScore](./vertexai.safetyrating.md#safetyratingseverityscore) | number | | ## SafetyRating.blocked diff --git a/docs-devsite/vertexai-preview.safetysetting.md b/docs-devsite/vertexai.safetysetting.md similarity index 66% rename from docs-devsite/vertexai-preview.safetysetting.md rename to docs-devsite/vertexai.safetysetting.md index 78678315805..6aad50963cd 100644 --- a/docs-devsite/vertexai-preview.safetysetting.md +++ b/docs-devsite/vertexai.safetysetting.md @@ -22,9 +22,9 @@ export interface SafetySetting | Property | Type | Description | | --- | --- | --- | -| [category](./vertexai-preview.safetysetting.md#safetysettingcategory) | [HarmCategory](./vertexai-preview.md#harmcategory) | | -| [method](./vertexai-preview.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./vertexai-preview.md#harmblockmethod) | | -| [threshold](./vertexai-preview.safetysetting.md#safetysettingthreshold) | [HarmBlockThreshold](./vertexai-preview.md#harmblockthreshold) | | +| [category](./vertexai.safetysetting.md#safetysettingcategory) | [HarmCategory](./vertexai.md#harmcategory) | | +| [method](./vertexai.safetysetting.md#safetysettingmethod) | [HarmBlockMethod](./vertexai.md#harmblockmethod) | | +| [threshold](./vertexai.safetysetting.md#safetysettingthreshold) | [HarmBlockThreshold](./vertexai.md#harmblockthreshold) | | ## SafetySetting.category diff --git a/docs-devsite/vertexai.schema.md b/docs-devsite/vertexai.schema.md new file mode 100644 index 00000000000..f4a36c3c506 --- /dev/null +++ b/docs-devsite/vertexai.schema.md @@ -0,0 +1,250 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Schema class +Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with `JSON.stringify()` into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) + +Signature: + +```typescript +export declare abstract class Schema implements SchemaInterface +``` +Implements: [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams)](./vertexai.schema.md#schemaconstructor) | | Constructs a new instance of the Schema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [description](./vertexai.schema.md#schemadescription) | | string | Optional. The description of the property. | +| [example](./vertexai.schema.md#schemaexample) | | unknown | Optional. The example of the property. | +| [format](./vertexai.schema.md#schemaformat) | | string | Optional. The format of the property. Supported formats:
  • for NUMBER type: "float", "double"
  • for INTEGER type: "int32", "int64"
  • for STRING type: "email", "byte", etc
| +| [nullable](./vertexai.schema.md#schemanullable) | | boolean | Optional. Whether the property is nullable. Defaults to false. | +| [type](./vertexai.schema.md#schematype) | | [SchemaType](./vertexai.md#schematype) | Optional. The type of the property. [SchemaType](./vertexai.md#schematype). | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [array(arrayParams)](./vertexai.schema.md#schemaarray) | static | | +| [boolean(booleanParams)](./vertexai.schema.md#schemaboolean) | static | | +| [enumString(stringParams)](./vertexai.schema.md#schemaenumstring) | static | | +| [integer(integerParams)](./vertexai.schema.md#schemainteger) | static | | +| [number(numberParams)](./vertexai.schema.md#schemanumber) | static | | +| [object(objectParams)](./vertexai.schema.md#schemaobject) | static | | +| [string(stringParams)](./vertexai.schema.md#schemastring) | static | | + +## Schema.(constructor) + +Constructs a new instance of the `Schema` class + +Signature: + +```typescript +constructor(schemaParams: SchemaInterface); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface) | | + +## Schema.description + +Optional. The description of the property. + +Signature: + +```typescript +description?: string; +``` + +## Schema.example + +Optional. The example of the property. + +Signature: + +```typescript +example?: unknown; +``` + +## Schema.format + +Optional. The format of the property. Supported formats:
  • for NUMBER type: "float", "double"
  • for INTEGER type: "int32", "int64"
  • for STRING type: "email", "byte", etc
+ +Signature: + +```typescript +format?: string; +``` + +## Schema.nullable + +Optional. Whether the property is nullable. Defaults to false. + +Signature: + +```typescript +nullable: boolean; +``` + +## Schema.type + +Optional. The type of the property. [SchemaType](./vertexai.md#schematype). + +Signature: + +```typescript +type: SchemaType; +``` + +## Schema.array() + +Signature: + +```typescript +static array(arrayParams: SchemaParams & { + items: Schema; + }): ArraySchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| arrayParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { items: [Schema](./vertexai.schema.md#schema_class); } | | + +Returns: + +[ArraySchema](./vertexai.arrayschema.md#arrayschema_class) + +## Schema.boolean() + +Signature: + +```typescript +static boolean(booleanParams?: SchemaParams): BooleanSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| booleanParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[BooleanSchema](./vertexai.booleanschema.md#booleanschema_class) + +## Schema.enumString() + +Signature: + +```typescript +static enumString(stringParams: SchemaParams & { + enum: string[]; + }): StringSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| stringParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { enum: string\[\]; } | | + +Returns: + +[StringSchema](./vertexai.stringschema.md#stringschema_class) + +## Schema.integer() + +Signature: + +```typescript +static integer(integerParams?: SchemaParams): IntegerSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| integerParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[IntegerSchema](./vertexai.integerschema.md#integerschema_class) + +## Schema.number() + +Signature: + +```typescript +static number(numberParams?: SchemaParams): NumberSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| numberParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[NumberSchema](./vertexai.numberschema.md#numberschema_class) + +## Schema.object() + +Signature: + +```typescript +static object(objectParams: SchemaParams & { + properties: { + [k: string]: Schema; + }; + optionalProperties?: string[]; + }): ObjectSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| objectParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) & { properties: { \[k: string\]: [Schema](./vertexai.schema.md#schema_class); }; optionalProperties?: string\[\]; } | | + +Returns: + +[ObjectSchema](./vertexai.objectschema.md#objectschema_class) + +## Schema.string() + +Signature: + +```typescript +static string(stringParams?: SchemaParams): StringSchema; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| stringParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | + +Returns: + +[StringSchema](./vertexai.stringschema.md#stringschema_class) + diff --git a/docs-devsite/vertexai.schemainterface.md b/docs-devsite/vertexai.schemainterface.md new file mode 100644 index 00000000000..3992c9e5116 --- /dev/null +++ b/docs-devsite/vertexai.schemainterface.md @@ -0,0 +1,36 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaInterface interface +Interface for [Schema](./vertexai.schema.md#schema_class) class. + +Signature: + +```typescript +export interface SchemaInterface extends SchemaShared +``` +Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface)> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [type](./vertexai.schemainterface.md#schemainterfacetype) | [SchemaType](./vertexai.md#schematype) | The type of the property. [SchemaType](./vertexai.md#schematype). | + +## SchemaInterface.type + +The type of the property. [SchemaType](./vertexai.md#schematype). + +Signature: + +```typescript +type: SchemaType; +``` diff --git a/docs-devsite/vertexai.schemaparams.md b/docs-devsite/vertexai.schemaparams.md new file mode 100644 index 00000000000..3c6d9f385fd --- /dev/null +++ b/docs-devsite/vertexai.schemaparams.md @@ -0,0 +1,21 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaParams interface +Params passed to [Schema](./vertexai.schema.md#schema_class) static methods to create specific [Schema](./vertexai.schema.md#schema_class) classes. + +Signature: + +```typescript +export interface SchemaParams extends SchemaShared +``` +Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaInterface](./vertexai.schemainterface.md#schemainterface_interface)> + diff --git a/docs-devsite/vertexai.schemarequest.md b/docs-devsite/vertexai.schemarequest.md new file mode 100644 index 00000000000..f12259b1608 --- /dev/null +++ b/docs-devsite/vertexai.schemarequest.md @@ -0,0 +1,47 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaRequest interface +Final format for [Schema](./vertexai.schema.md#schema_class) params passed to backend requests. + +Signature: + +```typescript +export interface SchemaRequest extends SchemaShared +``` +Extends: [SchemaShared](./vertexai.schemashared.md#schemashared_interface)<[SchemaRequest](./vertexai.schemarequest.md#schemarequest_interface)> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [required](./vertexai.schemarequest.md#schemarequestrequired) | string\[\] | Optional. Array of required property. | +| [type](./vertexai.schemarequest.md#schemarequesttype) | [SchemaType](./vertexai.md#schematype) | The type of the property. [SchemaType](./vertexai.md#schematype). | + +## SchemaRequest.required + +Optional. Array of required property. + +Signature: + +```typescript +required?: string[]; +``` + +## SchemaRequest.type + +The type of the property. [SchemaType](./vertexai.md#schematype). + +Signature: + +```typescript +type: SchemaType; +``` diff --git a/docs-devsite/vertexai.schemashared.md b/docs-devsite/vertexai.schemashared.md new file mode 100644 index 00000000000..50cc6464ecf --- /dev/null +++ b/docs-devsite/vertexai.schemashared.md @@ -0,0 +1,103 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SchemaShared interface +Basic [Schema](./vertexai.schema.md#schema_class) properties shared across several Schema-related types. + +Signature: + +```typescript +export interface SchemaShared +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [description](./vertexai.schemashared.md#schemashareddescription) | string | Optional. The description of the property. | +| [enum](./vertexai.schemashared.md#schemasharedenum) | string\[\] | Optional. The enum of the property. | +| [example](./vertexai.schemashared.md#schemasharedexample) | unknown | Optional. The example of the property. | +| [format](./vertexai.schemashared.md#schemasharedformat) | string | Optional. The format of the property. | +| [items](./vertexai.schemashared.md#schemashareditems) | T | Optional. The items of the property. | +| [nullable](./vertexai.schemashared.md#schemasharednullable) | boolean | Optional. Whether the property is nullable. | +| [properties](./vertexai.schemashared.md#schemasharedproperties) | { \[k: string\]: T; } | Optional. Map of Schema objects. | + +## SchemaShared.description + +Optional. The description of the property. + +Signature: + +```typescript +description?: string; +``` + +## SchemaShared.enum + +Optional. The enum of the property. + +Signature: + +```typescript +enum?: string[]; +``` + +## SchemaShared.example + +Optional. The example of the property. + +Signature: + +```typescript +example?: unknown; +``` + +## SchemaShared.format + +Optional. The format of the property. + +Signature: + +```typescript +format?: string; +``` + +## SchemaShared.items + +Optional. The items of the property. + +Signature: + +```typescript +items?: T; +``` + +## SchemaShared.nullable + +Optional. Whether the property is nullable. + +Signature: + +```typescript +nullable?: boolean; +``` + +## SchemaShared.properties + +Optional. Map of `Schema` objects. + +Signature: + +```typescript +properties?: { + [k: string]: T; + }; +``` diff --git a/docs-devsite/vertexai-preview.segment.md b/docs-devsite/vertexai.segment.md similarity index 75% rename from docs-devsite/vertexai-preview.segment.md rename to docs-devsite/vertexai.segment.md index c64bc3ffcda..db61f00a149 100644 --- a/docs-devsite/vertexai-preview.segment.md +++ b/docs-devsite/vertexai.segment.md @@ -21,9 +21,9 @@ export interface Segment | Property | Type | Description | | --- | --- | --- | -| [endIndex](./vertexai-preview.segment.md#segmentendindex) | number | | -| [partIndex](./vertexai-preview.segment.md#segmentpartindex) | number | | -| [startIndex](./vertexai-preview.segment.md#segmentstartindex) | number | | +| [endIndex](./vertexai.segment.md#segmentendindex) | number | | +| [partIndex](./vertexai.segment.md#segmentpartindex) | number | | +| [startIndex](./vertexai.segment.md#segmentstartindex) | number | | ## Segment.endIndex diff --git a/docs-devsite/vertexai-preview.startchatparams.md b/docs-devsite/vertexai.startchatparams.md similarity index 51% rename from docs-devsite/vertexai-preview.startchatparams.md rename to docs-devsite/vertexai.startchatparams.md index f422f7a1ff0..e07bbd91d82 100644 --- a/docs-devsite/vertexai-preview.startchatparams.md +++ b/docs-devsite/vertexai.startchatparams.md @@ -10,23 +10,23 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # StartChatParams interface -Params for [GenerativeModel.startChat()](./vertexai-preview.generativemodel.md#generativemodelstartchat). +Params for [GenerativeModel.startChat()](./vertexai.generativemodel.md#generativemodelstartchat). Signature: ```typescript export interface StartChatParams extends BaseParams ``` -Extends: [BaseParams](./vertexai-preview.baseparams.md#baseparams_interface) +Extends: [BaseParams](./vertexai.baseparams.md#baseparams_interface) ## Properties | Property | Type | Description | | --- | --- | --- | -| [history](./vertexai-preview.startchatparams.md#startchatparamshistory) | [Content](./vertexai-preview.content.md#content_interface)\[\] | | -| [systemInstruction](./vertexai-preview.startchatparams.md#startchatparamssysteminstruction) | string \| [Part](./vertexai-preview.md#part) \| [Content](./vertexai-preview.content.md#content_interface) | | -| [toolConfig](./vertexai-preview.startchatparams.md#startchatparamstoolconfig) | [ToolConfig](./vertexai-preview.toolconfig.md#toolconfig_interface) | | -| [tools](./vertexai-preview.startchatparams.md#startchatparamstools) | [Tool](./vertexai-preview.md#tool)\[\] | | +| [history](./vertexai.startchatparams.md#startchatparamshistory) | [Content](./vertexai.content.md#content_interface)\[\] | | +| [systemInstruction](./vertexai.startchatparams.md#startchatparamssysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | | +| [toolConfig](./vertexai.startchatparams.md#startchatparamstoolconfig) | [ToolConfig](./vertexai.toolconfig.md#toolconfig_interface) | | +| [tools](./vertexai.startchatparams.md#startchatparamstools) | [Tool](./vertexai.md#tool)\[\] | | ## StartChatParams.history diff --git a/docs-devsite/vertexai.stringschema.md b/docs-devsite/vertexai.stringschema.md new file mode 100644 index 00000000000..bfafe0fe9df --- /dev/null +++ b/docs-devsite/vertexai.stringschema.md @@ -0,0 +1,57 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# StringSchema class +Schema class for "string" types. Can be used with or without enum values. + +Signature: + +```typescript +export declare class StringSchema extends Schema +``` +Extends: [Schema](./vertexai.schema.md#schema_class) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(schemaParams, enumValues)](./vertexai.stringschema.md#stringschemaconstructor) | | Constructs a new instance of the StringSchema class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [enum](./vertexai.stringschema.md#stringschemaenum) | | string\[\] | | + +## StringSchema.(constructor) + +Constructs a new instance of the `StringSchema` class + +Signature: + +```typescript +constructor(schemaParams?: SchemaParams, enumValues?: string[]); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| schemaParams | [SchemaParams](./vertexai.schemaparams.md#schemaparams_interface) | | +| enumValues | string\[\] | | + +## StringSchema.enum + +Signature: + +```typescript +enum?: string[]; +``` diff --git a/docs-devsite/vertexai-preview.textpart.md b/docs-devsite/vertexai.textpart.md similarity index 72% rename from docs-devsite/vertexai-preview.textpart.md rename to docs-devsite/vertexai.textpart.md index 206168180b2..afee40a369d 100644 --- a/docs-devsite/vertexai-preview.textpart.md +++ b/docs-devsite/vertexai.textpart.md @@ -22,10 +22,10 @@ export interface TextPart | Property | Type | Description | | --- | --- | --- | -| [functionCall](./vertexai-preview.textpart.md#textpartfunctioncall) | never | | -| [functionResponse](./vertexai-preview.textpart.md#textpartfunctionresponse) | never | | -| [inlineData](./vertexai-preview.textpart.md#textpartinlinedata) | never | | -| [text](./vertexai-preview.textpart.md#textparttext) | string | | +| [functionCall](./vertexai.textpart.md#textpartfunctioncall) | never | | +| [functionResponse](./vertexai.textpart.md#textpartfunctionresponse) | never | | +| [inlineData](./vertexai.textpart.md#textpartinlinedata) | never | | +| [text](./vertexai.textpart.md#textparttext) | string | | ## TextPart.functionCall diff --git a/docs-devsite/vertexai-preview.toolconfig.md b/docs-devsite/vertexai.toolconfig.md similarity index 71% rename from docs-devsite/vertexai-preview.toolconfig.md rename to docs-devsite/vertexai.toolconfig.md index 4278eef509b..30c62c17c01 100644 --- a/docs-devsite/vertexai-preview.toolconfig.md +++ b/docs-devsite/vertexai.toolconfig.md @@ -22,12 +22,12 @@ export interface ToolConfig | Property | Type | Description | | --- | --- | --- | -| [functionCallingConfig](./vertexai-preview.toolconfig.md#toolconfigfunctioncallingconfig) | [FunctionCallingConfig](./vertexai-preview.functioncallingconfig.md#functioncallingconfig_interface) | | +| [functionCallingConfig](./vertexai.toolconfig.md#toolconfigfunctioncallingconfig) | [FunctionCallingConfig](./vertexai.functioncallingconfig.md#functioncallingconfig_interface) | | ## ToolConfig.functionCallingConfig Signature: ```typescript -functionCallingConfig: FunctionCallingConfig; +functionCallingConfig?: FunctionCallingConfig; ``` diff --git a/docs-devsite/vertexai-preview.usagemetadata.md b/docs-devsite/vertexai.usagemetadata.md similarity index 63% rename from docs-devsite/vertexai-preview.usagemetadata.md rename to docs-devsite/vertexai.usagemetadata.md index 2829c9dbd5d..d254f34335f 100644 --- a/docs-devsite/vertexai-preview.usagemetadata.md +++ b/docs-devsite/vertexai.usagemetadata.md @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk {% endcomment %} # UsageMetadata interface -Usage metadata about a [GenerateContentResponse](./vertexai-preview.generatecontentresponse.md#generatecontentresponse_interface). +Usage metadata about a [GenerateContentResponse](./vertexai.generatecontentresponse.md#generatecontentresponse_interface). Signature: @@ -22,9 +22,9 @@ export interface UsageMetadata | Property | Type | Description | | --- | --- | --- | -| [candidatesTokenCount](./vertexai-preview.usagemetadata.md#usagemetadatacandidatestokencount) | number | | -| [promptTokenCount](./vertexai-preview.usagemetadata.md#usagemetadataprompttokencount) | number | | -| [totalTokenCount](./vertexai-preview.usagemetadata.md#usagemetadatatotaltokencount) | number | | +| [candidatesTokenCount](./vertexai.usagemetadata.md#usagemetadatacandidatestokencount) | number | | +| [promptTokenCount](./vertexai.usagemetadata.md#usagemetadataprompttokencount) | number | | +| [totalTokenCount](./vertexai.usagemetadata.md#usagemetadatatotaltokencount) | number | | ## UsageMetadata.candidatesTokenCount diff --git a/docs-devsite/vertexai-preview.vertexai.md b/docs-devsite/vertexai.vertexai.md similarity index 62% rename from docs-devsite/vertexai-preview.vertexai.md rename to docs-devsite/vertexai.vertexai.md index 46c13416370..4797bf8bada 100644 --- a/docs-devsite/vertexai-preview.vertexai.md +++ b/docs-devsite/vertexai.vertexai.md @@ -22,12 +22,12 @@ export interface VertexAI | Property | Type | Description | | --- | --- | --- | -| [app](./vertexai-preview.vertexai.md#vertexaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance is associated with. | -| [location](./vertexai-preview.vertexai.md#vertexailocation) | string | | +| [app](./vertexai.vertexai.md#vertexaiapp) | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. | +| [location](./vertexai.vertexai.md#vertexailocation) | string | | ## VertexAI.app -The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai-preview.vertexai.md#vertexai_interface) instance is associated with. +The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) this [VertexAI](./vertexai.vertexai.md#vertexai_interface) instance is associated with. Signature: diff --git a/docs-devsite/vertexai-preview.vertexaierror.md b/docs-devsite/vertexai.vertexaierror.md similarity index 57% rename from docs-devsite/vertexai-preview.vertexaierror.md rename to docs-devsite/vertexai.vertexaierror.md index 8ad434d0988..86532ac6018 100644 --- a/docs-devsite/vertexai-preview.vertexaierror.md +++ b/docs-devsite/vertexai.vertexaierror.md @@ -23,15 +23,14 @@ export declare class VertexAIError extends FirebaseError | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(code, message, customErrorData)](./vertexai-preview.vertexaierror.md#vertexaierrorconstructor) | | Constructs a new instance of the VertexAIError class. | +| [(constructor)(code, message, customErrorData)](./vertexai.vertexaierror.md#vertexaierrorconstructor) | | Constructs a new instance of the VertexAIError class. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [code](./vertexai-preview.vertexaierror.md#vertexaierrorcode) | | [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | | -| [customErrorData](./vertexai-preview.vertexaierror.md#vertexaierrorcustomerrordata) | | [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) \| undefined | | -| [message](./vertexai-preview.vertexaierror.md#vertexaierrormessage) | | string | | +| [code](./vertexai.vertexaierror.md#vertexaierrorcode) | | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | | +| [customErrorData](./vertexai.vertexaierror.md#vertexaierrorcustomerrordata) | | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | | ## VertexAIError.(constructor) @@ -47,9 +46,9 @@ constructor(code: VertexAIErrorCode, message: string, customErrorData?: CustomEr | Parameter | Type | Description | | --- | --- | --- | -| code | [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode) | The error code from [VertexAIErrorCode](./vertexai-preview.md#vertexaierrorcode). | +| code | [VertexAIErrorCode](./vertexai.md#vertexaierrorcode) | The error code from [VertexAIErrorCode](./vertexai.md#vertexaierrorcode). | | message | string | A human-readable message describing the error. | -| customErrorData | [CustomErrorData](./vertexai-preview.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | +| customErrorData | [CustomErrorData](./vertexai.customerrordata.md#customerrordata_interface) \| undefined | Optional error data. | ## VertexAIError.code @@ -66,11 +65,3 @@ readonly code: VertexAIErrorCode; ```typescript readonly customErrorData?: CustomErrorData | undefined; ``` - -## VertexAIError.message - -Signature: - -```typescript -readonly message: string; -``` diff --git a/docs-devsite/vertexai-preview.vertexaioptions.md b/docs-devsite/vertexai.vertexaioptions.md similarity index 87% rename from docs-devsite/vertexai-preview.vertexaioptions.md rename to docs-devsite/vertexai.vertexaioptions.md index 4b42406eb95..e15b525bfed 100644 --- a/docs-devsite/vertexai-preview.vertexaioptions.md +++ b/docs-devsite/vertexai.vertexaioptions.md @@ -22,7 +22,7 @@ export interface VertexAIOptions | Property | Type | Description | | --- | --- | --- | -| [location](./vertexai-preview.vertexaioptions.md#vertexaioptionslocation) | string | | +| [location](./vertexai.vertexaioptions.md#vertexaioptionslocation) | string | | ## VertexAIOptions.location diff --git a/docs-devsite/vertexai-preview.videometadata.md b/docs-devsite/vertexai.videometadata.md similarity index 66% rename from docs-devsite/vertexai-preview.videometadata.md rename to docs-devsite/vertexai.videometadata.md index 04d8883bae9..b4f872c4e3d 100644 --- a/docs-devsite/vertexai-preview.videometadata.md +++ b/docs-devsite/vertexai.videometadata.md @@ -22,8 +22,8 @@ export interface VideoMetadata | Property | Type | Description | | --- | --- | --- | -| [endOffset](./vertexai-preview.videometadata.md#videometadataendoffset) | string | The end offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | -| [startOffset](./vertexai-preview.videometadata.md#videometadatastartoffset) | string | The start offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | +| [endOffset](./vertexai.videometadata.md#videometadataendoffset) | string | The end offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | +| [startOffset](./vertexai.videometadata.md#videometadatastartoffset) | string | The start offset of the video in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. | ## VideoMetadata.endOffset diff --git a/docs-devsite/vertexai-preview.webattribution.md b/docs-devsite/vertexai.webattribution.md similarity index 79% rename from docs-devsite/vertexai-preview.webattribution.md rename to docs-devsite/vertexai.webattribution.md index 5db6f94b82e..bb4fecf874d 100644 --- a/docs-devsite/vertexai-preview.webattribution.md +++ b/docs-devsite/vertexai.webattribution.md @@ -21,8 +21,8 @@ export interface WebAttribution | Property | Type | Description | | --- | --- | --- | -| [title](./vertexai-preview.webattribution.md#webattributiontitle) | string | | -| [uri](./vertexai-preview.webattribution.md#webattributionuri) | string | | +| [title](./vertexai.webattribution.md#webattributiontitle) | string | | +| [uri](./vertexai.webattribution.md#webattributionuri) | string | | ## WebAttribution.title diff --git a/packages/vertexai/src/api.ts b/packages/vertexai/src/api.ts index 23c502895d8..42f33ed2a85 100644 --- a/packages/vertexai/src/api.ts +++ b/packages/vertexai/src/api.ts @@ -39,7 +39,7 @@ declare module '@firebase/component' { } /** - * Returns a {@link VertexAI} instance for the given app. + * Returns a {@link VertexAI} instance for the given app. * * @public * @@ -59,7 +59,7 @@ export function getVertexAI( } /** - * Returns a {@link GenerativeModel} class with methods for inference + * Returns a {@link GenerativeModel} class with methods for inference * and other functionality. * * @public diff --git a/packages/vertexai/src/errors.ts b/packages/vertexai/src/errors.ts index ad3f9b72f5a..b643a5f552d 100644 --- a/packages/vertexai/src/errors.ts +++ b/packages/vertexai/src/errors.ts @@ -28,7 +28,7 @@ export class VertexAIError extends FirebaseError { /** * Constructs a new instance of the `VertexAIError` class. * - * @param code - The error code from {@link VertexAIErrorCode}. + * @param code - The error code from {@link VertexAIErrorCode}. * @param message - A human-readable message describing the error. * @param customErrorData - Optional error data. */ diff --git a/packages/vertexai/src/methods/chat-session.ts b/packages/vertexai/src/methods/chat-session.ts index 0d1636c1cd8..bfa3f2a660f 100644 --- a/packages/vertexai/src/methods/chat-session.ts +++ b/packages/vertexai/src/methods/chat-session.ts @@ -71,7 +71,7 @@ export class ChatSession { /** * Sends a chat message and receives a non-streaming - * {@link GenerateContentResult} + * {@link GenerateContentResult} */ async sendMessage( request: string | Array @@ -125,7 +125,7 @@ export class ChatSession { /** * Sends a chat message and receives the response as a - * {@link GenerateContentStreamResult} containing an iterable stream + * {@link GenerateContentStreamResult} containing an iterable stream * and a response promise. */ async sendMessageStream( diff --git a/packages/vertexai/src/models/generative-model.ts b/packages/vertexai/src/models/generative-model.ts index 88be3ee6436..e719529967c 100644 --- a/packages/vertexai/src/models/generative-model.ts +++ b/packages/vertexai/src/models/generative-model.ts @@ -116,7 +116,7 @@ export class GenerativeModel { /** * Makes a single non-streaming call to the model - * and returns an object containing a single {@link GenerateContentResponse}. + * and returns an object containing a single {@link GenerateContentResponse}. */ async generateContent( request: GenerateContentRequest | string | Array @@ -163,7 +163,7 @@ export class GenerativeModel { } /** - * Gets a new {@link ChatSession} instance which can be used for + * Gets a new {@link ChatSession} instance which can be used for * multi-turn chats. */ startChat(startChatParams?: StartChatParams): ChatSession { diff --git a/packages/vertexai/src/public-types.ts b/packages/vertexai/src/public-types.ts index fbc5d51084d..280fee9d1cd 100644 --- a/packages/vertexai/src/public-types.ts +++ b/packages/vertexai/src/public-types.ts @@ -25,7 +25,7 @@ export * from './types'; */ export interface VertexAI { /** - * The {@link @firebase/app#FirebaseApp} this {@link VertexAI} instance is associated with. + * The {@link @firebase/app#FirebaseApp} this {@link VertexAI} instance is associated with. */ app: FirebaseApp; location: string; diff --git a/packages/vertexai/src/requests/response-helpers.ts b/packages/vertexai/src/requests/response-helpers.ts index 1b43602b0cb..efff09591a6 100644 --- a/packages/vertexai/src/requests/response-helpers.ts +++ b/packages/vertexai/src/requests/response-helpers.ts @@ -119,7 +119,7 @@ export function getText(response: GenerateContentResponse): string { } /** - * Returns {@link FunctionCall}s associated with first candidate. + * Returns {@link FunctionCall}s associated with first candidate. */ export function getFunctionCalls( response: GenerateContentResponse diff --git a/packages/vertexai/src/requests/schema-builder.ts b/packages/vertexai/src/requests/schema-builder.ts index 8a36aaa8997..3d219d58b13 100644 --- a/packages/vertexai/src/requests/schema-builder.ts +++ b/packages/vertexai/src/requests/schema-builder.ts @@ -239,7 +239,7 @@ export class ArraySchema extends Schema { /** * Schema class for "object" types. - * The `properties` param must be a map of Schema. + * The `properties` param must be a map of `Schema` objects. * @public */ export class ObjectSchema extends Schema { diff --git a/packages/vertexai/src/types/content.ts b/packages/vertexai/src/types/content.ts index ad2906671e4..abf5d29222a 100644 --- a/packages/vertexai/src/types/content.ts +++ b/packages/vertexai/src/types/content.ts @@ -82,7 +82,7 @@ export interface VideoMetadata { } /** - * Content part interface if the part represents a {@link FunctionCall}. + * Content part interface if the part represents a {@link FunctionCall}. * @public */ export interface FunctionCallPart { @@ -93,7 +93,7 @@ export interface FunctionCallPart { } /** - * Content part interface if the part represents {@link FunctionResponse}. + * Content part interface if the part represents {@link FunctionResponse}. * @public */ export interface FunctionResponsePart { @@ -104,7 +104,7 @@ export interface FunctionResponsePart { } /** - * Content part interface if the part represents {@link FileData} + * Content part interface if the part represents {@link FileData} * @public */ export interface FileDataPart { @@ -116,7 +116,7 @@ export interface FileDataPart { } /** - * A predicted {@link FunctionCall} returned from the model + * A predicted {@link FunctionCall} returned from the model * that contains a string representing the {@link FunctionDeclaration.name} * and a structured JSON object containing the parameters and their values. * @public @@ -127,11 +127,11 @@ export interface FunctionCall { } /** - * The result output from a {@link FunctionCall} that contains a string + * The result output from a {@link FunctionCall} that contains a string * representing the {@link FunctionDeclaration.name} * and a structured JSON object containing any output * from the function is used as context to the model. - * This should contain the result of a {@link FunctionCall} + * This should contain the result of a {@link FunctionCall} * made based on model prediction. * @public */ diff --git a/packages/vertexai/src/types/error.ts b/packages/vertexai/src/types/error.ts index aaaf19f05b3..8d83a52a0aa 100644 --- a/packages/vertexai/src/types/error.ts +++ b/packages/vertexai/src/types/error.ts @@ -50,7 +50,7 @@ export interface CustomErrorData { /** HTTP status text of the error response. */ statusText?: string; - /** Response from a {@link GenerateContentRequest} */ + /** Response from a {@link GenerateContentRequest} */ response?: GenerateContentResponse; /** Optional additional details about the error. */ @@ -58,7 +58,7 @@ export interface CustomErrorData { } /** - * Standardized error codes that {@link VertexAIError} can have. + * Standardized error codes that {@link VertexAIError} can have. * * @public */ diff --git a/packages/vertexai/src/types/requests.ts b/packages/vertexai/src/types/requests.ts index e86918a8ed8..61013471316 100644 --- a/packages/vertexai/src/types/requests.ts +++ b/packages/vertexai/src/types/requests.ts @@ -35,7 +35,7 @@ export interface BaseParams { } /** - * Params passed to {@link getGenerativeModel}. + * Params passed to {@link getGenerativeModel}. * @public */ export interface ModelParams extends BaseParams { @@ -81,17 +81,18 @@ export interface GenerationConfig { frequencyPenalty?: number; /** * Output response MIME type of the generated candidate text. - * Supported MIME types are `text/plain` (default, text output) and `application/json` - * (JSON response in the candidates). + * Supported MIME types are `text/plain` (default, text output), + * `application/json` (JSON response in the candidates), and + * `text/x.enum`. */ responseMimeType?: string; /** * Output response schema of the generated candidate text. This - * value can be a class generated with a {@link Schema} static method + * value can be a class generated with a {@link Schema} static method * like `Schema.string()` or `Schema.object()` or it can be a plain - * JS object matching the {@link SchemaRequest} interface. + * JS object matching the {@link SchemaRequest} interface. *
Note: This only applies when the specified `responseMIMEType` supports a schema; currently - * this is limited to `application/json`. + * this is limited to `application/json` and `text/x.enum`. */ responseSchema?: TypedSchema | SchemaRequest; } @@ -116,7 +117,7 @@ export interface CountTokensRequest { } /** - * Params passed to {@link getGenerativeModel}. + * Params passed to {@link getGenerativeModel}. * @public */ export interface RequestOptions { @@ -176,8 +177,8 @@ export declare interface FunctionDeclarationsTool { * Optional. One or more function declarations * to be passed to the model along with the current user query. Model may * decide to call a subset of these functions by populating - * {@link FunctionCall} in the response. User should - * provide a {@link FunctionResponse} for each + * {@link FunctionCall} in the response. User should + * provide a {@link FunctionResponse} for each * function call in the next turn. Based on the function responses, the model will * generate the final response back to the user. Maximum 64 function * declarations can be provided. diff --git a/packages/vertexai/src/types/responses.ts b/packages/vertexai/src/types/responses.ts index 026002a851d..83cd4366f12 100644 --- a/packages/vertexai/src/types/responses.ts +++ b/packages/vertexai/src/types/responses.ts @@ -75,7 +75,7 @@ export interface GenerateContentResponse { } /** - * Usage metadata about a {@link GenerateContentResponse}. + * Usage metadata about a {@link GenerateContentResponse}. * * @public */ @@ -97,7 +97,7 @@ export interface PromptFeedback { } /** - * A candidate returned as part of a {@link GenerateContentResponse}. + * A candidate returned as part of a {@link GenerateContentResponse}. * @public */ export interface GenerateContentCandidate { @@ -111,7 +111,7 @@ export interface GenerateContentCandidate { } /** - * Citation metadata that may be found on a {@link GenerateContentCandidate}. + * Citation metadata that may be found on a {@link GenerateContentCandidate}. * @public */ export interface CitationMetadata { @@ -187,7 +187,7 @@ export interface Date { } /** - * A safety rating associated with a {@link GenerateContentCandidate} + * A safety rating associated with a {@link GenerateContentCandidate} * @public */ export interface SafetyRating { diff --git a/packages/vertexai/src/types/schema.ts b/packages/vertexai/src/types/schema.ts index 7b8f34d89d6..fca213431ad 100644 --- a/packages/vertexai/src/types/schema.ts +++ b/packages/vertexai/src/types/schema.ts @@ -37,7 +37,7 @@ export enum SchemaType { } /** - * Basic {@link Schema} properties shared across several Schema-related + * Basic {@link Schema} properties shared across several Schema-related * types. * @public */ @@ -48,7 +48,7 @@ export interface SchemaShared { description?: string; /** Optional. The items of the property. */ items?: T; - /** Optional. Map of Schemas. */ + /** Optional. Map of `Schema` objects. */ properties?: { [k: string]: T; }; @@ -62,14 +62,14 @@ export interface SchemaShared { } /** - * Params passed to {@link Schema} static methods to create specific - * {@link Schema} classes. + * Params passed to {@link Schema} static methods to create specific + * {@link Schema} classes. * @public */ export interface SchemaParams extends SchemaShared {} /** - * Final format for {@link Schema} params passed to backend requests. + * Final format for {@link Schema} params passed to backend requests. * @public */ export interface SchemaRequest extends SchemaShared { @@ -83,7 +83,7 @@ export interface SchemaRequest extends SchemaShared { } /** - * Interface for {@link Schema} class. + * Interface for {@link Schema} class. * @public */ export interface SchemaInterface extends SchemaShared { @@ -95,7 +95,7 @@ export interface SchemaInterface extends SchemaShared { } /** - * Interface for {@link ObjectSchema} class. + * Interface for {@link ObjectSchema} class. * @public */ export interface ObjectSchemaInterface extends SchemaInterface { diff --git a/yarn.lock b/yarn.lock index dcd2c209a99..1d9814e57fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15140,7 +15140,7 @@ resolve@^1.22.0, resolve@^1.22.4: resolve@~1.17.0: version "1.17.0" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== dependencies: path-parse "^1.0.6"