Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/chilly-parrots-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/vertexai': minor
---

Add `systemInstruction`, `tools`, and `generationConfig` to `CountTokensRequest`.
3 changes: 3 additions & 0 deletions common/api-review/vertexai.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ export interface Content {
export interface CountTokensRequest {
// (undocumented)
contents: Content[];
generationConfig?: GenerationConfig;
systemInstruction?: string | Part | Content;
tools?: Tool[];
}

// @public
Expand Down
33 changes: 33 additions & 0 deletions docs-devsite/vertexai.counttokensrequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export interface CountTokensRequest
| Property | Type | Description |
| --- | --- | --- |
| [contents](./vertexai.counttokensrequest.md#counttokensrequestcontents) | [Content](./vertexai.content.md#content_interface)<!-- -->\[\] | |
| [generationConfig](./vertexai.counttokensrequest.md#counttokensrequestgenerationconfig) | [GenerationConfig](./vertexai.generationconfig.md#generationconfig_interface) | Configuration options that control how the model generates a response. |
| [systemInstruction](./vertexai.counttokensrequest.md#counttokensrequestsysteminstruction) | string \| [Part](./vertexai.md#part) \| [Content](./vertexai.content.md#content_interface) | Instructions that direct the model to behave a certain way. |
| [tools](./vertexai.counttokensrequest.md#counttokensrequesttools) | [Tool](./vertexai.md#tool)<!-- -->\[\] | <code>[Tool](./vertexai.md#tool)</code> configuration. |

## CountTokensRequest.contents

Expand All @@ -31,3 +34,33 @@ export interface CountTokensRequest
```typescript
contents: Content[];
```

## CountTokensRequest.generationConfig

Configuration options that control how the model generates a response.

<b>Signature:</b>

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

## CountTokensRequest.systemInstruction

Instructions that direct the model to behave a certain way.

<b>Signature:</b>

```typescript
systemInstruction?: string | Part | Content;
```

## CountTokensRequest.tools

<code>[Tool](./vertexai.md#tool)</code> configuration.

<b>Signature:</b>

```typescript
tools?: Tool[];
```
12 changes: 12 additions & 0 deletions packages/vertexai/src/types/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ export interface StartChatParams extends BaseParams {
*/
export interface CountTokensRequest {
contents: Content[];
/**
* Instructions that direct the model to behave a certain way.
*/
systemInstruction?: string | Part | Content;
/**
* <code>{@link Tool}</code> configuration.
*/
tools?: Tool[];
/**
* Configuration options that control how the model generates a response.
*/
generationConfig?: GenerationConfig;
}

/**
Expand Down
Loading