Skip to content

Generate vertex reference docs #8226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs-devsite/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +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 Firebase Vertex Web SDK. |

42 changes: 42 additions & 0 deletions docs-devsite/vertexai-preview.baseparams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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 %}

# BaseParams interface
Base parameters for a number of methods.

<b>Signature:</b>

```typescript
export interface BaseParams
```

## Properties

| 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)<!-- -->\[\] | |

## BaseParams.generationConfig

<b>Signature:</b>

```typescript
generationConfig?: GenerationConfig;
```

## BaseParams.safetySettings

<b>Signature:</b>

```typescript
safetySettings?: SafetySetting[];
```
138 changes: 138 additions & 0 deletions docs-devsite/vertexai-preview.chatsession.md
Original file line number Diff line number Diff line change
@@ -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.

<b>Signature:</b>

```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 <code>ChatSession</code> 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. Blocked candidates are not added to history, nor are the prompts that generated them. |
| [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

<b>Signature:</b>

```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

<b>Signature:</b>

```typescript
model: string;
```

## ChatSession.params

<b>Signature:</b>

```typescript
params?: StartChatParams | undefined;
```

## ChatSession.requestOptions

<b>Signature:</b>

```typescript
requestOptions?: RequestOptions | undefined;
```

## ChatSession.getHistory()

Gets the chat history so far. Blocked prompts are not added to history. Blocked candidates are not added to history, nor are the prompts that generated them.

<b>Signature:</b>

```typescript
getHistory(): Promise<Content[]>;
```
<b>Returns:</b>

Promise&lt;[Content](./vertexai-preview.content.md#content_interface)<!-- -->\[\]&gt;

## ChatSession.sendMessage()

Sends a chat message and receives a non-streaming [GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface)

<b>Signature:</b>

```typescript
sendMessage(request: string | Array<string | Part>): Promise<GenerateContentResult>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| request | string \| Array&lt;string \| [Part](./vertexai-preview.md#part)<!-- -->&gt; | |

<b>Returns:</b>

Promise&lt;[GenerateContentResult](./vertexai-preview.generatecontentresult.md#generatecontentresult_interface)<!-- -->&gt;

## 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.

<b>Signature:</b>

```typescript
sendMessageStream(request: string | Array<string | Part>): Promise<GenerateContentStreamResult>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| request | string \| Array&lt;string \| [Part](./vertexai-preview.md#part)<!-- -->&gt; | |

<b>Returns:</b>

Promise&lt;[GenerateContentStreamResult](./vertexai-preview.generatecontentstreamresult.md#generatecontentstreamresult_interface)<!-- -->&gt;

78 changes: 78 additions & 0 deletions docs-devsite/vertexai-preview.citation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
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 %}

# Citation interface
A single citation.

<b>Signature:</b>

```typescript
export interface Citation
```

## Properties

| 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 | |

## Citation.endIndex

<b>Signature:</b>

```typescript
endIndex?: number;
```

## Citation.license

<b>Signature:</b>

```typescript
license?: string;
```

## Citation.publicationDate

<b>Signature:</b>

```typescript
publicationDate?: Date;
```

## Citation.startIndex

<b>Signature:</b>

```typescript
startIndex?: number;
```

## Citation.title

<b>Signature:</b>

```typescript
title?: string;
```

## Citation.uri

<b>Signature:</b>

```typescript
uri?: string;
```
33 changes: 33 additions & 0 deletions docs-devsite/vertexai-preview.citationmetadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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 %}

# CitationMetadata interface
Citation metadata that may be found on a [GenerateContentCandidate](./vertexai-preview.generatecontentcandidate.md#generatecontentcandidate_interface)<!-- -->.

<b>Signature:</b>

```typescript
export interface CitationMetadata
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [citations](./vertexai-preview.citationmetadata.md#citationmetadatacitations) | [Citation](./vertexai-preview.citation.md#citation_interface)<!-- -->\[\] | |

## CitationMetadata.citations

<b>Signature:</b>

```typescript
citations: Citation[];
```
42 changes: 42 additions & 0 deletions docs-devsite/vertexai-preview.content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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 %}

# Content interface
Content type for both prompts and response candidates.

<b>Signature:</b>

```typescript
export interface Content
```

## Properties

| 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) | |

## Content.parts

<b>Signature:</b>

```typescript
parts: Part[];
```

## Content.role

<b>Signature:</b>

```typescript
role: Role;
```
33 changes: 33 additions & 0 deletions docs-devsite/vertexai-preview.counttokensrequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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 %}

# CountTokensRequest interface
Params for calling [GenerativeModel.countTokens()](./vertexai-preview.generativemodel.md#generativemodelcounttokens)

<b>Signature:</b>

```typescript
export interface CountTokensRequest
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [contents](./vertexai-preview.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai-preview.content.md#content_interface)<!-- -->\[\] | |

## CountTokensRequest.contents

<b>Signature:</b>

```typescript
contents: Content[];
```
Loading
Loading