# Technical Documentation: google-gemini/generative-ai-js

> ℹ️ **Provenance:** Multi-Tier Ingestion · [CodeWiki Reference](https://codewiki.google/github.com/google-gemini/generative-ai-js)

### Overview (`README.md`)

# [Deprecated] Google AI JavaScript SDK for the Gemini API

With Gemini 2.0, we took the chance to create a single unified SDK for all developers who want to use Google's GenAI models (Gemini, Veo, Imagen, etc). As part of that process, we took all of the feedback from this SDK and what developers like about other SDKs in the ecosystem to create the [Google Gen AI SDK](https://github.com/googleapis/js-genai). 

The full migration guide from the old SDK to new SDK is available in the [Gemini API docs](https://ai.google.dev/gemini-api/docs/migrate).

The Gemini API docs are fully updated to show examples of the new Google Gen AI SDK. We know how disruptive an SDK change can be and don't take this change lightly, but our goal is to create an extremely simple and clear path for developers to build with our models so it felt necessary to make this change.

Thank you for building with Gemini and [let us know](https://discuss.ai.google.dev/c/gemini-api/4) if you need any help!

**Please be advised that this repository is now considered legacy.** For the latest features, performance improvements, and active development, we strongly recommend migrating to the official **[Google Generative AI SDK for JavaScript](https://github.com/googleapis/js-genai)**.

**Support Plan for this Repository:**

*   **Limited Maintenance:** Development is now restricted to **critical bug fixes only**. No new features will be added.
*   **Purpose:** This limited support aims to provide stability for users while they transition to the new SDK.
*   **End-of-Life Date:** All support for this repository (including bug fixes) will permanently end on **November 30, 2025**.

We encourage all users to begin planning their migration to the [Google Generative AI SDK](https://github.com/googleapis/js-genai) to ensure continued access to the latest capabilities and support.

---

### Overview (`samples/README.md`)

# Google Generative AI Samples for JavaScript

These samples demonstrate how to use state-of-the-art
generative AI models (like Gemini) to build AI-powered features and applications.

To try out these samples, you'll need Node.js v18+.

For some samples of how to adapt this to web, see the `web/` subdirectory.

## Requirements

Follow the instructions on Google AI Studio [setup page](https://makersuite.google.com/app/apikey) to obtain an API key.

It’s strongly recommended that you do not check an API key into your version control system. Instead, you should use a secrets store for your API key.

This sample assumes that you're providing an `API_KEY` environment variable.

## Instructions

Each of these sample files can be run in Node.js from the command line, for
example:

```
node function_calling.js
```

Some of these files run multiple example cases sequentially, and you may want
to comment out cases you do not want to run.

## Documentation

- [Quickstart: Get started with the Gemini API in Node.js applications](https://ai.google.dev/tutorials/node_quickstart)

## Contents

| File                                                     | Description |
|----------------------------------------------------------| ----------- |
| [cache.js](./cache.js)                                   | Context caching |
| [chat.js](./chat.js)                                     | Multi-turn chat conversations |
| [code_execution.js](./code_execution.js)                 | Executing code |
| [model_configuration.js](./model_configuration.js) | Setting model parameters |
| [controlled_generation.js](./controlled_generation.js)   | Generating content with output constraints (e.g. JSON mode) |
| [count_tokens.js](./count_tokens.js)                     | Counting input and output tokens |
| [embed.js](./embed.js)                                   | Generating embeddings |
| [files.js](./files.js)                                   | Managing files with the File API |
| [function_calling.js](./function_calling.js)             | Using function calling |
| [safety_settings.js](./safety_settings.js)               | Setting and using safety controls |
| [system_instruction.js](./system_instruction.js)         | Setting system instructions |
| [search_grounding.js](./search_grounding.js)             | Generate with google search grounding |
| [log_prob.js](./log_prob.js)                             | Generate with log probability for each token |
| [text_generation.js](./text_generation.js)               | Generating text |
| [api_version.js](./api_version.js)                       | Setting api version|

---

### Overview (`samples/web/README.md`)

# Google Generative AI Sample for Web (Javascript)

This sample app demonstrates how to use state-of-the-art
generative AI models (like Gemini) to build AI-powered features and applications.

To try out this sample app, you'll need a modern web browser and a local http server.

## Requirements

Follow the instructions on Google AI Studio [setup page](https://makersuite.google.com/app/apikey) to obtain an API key.

It’s strongly recommended that you do not check an API key into your version control system. Instead, you should use a secrets store for your API key.

The Node.js http server provided alonside this app (`http-server.js`) assumes that you're providing an `API_KEY` environment variable.

## Features

This sample showcases the following API capablilites:

- `index.html` - demonstrates the Text and MultiModal feature from the SDK
- `chat.html` - demonstrates the Multi-turn Conversations feature from the SDK

## Documentation

- [Quickstart: Get started with the Gemini API in web apps](https://ai.google.dev/tutorials/web_quickstart)

---

### Reference Files Index (`docs/reference/files/index.md`)

[Home](./index.md)

## API Reference

## Packages

|  Package | Description |
|  --- | --- |
|  [@google/generative-ai](./generative-ai.md) |  |

---

### Reference Main Generative Ai.Citationsource.Endindex (`docs/reference/main/generative-ai.citationsource.endindex.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CitationSource](./generative-ai.citationsource.md) &gt; [endIndex](./generative-ai.citationsource.endindex.md)

## CitationSource.endIndex property

**Signature:**

```typescript
endIndex?: number;
```

---

### Reference Main Generative Ai.Citationsource.Startindex (`docs/reference/main/generative-ai.citationsource.startindex.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CitationSource](./generative-ai.citationsource.md) &gt; [startIndex](./generative-ai.citationsource.startindex.md)

## CitationSource.startIndex property

**Signature:**

```typescript
startIndex?: number;
```

---

### Reference Main Generative Ai.Generatecontentcandidate.Index (`docs/reference/main/generative-ai.generatecontentcandidate.index.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) &gt; [index](./generative-ai.generatecontentcandidate.index.md)

## GenerateContentCandidate.index property

**Signature:**

```typescript
index: number;
```

---

### Reference Main Generative Ai.Groundingsupportsegment.Endindex (`docs/reference/main/generative-ai.groundingsupportsegment.endindex.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingSupportSegment](./generative-ai.groundingsupportsegment.md) &gt; [endIndex](./generative-ai.groundingsupportsegment.endindex.md)

## GroundingSupportSegment.endIndex property

End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.

**Signature:**

```typescript
endIndex?: number;
```

---

### Reference Main Generative Ai.Groundingsupportsegment.Partindex (`docs/reference/main/generative-ai.groundingsupportsegment.partindex.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingSupportSegment](./generative-ai.groundingsupportsegment.md) &gt; [partIndex](./generative-ai.groundingsupportsegment.partindex.md)

## GroundingSupportSegment.partIndex property

The index of a Part object within its parent Content object.

**Signature:**

```typescript
partIndex?: number;
```

---

### Reference Main Generative Ai.Groundingsupportsegment.Startindex (`docs/reference/main/generative-ai.groundingsupportsegment.startindex.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingSupportSegment](./generative-ai.groundingsupportsegment.md) &gt; [startIndex](./generative-ai.groundingsupportsegment.startindex.md)

## GroundingSupportSegment.startIndex property

Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.

**Signature:**

```typescript
startIndex?: number;
```

---

### Reference Main Index (`docs/reference/main/index.md`)

[Home](./index.md)

## API Reference

## Packages

|  Package | Description |
|  --- | --- |
|  [@google/generative-ai](./generative-ai.md) |  |

---

### Reference Server Index (`docs/reference/server/index.md`)

[Home](./index.md)

## API Reference

## Packages

|  Package | Description |
|  --- | --- |
|  [@google/generative-ai](./generative-ai.md) |  |

---

### Code Of Conduct (`docs/code-of-conduct.md`)

# Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of
experience, education, socio-economic status, nationality, personal appearance,
race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

*   Using welcoming and inclusive language
*   Being respectful of differing viewpoints and experiences
*   Gracefully accepting constructive criticism
*   Focusing on what is best for the community
*   Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

*   The use of sexualized language or imagery and unwelcome sexual attention or
    advances
*   Trolling, insulting/derogatory comments, and personal or political attacks
*   Public or private harassment
*   Publishing others' private information, such as a physical or electronic
    address, without explicit permission
*   Other conduct which could reasonably be considered inappropriate in a
    professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening,
offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

This Code of Conduct also applies outside the project spaces when the Project
Steward has a reasonable belief that an individual's behavior may have a
negative impact on the project or its community.

## Conflict Resolution

We do not believe that all conflict is bad; healthy debate and disagreement
often yield positive results. However, it is never okay to be disrespectful or
to engage in behavior that violates the project’s code of conduct.

If you see someone violating the code of conduct, you are encouraged to address
the behavior directly with those involved. Many issues can be resolved quickly
and easily, and this gives people more control over the outcome of their
dispute. If you are unable to resolve the matter for any reason, or if the
behavior is threatening or harassing, report it. We are dedicated to providing
an environment where participants feel welcome and safe.

Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the
Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to
receive and address reported violations of the code of conduct. They will then
work with a committee consisting of representatives from the Open Source
Programs Office and the Google Open Source Strategy team. If for any reason you
are uncomfortable reaching out to the Project Steward, please email
opensource@google.com.

We will investigate every complaint, but you may not receive a direct response.
We will use our discretion in determining when and how to follow up on reported
incidents, which may range from not taking action to permanent expulsion from
the project and project-sponsored spaces. We will notify the accused of the
report and provide them an opportunity to discuss it before any action is taken.
The identity of the reporter will be omitted from the details of the report
supplied to the accused. In potentially harmful situations, such as ongoing
harassment or threats to anyone's safety, we may take action without notice.

## Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
available at
https://www.contributor-covenant.org/version/1/4/code-of-conduct/

---

### Contributing (`docs/contributing.md`)

# How to Contribute

We would love to accept your patches and contributions to this project.

## Before you begin

### Sign our Contributor License Agreement

Contributions to this project must be accompanied by a
[Contributor License Agreement](https://cla.developers.google.com/about) (CLA).
You (or your employer) retain the copyright to your contribution; this simply
gives us permission to use and redistribute your contributions as part of the
project.

If you or your current employer have already signed the Google CLA (even if it
was for a different project), you probably don't need to do it again.

Visit <https://cla.developers.google.com/> to see your current agreements or to
sign a new one.

### Review our Community Guidelines

This project follows [Google's Open Source Community
Guidelines](https://opensource.google/conduct/).

## Contribution process

### Building and testing locally

Steps to build locally:

1. clone this repo
1. `cd generative-ai-js`
1. Run `npm install` to install dependencies.
1. Make changes as needed to source code.
1. Run `npm run build` to build.
1. Run `npm run test` to run unit tests.
1. Run `npm run docs` to generate any changes to reference docs (destination dir is docs/reference).
1. Run `npm run format` to fix formatting and add license headers as needed.
1. Run `npx @changesets/cli` to generate the changeset summary.

### Code Reviews

All submissions, including submissions by project members, require review. We
use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests)
for this purpose.

---

### Reference Files Generative Ai.Errordetails.  Type  (`docs/reference/files/generative-ai.errordetails.__type_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; ["@type"](./generative-ai.errordetails.__type_.md)

## ErrorDetails."@type" property

**Signature:**

```typescript
"@type"?: string;
```

---

### Reference Files Generative Ai.Errordetails.Domain (`docs/reference/files/generative-ai.errordetails.domain.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; [domain](./generative-ai.errordetails.domain.md)

## ErrorDetails.domain property

**Signature:**

```typescript
domain?: string;
```

---

### Reference Files Generative Ai.Errordetails (`docs/reference/files/generative-ai.errordetails.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md)

## ErrorDetails interface

Details object that may be included in an error response.

**Signature:**

```typescript
export interface ErrorDetails 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  ["@type"?](./generative-ai.errordetails.__type_.md) |  | string | _(Optional)_ |
|  [domain?](./generative-ai.errordetails.domain.md) |  | string | _(Optional)_ |
|  [metadata?](./generative-ai.errordetails.metadata.md) |  | Record&lt;string, unknown&gt; | _(Optional)_ |
|  [reason?](./generative-ai.errordetails.reason.md) |  | string | _(Optional)_ |

---

### Reference Files Generative Ai.Errordetails.Metadata (`docs/reference/files/generative-ai.errordetails.metadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; [metadata](./generative-ai.errordetails.metadata.md)

## ErrorDetails.metadata property

**Signature:**

```typescript
metadata?: Record<string, unknown>;
```

---

### Reference Files Generative Ai.Errordetails.Reason (`docs/reference/files/generative-ai.errordetails.reason.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; [reason](./generative-ai.errordetails.reason.md)

## ErrorDetails.reason property

**Signature:**

```typescript
reason?: string;
```

---

### Reference Files Generative Ai.Filemetadata.Displayname (`docs/reference/files/generative-ai.filemetadata.displayname.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadata](./generative-ai.filemetadata.md) &gt; [displayName](./generative-ai.filemetadata.displayname.md)

## FileMetadata.displayName property

**Signature:**

```typescript
displayName?: string;
```

---

### Reference Files Generative Ai.Filemetadata (`docs/reference/files/generative-ai.filemetadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadata](./generative-ai.filemetadata.md)

## FileMetadata interface

Metadata to provide alongside a file upload

**Signature:**

```typescript
export interface FileMetadata 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [displayName?](./generative-ai.filemetadata.displayname.md) |  | string | _(Optional)_ |
|  [mimeType](./generative-ai.filemetadata.mimetype.md) |  | string |  |
|  [name?](./generative-ai.filemetadata.name.md) |  | string | _(Optional)_ |

---

### Reference Files Generative Ai.Filemetadata.Mimetype (`docs/reference/files/generative-ai.filemetadata.mimetype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadata](./generative-ai.filemetadata.md) &gt; [mimeType](./generative-ai.filemetadata.mimetype.md)

## FileMetadata.mimeType property

**Signature:**

```typescript
mimeType: string;
```

---

### Reference Files Generative Ai.Filemetadata.Name (`docs/reference/files/generative-ai.filemetadata.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadata](./generative-ai.filemetadata.md) &gt; [name](./generative-ai.filemetadata.name.md)

## FileMetadata.name property

**Signature:**

```typescript
name?: string;
```

---

### Reference Files Generative Ai.Filemetadataresponse.Createtime (`docs/reference/files/generative-ai.filemetadataresponse.createtime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [createTime](./generative-ai.filemetadataresponse.createtime.md)

## FileMetadataResponse.createTime property

**Signature:**

```typescript
createTime: string;
```

---

### Reference Files Generative Ai.Filemetadataresponse.Displayname (`docs/reference/files/generative-ai.filemetadataresponse.displayname.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [displayName](./generative-ai.filemetadataresponse.displayname.md)

## FileMetadataResponse.displayName property

**Signature:**

```typescript
displayName?: string;
```

---

### Reference Files Generative Ai.Filemetadataresponse.Error (`docs/reference/files/generative-ai.filemetadataresponse.error.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [error](./generative-ai.filemetadataresponse.error.md)

## FileMetadataResponse.error property

Error populated if file processing has failed.

**Signature:**

```typescript
error?: RpcStatus;
```

---

### Reference Files Generative Ai.Filemetadataresponse.Expirationtime (`docs/reference/files/generative-ai.filemetadataresponse.expirationtime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [expirationTime](./generative-ai.filemetadataresponse.expirationtime.md)

## FileMetadataResponse.expirationTime property

**Signature:**

```typescript
expirationTime: string;
```

---

### Reference Files Generative Ai.Filemetadataresponse (`docs/reference/files/generative-ai.filemetadataresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md)

## FileMetadataResponse interface

File metadata response from server.

**Signature:**

```typescript
export interface FileMetadataResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [createTime](./generative-ai.filemetadataresponse.createtime.md) |  | string |  |
|  [displayName?](./generative-ai.filemetadataresponse.displayname.md) |  | string | _(Optional)_ |
|  [error?](./generative-ai.filemetadataresponse.error.md) |  | [RpcStatus](./generative-ai.rpcstatus.md) | _(Optional)_ Error populated if file processing has failed. |
|  [expirationTime](./generative-ai.filemetadataresponse.expirationtime.md) |  | string |  |
|  [mimeType](./generative-ai.filemetadataresponse.mimetype.md) |  | string |  |
|  [name](./generative-ai.filemetadataresponse.name.md) |  | string |  |
|  [sha256Hash](./generative-ai.filemetadataresponse.sha256hash.md) |  | string |  |
|  [sizeBytes](./generative-ai.filemetadataresponse.sizebytes.md) |  | string |  |
|  [state](./generative-ai.filemetadataresponse.state.md) |  | [FileState](./generative-ai.filestate.md) |  |
|  [updateTime](./generative-ai.filemetadataresponse.updatetime.md) |  | string |  |
|  [uri](./generative-ai.filemetadataresponse.uri.md) |  | string |  |
|  [videoMetadata?](./generative-ai.filemetadataresponse.videometadata.md) |  | [VideoMetadata](./generative-ai.videometadata.md) | _(Optional)_ Video metadata populated after processing is complete. |

---

### Reference Files Generative Ai.Filemetadataresponse.Mimetype (`docs/reference/files/generative-ai.filemetadataresponse.mimetype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [mimeType](./generative-ai.filemetadataresponse.mimetype.md)

## FileMetadataResponse.mimeType property

**Signature:**

```typescript
mimeType: string;
```

---

### Reference Files Generative Ai.Filemetadataresponse.Name (`docs/reference/files/generative-ai.filemetadataresponse.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [name](./generative-ai.filemetadataresponse.name.md)

## FileMetadataResponse.name property

**Signature:**

```typescript
name: string;
```

---

### Reference Files Generative Ai.Filemetadataresponse.Sha256hash (`docs/reference/files/generative-ai.filemetadataresponse.sha256hash.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [sha256Hash](./generative-ai.filemetadataresponse.sha256hash.md)

## FileMetadataResponse.sha256Hash property

**Signature:**

```typescript
sha256Hash: string;
```

---

### Reference Files Generative Ai.Filemetadataresponse.Sizebytes (`docs/reference/files/generative-ai.filemetadataresponse.sizebytes.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [sizeBytes](./generative-ai.filemetadataresponse.sizebytes.md)

## FileMetadataResponse.sizeBytes property

**Signature:**

```typescript
sizeBytes: string;
```

---

### Reference Files Generative Ai.Filemetadataresponse.State (`docs/reference/files/generative-ai.filemetadataresponse.state.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [state](./generative-ai.filemetadataresponse.state.md)

## FileMetadataResponse.state property

**Signature:**

```typescript
state: FileState;
```

---

### Reference Files Generative Ai.Filemetadataresponse.Updatetime (`docs/reference/files/generative-ai.filemetadataresponse.updatetime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [updateTime](./generative-ai.filemetadataresponse.updatetime.md)

## FileMetadataResponse.updateTime property

**Signature:**

```typescript
updateTime: string;
```

---

### Reference Files Generative Ai.Filemetadataresponse.Uri (`docs/reference/files/generative-ai.filemetadataresponse.uri.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [uri](./generative-ai.filemetadataresponse.uri.md)

## FileMetadataResponse.uri property

**Signature:**

```typescript
uri: string;
```

---

### Reference Files Generative Ai.Filemetadataresponse.Videometadata (`docs/reference/files/generative-ai.filemetadataresponse.videometadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [videoMetadata](./generative-ai.filemetadataresponse.videometadata.md)

## FileMetadataResponse.videoMetadata property

Video metadata populated after processing is complete.

**Signature:**

```typescript
videoMetadata?: VideoMetadata;
```

---

### Reference Files Generative Ai.Filestate (`docs/reference/files/generative-ai.filestate.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileState](./generative-ai.filestate.md)

## FileState enum

Processing state of the `File`.

**Signature:**

```typescript
export declare enum FileState 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  ACTIVE | <code>&quot;ACTIVE&quot;</code> |  |
|  FAILED | <code>&quot;FAILED&quot;</code> |  |
|  PROCESSING | <code>&quot;PROCESSING&quot;</code> |  |
|  STATE\_UNSPECIFIED | <code>&quot;STATE_UNSPECIFIED&quot;</code> |  |

---

### Reference Files Generative Ai.Googleaifilemanager. Constructor  (`docs/reference/files/generative-ai.googleaifilemanager._constructor_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [(constructor)](./generative-ai.googleaifilemanager._constructor_.md)

## GoogleAIFileManager.(constructor)

Constructs a new instance of the `GoogleAIFileManager` class

**Signature:**

```typescript
constructor(apiKey: string, _requestOptions?: RequestOptions);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  apiKey | string |  |
|  \_requestOptions | [RequestOptions](./generative-ai.requestoptions.md) | _(Optional)_ |

---

### Reference Files Generative Ai.Googleaifilemanager.Apikey (`docs/reference/files/generative-ai.googleaifilemanager.apikey.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [apiKey](./generative-ai.googleaifilemanager.apikey.md)

## GoogleAIFileManager.apiKey property

**Signature:**

```typescript
apiKey: string;
```

---

### Reference Files Generative Ai.Googleaifilemanager.Deletefile (`docs/reference/files/generative-ai.googleaifilemanager.deletefile.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [deleteFile](./generative-ai.googleaifilemanager.deletefile.md)

## GoogleAIFileManager.deleteFile() method

Delete file with given ID.

Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.

**Signature:**

```typescript
deleteFile(fileId: string, requestOptions?: SingleRequestOptions): Promise<void>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  fileId | string |  |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;void&gt;

---

### Reference Files Generative Ai.Googleaifilemanager.Getfile (`docs/reference/files/generative-ai.googleaifilemanager.getfile.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [getFile](./generative-ai.googleaifilemanager.getfile.md)

## GoogleAIFileManager.getFile() method

Get metadata for file with given ID.

Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.

**Signature:**

```typescript
getFile(fileId: string, requestOptions?: SingleRequestOptions): Promise<FileMetadataResponse>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  fileId | string |  |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[FileMetadataResponse](./generative-ai.filemetadataresponse.md)&gt;

---

### Reference Files Generative Ai.Googleaifilemanager.Listfiles (`docs/reference/files/generative-ai.googleaifilemanager.listfiles.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [listFiles](./generative-ai.googleaifilemanager.listfiles.md)

## GoogleAIFileManager.listFiles() method

List all uploaded files.

Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.

**Signature:**

```typescript
listFiles(listParams?: ListParams, requestOptions?: SingleRequestOptions): Promise<ListFilesResponse>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  listParams | [ListParams](./generative-ai.listparams.md) | _(Optional)_ |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[ListFilesResponse](./generative-ai.listfilesresponse.md)&gt;

---

### Reference Files Generative Ai.Googleaifilemanager (`docs/reference/files/generative-ai.googleaifilemanager.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md)

## GoogleAIFileManager class

Class for managing GoogleAI file uploads.

**Signature:**

```typescript
export declare class GoogleAIFileManager 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(apiKey, \_requestOptions)](./generative-ai.googleaifilemanager._constructor_.md) |  | Constructs a new instance of the <code>GoogleAIFileManager</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [apiKey](./generative-ai.googleaifilemanager.apikey.md) |  | string |  |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [deleteFile(fileId, requestOptions)](./generative-ai.googleaifilemanager.deletefile.md) |  | <p>Delete file with given ID.</p><p>Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.</p> |
|  [getFile(fileId, requestOptions)](./generative-ai.googleaifilemanager.getfile.md) |  | <p>Get metadata for file with given ID.</p><p>Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.</p> |
|  [listFiles(listParams, requestOptions)](./generative-ai.googleaifilemanager.listfiles.md) |  | <p>List all uploaded files.</p><p>Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.</p> |
|  [uploadFile(filePath, fileMetadata, requestOptions)](./generative-ai.googleaifilemanager.uploadfile.md) |  | <p>Upload a file.</p><p>Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.</p> |

---

### Reference Files Generative Ai.Googleaifilemanager.Uploadfile (`docs/reference/files/generative-ai.googleaifilemanager.uploadfile.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [uploadFile](./generative-ai.googleaifilemanager.uploadfile.md)

## GoogleAIFileManager.uploadFile() method

Upload a file.

Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.

**Signature:**

```typescript
uploadFile(filePath: string, fileMetadata: FileMetadata, requestOptions?: SingleRequestOptions): Promise<UploadFileResponse>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  filePath | string |  |
|  fileMetadata | [FileMetadata](./generative-ai.filemetadata.md) |  |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[UploadFileResponse](./generative-ai.uploadfileresponse.md)&gt;

---

### Reference Files Generative Ai.Listfilesresponse.Files (`docs/reference/files/generative-ai.listfilesresponse.files.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListFilesResponse](./generative-ai.listfilesresponse.md) &gt; [files](./generative-ai.listfilesresponse.files.md)

## ListFilesResponse.files property

**Signature:**

```typescript
files: FileMetadataResponse[];
```

---

### Reference Files Generative Ai.Listfilesresponse (`docs/reference/files/generative-ai.listfilesresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListFilesResponse](./generative-ai.listfilesresponse.md)

## ListFilesResponse interface

Response from calling [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md)

**Signature:**

```typescript
export interface ListFilesResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [files](./generative-ai.listfilesresponse.files.md) |  | [FileMetadataResponse](./generative-ai.filemetadataresponse.md)\[\] |  |
|  [nextPageToken?](./generative-ai.listfilesresponse.nextpagetoken.md) |  | string | _(Optional)_ |

---

### Reference Files Generative Ai.Listfilesresponse.Nextpagetoken (`docs/reference/files/generative-ai.listfilesresponse.nextpagetoken.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListFilesResponse](./generative-ai.listfilesresponse.md) &gt; [nextPageToken](./generative-ai.listfilesresponse.nextpagetoken.md)

## ListFilesResponse.nextPageToken property

**Signature:**

```typescript
nextPageToken?: string;
```

---

### Reference Files Generative Ai.Listparams (`docs/reference/files/generative-ai.listparams.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListParams](./generative-ai.listparams.md)

## ListParams interface

Params to pass to [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md)

**Signature:**

```typescript
export interface ListParams 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [pageSize?](./generative-ai.listparams.pagesize.md) |  | number | _(Optional)_ |
|  [pageToken?](./generative-ai.listparams.pagetoken.md) |  | string | _(Optional)_ |

---

### Reference Files Generative Ai.Listparams.Pagesize (`docs/reference/files/generative-ai.listparams.pagesize.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListParams](./generative-ai.listparams.md) &gt; [pageSize](./generative-ai.listparams.pagesize.md)

## ListParams.pageSize property

**Signature:**

```typescript
pageSize?: number;
```

---

### Reference Files Generative Ai.Listparams.Pagetoken (`docs/reference/files/generative-ai.listparams.pagetoken.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListParams](./generative-ai.listparams.md) &gt; [pageToken](./generative-ai.listparams.pagetoken.md)

## ListParams.pageToken property

**Signature:**

```typescript
pageToken?: string;
```

---

### Reference Files Generative Ai (`docs/reference/files/generative-ai.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md)

## generative-ai package

## Classes

|  Class | Description |
|  --- | --- |
|  [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) | Class for managing GoogleAI file uploads. |

## Enumerations

|  Enumeration | Description |
|  --- | --- |
|  [FileState](./generative-ai.filestate.md) | Processing state of the <code>File</code>. |

## Interfaces

|  Interface | Description |
|  --- | --- |
|  [ErrorDetails](./generative-ai.errordetails.md) | Details object that may be included in an error response. |
|  [FileMetadata](./generative-ai.filemetadata.md) | Metadata to provide alongside a file upload |
|  [FileMetadataResponse](./generative-ai.filemetadataresponse.md) | File metadata response from server. |
|  [ListFilesResponse](./generative-ai.listfilesresponse.md) | Response from calling [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md) |
|  [ListParams](./generative-ai.listparams.md) | Params to pass to [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md) |
|  [RequestOptions](./generative-ai.requestoptions.md) | Params passed to getGenerativeModel() or GoogleAIFileManager(). |
|  [RpcStatus](./generative-ai.rpcstatus.md) | Standard RPC error status object. |
|  [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | Params passed to atomic asynchronous operations. |
|  [UploadFileResponse](./generative-ai.uploadfileresponse.md) | Response from calling [GoogleAIFileManager.uploadFile()](./generative-ai.googleaifilemanager.uploadfile.md) |
|  [VideoMetadata](./generative-ai.videometadata.md) | Metadata populated when video has been processed. |

---

### Reference Files Generative Ai.Requestoptions.Apiclient (`docs/reference/files/generative-ai.requestoptions.apiclient.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [apiClient](./generative-ai.requestoptions.apiclient.md)

## RequestOptions.apiClient property

Additional attribution information to include in the x-goog-api-client header. Used by wrapper SDKs.

**Signature:**

```typescript
apiClient?: string;
```

---

### Reference Files Generative Ai.Requestoptions.Apiversion (`docs/reference/files/generative-ai.requestoptions.apiversion.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [apiVersion](./generative-ai.requestoptions.apiversion.md)

## RequestOptions.apiVersion property

Version of API endpoint to call (e.g. "v1" or "v1beta"). If not specified, defaults to latest stable version.

**Signature:**

```typescript
apiVersion?: string;
```

---

### Reference Files Generative Ai.Requestoptions.Baseurl (`docs/reference/files/generative-ai.requestoptions.baseurl.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [baseUrl](./generative-ai.requestoptions.baseurl.md)

## RequestOptions.baseUrl property

Base endpoint url. Defaults to "https://generativelanguage.googleapis.com"

**Signature:**

```typescript
baseUrl?: string;
```

---

### Reference Files Generative Ai.Requestoptions.Customheaders (`docs/reference/files/generative-ai.requestoptions.customheaders.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [customHeaders](./generative-ai.requestoptions.customheaders.md)

## RequestOptions.customHeaders property

Custom HTTP request headers.

**Signature:**

```typescript
customHeaders?: Headers | Record<string, string>;
```

---

### Reference Files Generative Ai.Requestoptions (`docs/reference/files/generative-ai.requestoptions.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md)

## RequestOptions interface

Params passed to getGenerativeModel() or GoogleAIFileManager().

**Signature:**

```typescript
export interface RequestOptions 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [apiClient?](./generative-ai.requestoptions.apiclient.md) |  | string | _(Optional)_ Additional attribution information to include in the x-goog-api-client header. Used by wrapper SDKs. |
|  [apiVersion?](./generative-ai.requestoptions.apiversion.md) |  | string | _(Optional)_ Version of API endpoint to call (e.g. "v1" or "v1beta"). If not specified, defaults to latest stable version. |
|  [baseUrl?](./generative-ai.requestoptions.baseurl.md) |  | string | _(Optional)_ Base endpoint url. Defaults to "https://generativelanguage.googleapis.com" |
|  [customHeaders?](./generative-ai.requestoptions.customheaders.md) |  | Headers \| Record&lt;string, string&gt; | _(Optional)_ Custom HTTP request headers. |
|  [timeout?](./generative-ai.requestoptions.timeout.md) |  | number | _(Optional)_ Request timeout in milliseconds. |

---

### Reference Files Generative Ai.Requestoptions.Timeout (`docs/reference/files/generative-ai.requestoptions.timeout.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [timeout](./generative-ai.requestoptions.timeout.md)

## RequestOptions.timeout property

Request timeout in milliseconds.

**Signature:**

```typescript
timeout?: number;
```

---

### Reference Files Generative Ai.Rpcstatus.Code (`docs/reference/files/generative-ai.rpcstatus.code.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RpcStatus](./generative-ai.rpcstatus.md) &gt; [code](./generative-ai.rpcstatus.code.md)

## RpcStatus.code property

Error status code

**Signature:**

```typescript
code: number;
```

---

### Reference Files Generative Ai.Rpcstatus.Details (`docs/reference/files/generative-ai.rpcstatus.details.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RpcStatus](./generative-ai.rpcstatus.md) &gt; [details](./generative-ai.rpcstatus.details.md)

## RpcStatus.details property

A list of messages that carry the error details.

**Signature:**

```typescript
details?: ErrorDetails[];
```

---

### Reference Files Generative Ai.Rpcstatus (`docs/reference/files/generative-ai.rpcstatus.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RpcStatus](./generative-ai.rpcstatus.md)

## RpcStatus interface

Standard RPC error status object.

**Signature:**

```typescript
export interface RpcStatus 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [code](./generative-ai.rpcstatus.code.md) |  | number | Error status code |
|  [details?](./generative-ai.rpcstatus.details.md) |  | [ErrorDetails](./generative-ai.errordetails.md)\[\] | _(Optional)_ A list of messages that carry the error details. |
|  [message](./generative-ai.rpcstatus.message.md) |  | string | A developer-facing error message. |

---

### Reference Files Generative Ai.Rpcstatus.Message (`docs/reference/files/generative-ai.rpcstatus.message.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RpcStatus](./generative-ai.rpcstatus.md) &gt; [message](./generative-ai.rpcstatus.message.md)

## RpcStatus.message property

A developer-facing error message.

**Signature:**

```typescript
message: string;
```

---

### Reference Files Generative Ai.Singlerequestoptions (`docs/reference/files/generative-ai.singlerequestoptions.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SingleRequestOptions](./generative-ai.singlerequestoptions.md)

## SingleRequestOptions interface

Params passed to atomic asynchronous operations.

**Signature:**

```typescript
export interface SingleRequestOptions extends RequestOptions 
```
**Extends:** [RequestOptions](./generative-ai.requestoptions.md)

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [signal?](./generative-ai.singlerequestoptions.signal.md) |  | AbortSignal | _(Optional)_ An object that may be used to abort asynchronous requests. The request may also be aborted due to the expiration of the timeout value, if provided, and if the timeout occurs first. |

---

### Reference Files Generative Ai.Singlerequestoptions.Signal (`docs/reference/files/generative-ai.singlerequestoptions.signal.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SingleRequestOptions](./generative-ai.singlerequestoptions.md) &gt; [signal](./generative-ai.singlerequestoptions.signal.md)

## SingleRequestOptions.signal property

An object that may be used to abort asynchronous requests. The request may also be aborted due to the expiration of the timeout value, if provided, and if the timeout occurs first.

**Signature:**

```typescript
signal?: AbortSignal;
```

---

### Reference Files Generative Ai.Uploadfileresponse.File (`docs/reference/files/generative-ai.uploadfileresponse.file.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [UploadFileResponse](./generative-ai.uploadfileresponse.md) &gt; [file](./generative-ai.uploadfileresponse.file.md)

## UploadFileResponse.file property

**Signature:**

```typescript
file: FileMetadataResponse;
```

---

### Reference Files Generative Ai.Uploadfileresponse (`docs/reference/files/generative-ai.uploadfileresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [UploadFileResponse](./generative-ai.uploadfileresponse.md)

## UploadFileResponse interface

Response from calling [GoogleAIFileManager.uploadFile()](./generative-ai.googleaifilemanager.uploadfile.md)

**Signature:**

```typescript
export interface UploadFileResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [file](./generative-ai.uploadfileresponse.file.md) |  | [FileMetadataResponse](./generative-ai.filemetadataresponse.md) |  |

---

### Reference Files Generative Ai.Videometadata (`docs/reference/files/generative-ai.videometadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [VideoMetadata](./generative-ai.videometadata.md)

## VideoMetadata interface

Metadata populated when video has been processed.

**Signature:**

```typescript
export interface VideoMetadata 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [videoDuration](./generative-ai.videometadata.videoduration.md) |  | string | The video duration in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. |

---

### Reference Files Generative Ai.Videometadata.Videoduration (`docs/reference/files/generative-ai.videometadata.videoduration.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [VideoMetadata](./generative-ai.videometadata.md) &gt; [videoDuration](./generative-ai.videometadata.videoduration.md)

## VideoMetadata.videoDuration property

The video duration in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format.

**Signature:**

```typescript
videoDuration: string;
```

---

### Reference Main Generative Ai.Arrayschema.Items (`docs/reference/main/generative-ai.arrayschema.items.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ArraySchema](./generative-ai.arrayschema.md) &gt; [items](./generative-ai.arrayschema.items.md)

## ArraySchema.items property

A schema describing the entries in the array.

**Signature:**

```typescript
items: Schema;
```

---

### Reference Main Generative Ai.Arrayschema.Maxitems (`docs/reference/main/generative-ai.arrayschema.maxitems.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ArraySchema](./generative-ai.arrayschema.md) &gt; [maxItems](./generative-ai.arrayschema.maxitems.md)

## ArraySchema.maxItems property

The maximum number of items in the array.

**Signature:**

```typescript
maxItems?: number;
```

---

### Reference Main Generative Ai.Arrayschema (`docs/reference/main/generative-ai.arrayschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ArraySchema](./generative-ai.arrayschema.md)

## ArraySchema interface

Describes an array, an ordered list of values.

**Signature:**

```typescript
export interface ArraySchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [items](./generative-ai.arrayschema.items.md) |  | [Schema](./generative-ai.schema.md) | A schema describing the entries in the array. |
|  [maxItems?](./generative-ai.arrayschema.maxitems.md) |  | number | _(Optional)_ The maximum number of items in the array. |
|  [minItems?](./generative-ai.arrayschema.minitems.md) |  | number | _(Optional)_ The minimum number of items in the array. |
|  [type](./generative-ai.arrayschema.type.md) |  | typeof [SchemaType.ARRAY](./generative-ai.schematype.md) |  |

---

### Reference Main Generative Ai.Arrayschema.Minitems (`docs/reference/main/generative-ai.arrayschema.minitems.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ArraySchema](./generative-ai.arrayschema.md) &gt; [minItems](./generative-ai.arrayschema.minitems.md)

## ArraySchema.minItems property

The minimum number of items in the array.

**Signature:**

```typescript
minItems?: number;
```

---

### Reference Main Generative Ai.Arrayschema.Type (`docs/reference/main/generative-ai.arrayschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ArraySchema](./generative-ai.arrayschema.md) &gt; [type](./generative-ai.arrayschema.type.md)

## ArraySchema.type property

**Signature:**

```typescript
type: typeof SchemaType.ARRAY;
```

---

### Reference Main Generative Ai.Baseparams.Generationconfig (`docs/reference/main/generative-ai.baseparams.generationconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BaseParams](./generative-ai.baseparams.md) &gt; [generationConfig](./generative-ai.baseparams.generationconfig.md)

## BaseParams.generationConfig property

**Signature:**

```typescript
generationConfig?: GenerationConfig;
```

---

### Reference Main Generative Ai.Baseparams (`docs/reference/main/generative-ai.baseparams.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BaseParams](./generative-ai.baseparams.md)

## BaseParams interface

Base parameters for a number of methods.

**Signature:**

```typescript
export interface BaseParams 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [generationConfig?](./generative-ai.baseparams.generationconfig.md) |  | [GenerationConfig](./generative-ai.generationconfig.md) | _(Optional)_ |
|  [safetySettings?](./generative-ai.baseparams.safetysettings.md) |  | [SafetySetting](./generative-ai.safetysetting.md)\[\] | _(Optional)_ |

---

### Reference Main Generative Ai.Baseparams.Safetysettings (`docs/reference/main/generative-ai.baseparams.safetysettings.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BaseParams](./generative-ai.baseparams.md) &gt; [safetySettings](./generative-ai.baseparams.safetysettings.md)

## BaseParams.safetySettings property

**Signature:**

```typescript
safetySettings?: SafetySetting[];
```

---

### Reference Main Generative Ai.Batchembedcontentsrequest (`docs/reference/main/generative-ai.batchembedcontentsrequest.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BatchEmbedContentsRequest](./generative-ai.batchembedcontentsrequest.md)

## BatchEmbedContentsRequest interface

Params for calling [GenerativeModel.batchEmbedContents()](./generative-ai.generativemodel.batchembedcontents.md)

**Signature:**

```typescript
export interface BatchEmbedContentsRequest 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [requests](./generative-ai.batchembedcontentsrequest.requests.md) |  | [EmbedContentRequest](./generative-ai.embedcontentrequest.md)\[\] |  |

---

### Reference Main Generative Ai.Batchembedcontentsrequest.Requests (`docs/reference/main/generative-ai.batchembedcontentsrequest.requests.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BatchEmbedContentsRequest](./generative-ai.batchembedcontentsrequest.md) &gt; [requests](./generative-ai.batchembedcontentsrequest.requests.md)

## BatchEmbedContentsRequest.requests property

**Signature:**

```typescript
requests: EmbedContentRequest[];
```

---

### Reference Main Generative Ai.Batchembedcontentsresponse.Embeddings (`docs/reference/main/generative-ai.batchembedcontentsresponse.embeddings.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BatchEmbedContentsResponse](./generative-ai.batchembedcontentsresponse.md) &gt; [embeddings](./generative-ai.batchembedcontentsresponse.embeddings.md)

## BatchEmbedContentsResponse.embeddings property

**Signature:**

```typescript
embeddings: ContentEmbedding[];
```

---

### Reference Main Generative Ai.Batchembedcontentsresponse (`docs/reference/main/generative-ai.batchembedcontentsresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BatchEmbedContentsResponse](./generative-ai.batchembedcontentsresponse.md)

## BatchEmbedContentsResponse interface

Response from calling [GenerativeModel.batchEmbedContents()](./generative-ai.generativemodel.batchembedcontents.md).

**Signature:**

```typescript
export interface BatchEmbedContentsResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [embeddings](./generative-ai.batchembedcontentsresponse.embeddings.md) |  | [ContentEmbedding](./generative-ai.contentembedding.md)\[\] |  |

---

### Reference Main Generative Ai.Blockreason (`docs/reference/main/generative-ai.blockreason.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BlockReason](./generative-ai.blockreason.md)

## BlockReason enum

Reason that a prompt was blocked.

**Signature:**

```typescript
export declare enum BlockReason 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  BLOCKED\_REASON\_UNSPECIFIED | <code>&quot;BLOCKED_REASON_UNSPECIFIED&quot;</code> |  |
|  OTHER | <code>&quot;OTHER&quot;</code> |  |
|  SAFETY | <code>&quot;SAFETY&quot;</code> |  |

---

### Reference Main Generative Ai.Booleanschema (`docs/reference/main/generative-ai.booleanschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BooleanSchema](./generative-ai.booleanschema.md)

## BooleanSchema interface

Describes a boolean, either 'true' or 'false'.

**Signature:**

```typescript
export interface BooleanSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [type](./generative-ai.booleanschema.type.md) |  | typeof [SchemaType.BOOLEAN](./generative-ai.schematype.md) |  |

---

### Reference Main Generative Ai.Booleanschema.Type (`docs/reference/main/generative-ai.booleanschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BooleanSchema](./generative-ai.booleanschema.md) &gt; [type](./generative-ai.booleanschema.type.md)

## BooleanSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.BOOLEAN;
```

---

### Reference Main Generative Ai.Cachedcontent.Createtime (`docs/reference/main/generative-ai.cachedcontent.createtime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContent](./generative-ai.cachedcontent.md) &gt; [createTime](./generative-ai.cachedcontent.createtime.md)

## CachedContent.createTime property

`CachedContent` creation time in ISO string format.

**Signature:**

```typescript
createTime?: string;
```

---

### Reference Main Generative Ai.Cachedcontent (`docs/reference/main/generative-ai.cachedcontent.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContent](./generative-ai.cachedcontent.md)

## CachedContent interface

Describes `CachedContent` interface for sending to the server (if creating) or received from the server (using getters or list methods).

**Signature:**

```typescript
export interface CachedContent extends CachedContentBase 
```
**Extends:** [CachedContentBase](./generative-ai.cachedcontentbase.md)

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [createTime?](./generative-ai.cachedcontent.createtime.md) |  | string | _(Optional)_ <code>CachedContent</code> creation time in ISO string format. |
|  [name?](./generative-ai.cachedcontent.name.md) |  | string | _(Optional)_ |
|  [ttl?](./generative-ai.cachedcontent.ttl.md) |  | string | _(Optional)_ protobuf.Duration format (ex. "3.0001s"). |
|  [updateTime?](./generative-ai.cachedcontent.updatetime.md) |  | string | _(Optional)_ <code>CachedContent</code> update time in ISO string format. |

---

### Reference Main Generative Ai.Cachedcontent.Name (`docs/reference/main/generative-ai.cachedcontent.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContent](./generative-ai.cachedcontent.md) &gt; [name](./generative-ai.cachedcontent.name.md)

## CachedContent.name property

**Signature:**

```typescript
name?: string;
```

---

### Reference Main Generative Ai.Cachedcontent.Ttl (`docs/reference/main/generative-ai.cachedcontent.ttl.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContent](./generative-ai.cachedcontent.md) &gt; [ttl](./generative-ai.cachedcontent.ttl.md)

## CachedContent.ttl property

protobuf.Duration format (ex. "3.0001s").

**Signature:**

```typescript
ttl?: string;
```

---

### Reference Main Generative Ai.Cachedcontent.Updatetime (`docs/reference/main/generative-ai.cachedcontent.updatetime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContent](./generative-ai.cachedcontent.md) &gt; [updateTime](./generative-ai.cachedcontent.updatetime.md)

## CachedContent.updateTime property

`CachedContent` update time in ISO string format.

**Signature:**

```typescript
updateTime?: string;
```

---

### Reference Main Generative Ai.Cachedcontentbase.Contents (`docs/reference/main/generative-ai.cachedcontentbase.contents.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [contents](./generative-ai.cachedcontentbase.contents.md)

## CachedContentBase.contents property

**Signature:**

```typescript
contents: Content[];
```

---

### Reference Main Generative Ai.Cachedcontentbase.Displayname (`docs/reference/main/generative-ai.cachedcontentbase.displayname.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [displayName](./generative-ai.cachedcontentbase.displayname.md)

## CachedContentBase.displayName property

**Signature:**

```typescript
displayName?: string;
```

---

### Reference Main Generative Ai.Cachedcontentbase.Expiretime (`docs/reference/main/generative-ai.cachedcontentbase.expiretime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [expireTime](./generative-ai.cachedcontentbase.expiretime.md)

## CachedContentBase.expireTime property

Expiration time in ISO string format. Specify either this or `ttlSeconds` when creating a `CachedContent`.

**Signature:**

```typescript
expireTime?: string;
```

---

### Reference Main Generative Ai.Cachedcontentbase (`docs/reference/main/generative-ai.cachedcontentbase.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md)

## CachedContentBase interface


**Signature:**

```typescript
export interface CachedContentBase 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [contents](./generative-ai.cachedcontentbase.contents.md) |  | [Content](./generative-ai.content.md)\[\] |  |
|  [displayName?](./generative-ai.cachedcontentbase.displayname.md) |  | string | _(Optional)_ |
|  [expireTime?](./generative-ai.cachedcontentbase.expiretime.md) |  | string | _(Optional)_ Expiration time in ISO string format. Specify either this or <code>ttlSeconds</code> when creating a <code>CachedContent</code>. |
|  [model?](./generative-ai.cachedcontentbase.model.md) |  | string | _(Optional)_ |
|  [systemInstruction?](./generative-ai.cachedcontentbase.systeminstruction.md) |  | string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) | _(Optional)_ |
|  [toolConfig?](./generative-ai.cachedcontentbase.toolconfig.md) |  | [ToolConfig](./generative-ai.toolconfig.md) | _(Optional)_ |
|  [tools?](./generative-ai.cachedcontentbase.tools.md) |  | [Tool](./generative-ai.tool.md)\[\] | _(Optional)_ |

---

### Reference Main Generative Ai.Cachedcontentbase.Model (`docs/reference/main/generative-ai.cachedcontentbase.model.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [model](./generative-ai.cachedcontentbase.model.md)

## CachedContentBase.model property

**Signature:**

```typescript
model?: string;
```

---

### Reference Main Generative Ai.Cachedcontentbase.Systeminstruction (`docs/reference/main/generative-ai.cachedcontentbase.systeminstruction.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [systemInstruction](./generative-ai.cachedcontentbase.systeminstruction.md)

## CachedContentBase.systemInstruction property

**Signature:**

```typescript
systemInstruction?: string | Part | Content;
```

---

### Reference Main Generative Ai.Cachedcontentbase.Toolconfig (`docs/reference/main/generative-ai.cachedcontentbase.toolconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [toolConfig](./generative-ai.cachedcontentbase.toolconfig.md)

## CachedContentBase.toolConfig property

**Signature:**

```typescript
toolConfig?: ToolConfig;
```

---

### Reference Main Generative Ai.Cachedcontentbase.Tools (`docs/reference/main/generative-ai.cachedcontentbase.tools.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [tools](./generative-ai.cachedcontentbase.tools.md)

## CachedContentBase.tools property

**Signature:**

```typescript
tools?: Tool[];
```

---

### Reference Main Generative Ai.Chatsession. Constructor  (`docs/reference/main/generative-ai.chatsession._constructor_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ChatSession](./generative-ai.chatsession.md) &gt; [(constructor)](./generative-ai.chatsession._constructor_.md)

## ChatSession.(constructor)

Constructs a new instance of the `ChatSession` class

**Signature:**

```typescript
constructor(apiKey: string, model: string, params?: StartChatParams, _requestOptions?: RequestOptions);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  apiKey | string |  |
|  model | string |  |
|  params | [StartChatParams](./generative-ai.startchatparams.md) | _(Optional)_ |
|  \_requestOptions | [RequestOptions](./generative-ai.requestoptions.md) | _(Optional)_ |

---

### Reference Main Generative Ai.Chatsession.Gethistory (`docs/reference/main/generative-ai.chatsession.gethistory.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ChatSession](./generative-ai.chatsession.md) &gt; [getHistory](./generative-ai.chatsession.gethistory.md)

## ChatSession.getHistory() method

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.

**Signature:**

```typescript
getHistory(): Promise<Content[]>;
```
**Returns:**

Promise&lt;[Content](./generative-ai.content.md)\[\]&gt;

---

### Reference Main Generative Ai.Chatsession (`docs/reference/main/generative-ai.chatsession.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ChatSession](./generative-ai.chatsession.md)

## 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)(apiKey, model, params, \_requestOptions)](./generative-ai.chatsession._constructor_.md) |  | Constructs a new instance of the <code>ChatSession</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [model](./generative-ai.chatsession.model.md) |  | string |  |
|  [params?](./generative-ai.chatsession.params.md) |  | [StartChatParams](./generative-ai.startchatparams.md) | _(Optional)_ |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [getHistory()](./generative-ai.chatsession.gethistory.md) |  | 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, requestOptions)](./generative-ai.chatsession.sendmessage.md) |  | <p>Sends a chat message and receives a non-streaming [GenerateContentResult](./generative-ai.generatecontentresult.md).</p><p>Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).</p> |
|  [sendMessageStream(request, requestOptions)](./generative-ai.chatsession.sendmessagestream.md) |  | <p>Sends a chat message and receives the response as a [GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md) containing an iterable stream and a response promise.</p><p>Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).</p> |

---

### Reference Main Generative Ai.Chatsession.Model (`docs/reference/main/generative-ai.chatsession.model.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ChatSession](./generative-ai.chatsession.md) &gt; [model](./generative-ai.chatsession.model.md)

## ChatSession.model property

**Signature:**

```typescript
model: string;
```

---

### Reference Main Generative Ai.Chatsession.Params (`docs/reference/main/generative-ai.chatsession.params.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ChatSession](./generative-ai.chatsession.md) &gt; [params](./generative-ai.chatsession.params.md)

## ChatSession.params property

**Signature:**

```typescript
params?: StartChatParams;
```

---

### Reference Main Generative Ai.Chatsession.Sendmessage (`docs/reference/main/generative-ai.chatsession.sendmessage.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ChatSession](./generative-ai.chatsession.md) &gt; [sendMessage](./generative-ai.chatsession.sendmessage.md)

## ChatSession.sendMessage() method

Sends a chat message and receives a non-streaming [GenerateContentResult](./generative-ai.generatecontentresult.md).

Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).

**Signature:**

```typescript
sendMessage(request: string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentResult>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  request | string \| Array&lt;string \| [Part](./generative-ai.part.md)&gt; |  |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[GenerateContentResult](./generative-ai.generatecontentresult.md)&gt;

---

### Reference Main Generative Ai.Chatsession.Sendmessagestream (`docs/reference/main/generative-ai.chatsession.sendmessagestream.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ChatSession](./generative-ai.chatsession.md) &gt; [sendMessageStream](./generative-ai.chatsession.sendmessagestream.md)

## ChatSession.sendMessageStream() method

Sends a chat message and receives the response as a [GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md) containing an iterable stream and a response promise.

Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).

**Signature:**

```typescript
sendMessageStream(request: string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentStreamResult>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  request | string \| Array&lt;string \| [Part](./generative-ai.part.md)&gt; |  |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md)&gt;

---

### Reference Main Generative Ai.Citationmetadata.Citationsources (`docs/reference/main/generative-ai.citationmetadata.citationsources.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CitationMetadata](./generative-ai.citationmetadata.md) &gt; [citationSources](./generative-ai.citationmetadata.citationsources.md)

## CitationMetadata.citationSources property

**Signature:**

```typescript
citationSources: CitationSource[];
```

---

### Reference Main Generative Ai.Citationmetadata (`docs/reference/main/generative-ai.citationmetadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CitationMetadata](./generative-ai.citationmetadata.md)

## CitationMetadata interface

Citation metadata that may be found on a [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md).

**Signature:**

```typescript
export interface CitationMetadata 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [citationSources](./generative-ai.citationmetadata.citationsources.md) |  | [CitationSource](./generative-ai.citationsource.md)\[\] |  |

---

### Reference Main Generative Ai.Citationsource.License (`docs/reference/main/generative-ai.citationsource.license.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CitationSource](./generative-ai.citationsource.md) &gt; [license](./generative-ai.citationsource.license.md)

## CitationSource.license property

**Signature:**

```typescript
license?: string;
```

---

### Reference Main Generative Ai.Citationsource (`docs/reference/main/generative-ai.citationsource.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CitationSource](./generative-ai.citationsource.md)

## CitationSource interface

A single citation source.

**Signature:**

```typescript
export interface CitationSource 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [endIndex?](./generative-ai.citationsource.endindex.md) |  | number | _(Optional)_ |
|  [license?](./generative-ai.citationsource.license.md) |  | string | _(Optional)_ |
|  [startIndex?](./generative-ai.citationsource.startindex.md) |  | number | _(Optional)_ |
|  [uri?](./generative-ai.citationsource.uri.md) |  | string | _(Optional)_ |

---

### Reference Main Generative Ai.Citationsource.Uri (`docs/reference/main/generative-ai.citationsource.uri.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CitationSource](./generative-ai.citationsource.md) &gt; [uri](./generative-ai.citationsource.uri.md)

## CitationSource.uri property

**Signature:**

```typescript
uri?: string;
```

---

### Reference Main Generative Ai.Codeexecutionresult (`docs/reference/main/generative-ai.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResult](./generative-ai.codeexecutionresult.md)

## CodeExecutionResult interface

Result of executing the `ExecutableCode`. Only generated when using code execution, and always follows a `Part` containing the `ExecutableCode`.

**Signature:**

```typescript
export interface CodeExecutionResult 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [outcome](./generative-ai.codeexecutionresult.outcome.md) |  | [Outcome](./generative-ai.outcome.md) | Outcome of the code execution. |
|  [output](./generative-ai.codeexecutionresult.output.md) |  | string | Contains stdout when code execution is successful, stderr or other description otherwise. |

---

### Reference Main Generative Ai.Codeexecutionresult.Outcome (`docs/reference/main/generative-ai.codeexecutionresult.outcome.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResult](./generative-ai.codeexecutionresult.md) &gt; [outcome](./generative-ai.codeexecutionresult.outcome.md)

## CodeExecutionResult.outcome property

Outcome of the code execution.

**Signature:**

```typescript
outcome: Outcome;
```

---

### Reference Main Generative Ai.Codeexecutionresult.Output (`docs/reference/main/generative-ai.codeexecutionresult.output.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResult](./generative-ai.codeexecutionresult.md) &gt; [output](./generative-ai.codeexecutionresult.output.md)

## CodeExecutionResult.output property

Contains stdout when code execution is successful, stderr or other description otherwise.

**Signature:**

```typescript
output: string;
```

---

### Reference Main Generative Ai.Codeexecutionresultpart.Codeexecutionresult (`docs/reference/main/generative-ai.codeexecutionresultpart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [codeExecutionResult](./generative-ai.codeexecutionresultpart.codeexecutionresult.md)

## CodeExecutionResultPart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult: CodeExecutionResult;
```

---

### Reference Main Generative Ai.Codeexecutionresultpart.Executablecode (`docs/reference/main/generative-ai.codeexecutionresultpart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [executableCode](./generative-ai.codeexecutionresultpart.executablecode.md)

## CodeExecutionResultPart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Main Generative Ai.Codeexecutionresultpart.Filedata (`docs/reference/main/generative-ai.codeexecutionresultpart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [fileData](./generative-ai.codeexecutionresultpart.filedata.md)

## CodeExecutionResultPart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Main Generative Ai.Codeexecutionresultpart.Functioncall (`docs/reference/main/generative-ai.codeexecutionresultpart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [functionCall](./generative-ai.codeexecutionresultpart.functioncall.md)

## CodeExecutionResultPart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Main Generative Ai.Codeexecutionresultpart.Functionresponse (`docs/reference/main/generative-ai.codeexecutionresultpart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [functionResponse](./generative-ai.codeexecutionresultpart.functionresponse.md)

## CodeExecutionResultPart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Main Generative Ai.Codeexecutionresultpart.Inlinedata (`docs/reference/main/generative-ai.codeexecutionresultpart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [inlineData](./generative-ai.codeexecutionresultpart.inlinedata.md)

## CodeExecutionResultPart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Main Generative Ai.Codeexecutionresultpart (`docs/reference/main/generative-ai.codeexecutionresultpart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md)

## CodeExecutionResultPart interface

Content part containing the result of executed code.

**Signature:**

```typescript
export interface CodeExecutionResultPart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult](./generative-ai.codeexecutionresultpart.codeexecutionresult.md) |  | [CodeExecutionResult](./generative-ai.codeexecutionresult.md) |  |
|  [executableCode?](./generative-ai.codeexecutionresultpart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData?](./generative-ai.codeexecutionresultpart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall?](./generative-ai.codeexecutionresultpart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse?](./generative-ai.codeexecutionresultpart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData?](./generative-ai.codeexecutionresultpart.inlinedata.md) |  | never | _(Optional)_ |
|  [text?](./generative-ai.codeexecutionresultpart.text.md) |  | never | _(Optional)_ |

---

### Reference Main Generative Ai.Codeexecutionresultpart.Text (`docs/reference/main/generative-ai.codeexecutionresultpart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [text](./generative-ai.codeexecutionresultpart.text.md)

## CodeExecutionResultPart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Main Generative Ai.Codeexecutiontool.Codeexecution (`docs/reference/main/generative-ai.codeexecutiontool.codeexecution.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionTool](./generative-ai.codeexecutiontool.md) &gt; [codeExecution](./generative-ai.codeexecutiontool.codeexecution.md)

## CodeExecutionTool.codeExecution property

Provide an empty object to enable code execution. This field may have subfields added in the future.

**Signature:**

```typescript
codeExecution: {};
```

---

### Reference Main Generative Ai.Codeexecutiontool (`docs/reference/main/generative-ai.codeexecutiontool.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionTool](./generative-ai.codeexecutiontool.md)

## CodeExecutionTool interface

Enables the model to execute code as part of generation.

**Signature:**

```typescript
export interface CodeExecutionTool 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecution](./generative-ai.codeexecutiontool.codeexecution.md) |  | {} | Provide an empty object to enable code execution. This field may have subfields added in the future. |

---

### Reference Main Generative Ai.Content (`docs/reference/main/generative-ai.content.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Content](./generative-ai.content.md)

## Content interface

Content type for both prompts and response candidates.

**Signature:**

```typescript
export interface Content 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [parts](./generative-ai.content.parts.md) |  | [Part](./generative-ai.part.md)\[\] |  |
|  [role](./generative-ai.content.role.md) |  | string |  |

---

### Reference Main Generative Ai.Content.Parts (`docs/reference/main/generative-ai.content.parts.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Content](./generative-ai.content.md) &gt; [parts](./generative-ai.content.parts.md)

## Content.parts property

**Signature:**

```typescript
parts: Part[];
```

---

### Reference Main Generative Ai.Content.Role (`docs/reference/main/generative-ai.content.role.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Content](./generative-ai.content.md) &gt; [role](./generative-ai.content.role.md)

## Content.role property

**Signature:**

```typescript
role: string;
```

---

### Reference Main Generative Ai.Contentembedding (`docs/reference/main/generative-ai.contentembedding.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ContentEmbedding](./generative-ai.contentembedding.md)

## ContentEmbedding interface

A single content embedding.

**Signature:**

```typescript
export interface ContentEmbedding 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [values](./generative-ai.contentembedding.values.md) |  | number\[\] |  |

---

### Reference Main Generative Ai.Contentembedding.Values (`docs/reference/main/generative-ai.contentembedding.values.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ContentEmbedding](./generative-ai.contentembedding.md) &gt; [values](./generative-ai.contentembedding.values.md)

## ContentEmbedding.values property

**Signature:**

```typescript
values: number[];
```

---

### Reference Main Generative Ai.Counttokensrequest.Contents (`docs/reference/main/generative-ai.counttokensrequest.contents.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CountTokensRequest](./generative-ai.counttokensrequest.md) &gt; [contents](./generative-ai.counttokensrequest.contents.md)

## CountTokensRequest.contents property

**Signature:**

```typescript
contents?: Content[];
```

---

### Reference Main Generative Ai.Counttokensrequest.Generatecontentrequest (`docs/reference/main/generative-ai.counttokensrequest.generatecontentrequest.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CountTokensRequest](./generative-ai.counttokensrequest.md) &gt; [generateContentRequest](./generative-ai.counttokensrequest.generatecontentrequest.md)

## CountTokensRequest.generateContentRequest property

**Signature:**

```typescript
generateContentRequest?: GenerateContentRequest;
```

---

### Reference Main Generative Ai.Counttokensrequest (`docs/reference/main/generative-ai.counttokensrequest.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CountTokensRequest](./generative-ai.counttokensrequest.md)

## CountTokensRequest interface

Params for calling [GenerativeModel.countTokens()](./generative-ai.generativemodel.counttokens.md).

The request must contain either a [Content](./generative-ai.content.md) array or a [GenerateContentRequest](./generative-ai.generatecontentrequest.md), but not both. If both are provided then a [GoogleGenerativeAIRequestInputError](./generative-ai.googlegenerativeairequestinputerror.md) is thrown.

**Signature:**

```typescript
export interface CountTokensRequest 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [contents?](./generative-ai.counttokensrequest.contents.md) |  | [Content](./generative-ai.content.md)\[\] | _(Optional)_ |
|  [generateContentRequest?](./generative-ai.counttokensrequest.generatecontentrequest.md) |  | [GenerateContentRequest](./generative-ai.generatecontentrequest.md) | _(Optional)_ |

---

### Reference Main Generative Ai.Counttokensresponse (`docs/reference/main/generative-ai.counttokensresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CountTokensResponse](./generative-ai.counttokensresponse.md)

## CountTokensResponse interface

Response from calling [GenerativeModel.countTokens()](./generative-ai.generativemodel.counttokens.md).

**Signature:**

```typescript
export interface CountTokensResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [totalTokens](./generative-ai.counttokensresponse.totaltokens.md) |  | number |  |

---

### Reference Main Generative Ai.Counttokensresponse.Totaltokens (`docs/reference/main/generative-ai.counttokensresponse.totaltokens.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CountTokensResponse](./generative-ai.counttokensresponse.md) &gt; [totalTokens](./generative-ai.counttokensresponse.totaltokens.md)

## CountTokensResponse.totalTokens property

**Signature:**

```typescript
totalTokens: number;
```

---

### Reference Main Generative Ai.Dynamicretrievalconfig.Dynamicthreshold (`docs/reference/main/generative-ai.dynamicretrievalconfig.dynamicthreshold.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [DynamicRetrievalConfig](./generative-ai.dynamicretrievalconfig.md) &gt; [dynamicThreshold](./generative-ai.dynamicretrievalconfig.dynamicthreshold.md)

## DynamicRetrievalConfig.dynamicThreshold property

The threshold to be used in dynamic retrieval. If not set, a system default value is used.

**Signature:**

```typescript
dynamicThreshold?: number;
```

---

### Reference Main Generative Ai.Dynamicretrievalconfig (`docs/reference/main/generative-ai.dynamicretrievalconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [DynamicRetrievalConfig](./generative-ai.dynamicretrievalconfig.md)

## DynamicRetrievalConfig interface

Specifies the dynamic retrieval configuration for the given source.

**Signature:**

```typescript
export declare interface DynamicRetrievalConfig 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [dynamicThreshold?](./generative-ai.dynamicretrievalconfig.dynamicthreshold.md) |  | number | _(Optional)_ The threshold to be used in dynamic retrieval. If not set, a system default value is used. |
|  [mode?](./generative-ai.dynamicretrievalconfig.mode.md) |  | [DynamicRetrievalMode](./generative-ai.dynamicretrievalmode.md) | _(Optional)_ The mode of the predictor to be used in dynamic retrieval. |

---

### Reference Main Generative Ai.Dynamicretrievalconfig.Mode (`docs/reference/main/generative-ai.dynamicretrievalconfig.mode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [DynamicRetrievalConfig](./generative-ai.dynamicretrievalconfig.md) &gt; [mode](./generative-ai.dynamicretrievalconfig.mode.md)

## DynamicRetrievalConfig.mode property

The mode of the predictor to be used in dynamic retrieval.

**Signature:**

```typescript
mode?: DynamicRetrievalMode;
```

---

### Reference Main Generative Ai.Dynamicretrievalmode (`docs/reference/main/generative-ai.dynamicretrievalmode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [DynamicRetrievalMode](./generative-ai.dynamicretrievalmode.md)

## DynamicRetrievalMode enum

The mode of the predictor to be used in dynamic retrieval.

**Signature:**

```typescript
export declare enum DynamicRetrievalMode 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  MODE\_DYNAMIC | <code>&quot;MODE_DYNAMIC&quot;</code> |  |
|  MODE\_UNSPECIFIED | <code>&quot;MODE_UNSPECIFIED&quot;</code> |  |

---

### Reference Main Generative Ai.Embedcontentrequest.Content (`docs/reference/main/generative-ai.embedcontentrequest.content.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EmbedContentRequest](./generative-ai.embedcontentrequest.md) &gt; [content](./generative-ai.embedcontentrequest.content.md)

## EmbedContentRequest.content property

**Signature:**

```typescript
content: Content;
```

---

### Reference Main Generative Ai.Embedcontentrequest (`docs/reference/main/generative-ai.embedcontentrequest.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EmbedContentRequest](./generative-ai.embedcontentrequest.md)

## EmbedContentRequest interface

Params for calling [GenerativeModel.embedContent()](./generative-ai.generativemodel.embedcontent.md)

**Signature:**

```typescript
export interface EmbedContentRequest 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [content](./generative-ai.embedcontentrequest.content.md) |  | [Content](./generative-ai.content.md) |  |
|  [taskType?](./generative-ai.embedcontentrequest.tasktype.md) |  | [TaskType](./generative-ai.tasktype.md) | _(Optional)_ |
|  [title?](./generative-ai.embedcontentrequest.title.md) |  | string | _(Optional)_ |

---

### Reference Main Generative Ai.Embedcontentrequest.Tasktype (`docs/reference/main/generative-ai.embedcontentrequest.tasktype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EmbedContentRequest](./generative-ai.embedcontentrequest.md) &gt; [taskType](./generative-ai.embedcontentrequest.tasktype.md)

## EmbedContentRequest.taskType property

**Signature:**

```typescript
taskType?: TaskType;
```

---

### Reference Main Generative Ai.Embedcontentrequest.Title (`docs/reference/main/generative-ai.embedcontentrequest.title.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EmbedContentRequest](./generative-ai.embedcontentrequest.md) &gt; [title](./generative-ai.embedcontentrequest.title.md)

## EmbedContentRequest.title property

**Signature:**

```typescript
title?: string;
```

---

### Reference Main Generative Ai.Embedcontentresponse.Embedding (`docs/reference/main/generative-ai.embedcontentresponse.embedding.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EmbedContentResponse](./generative-ai.embedcontentresponse.md) &gt; [embedding](./generative-ai.embedcontentresponse.embedding.md)

## EmbedContentResponse.embedding property

**Signature:**

```typescript
embedding: ContentEmbedding;
```

---

### Reference Main Generative Ai.Embedcontentresponse (`docs/reference/main/generative-ai.embedcontentresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EmbedContentResponse](./generative-ai.embedcontentresponse.md)

## EmbedContentResponse interface

Response from calling [GenerativeModel.embedContent()](./generative-ai.generativemodel.embedcontent.md).

**Signature:**

```typescript
export interface EmbedContentResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [embedding](./generative-ai.embedcontentresponse.embedding.md) |  | [ContentEmbedding](./generative-ai.contentembedding.md) |  |

---

### Reference Main Generative Ai.Enhancedgeneratecontentresponse.Functioncall (`docs/reference/main/generative-ai.enhancedgeneratecontentresponse.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md) &gt; [functionCall](./generative-ai.enhancedgeneratecontentresponse.functioncall.md)

## EnhancedGenerateContentResponse.functionCall property

> Warning: This API is now obsolete.
> 
> - use `functionCalls()` instead
> 

Deprecated: use `functionCalls()` instead.

**Signature:**

```typescript
functionCall: () => FunctionCall | undefined;
```

---

### Reference Main Generative Ai.Enhancedgeneratecontentresponse.Functioncalls (`docs/reference/main/generative-ai.enhancedgeneratecontentresponse.functioncalls.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md) &gt; [functionCalls](./generative-ai.enhancedgeneratecontentresponse.functioncalls.md)

## EnhancedGenerateContentResponse.functionCalls property

Returns function calls found in any `Part`s of the first candidate of the response, if available. Throws if the prompt or candidate was blocked.

**Signature:**

```typescript
functionCalls: () => FunctionCall[] | undefined;
```

---

### Reference Main Generative Ai.Enhancedgeneratecontentresponse (`docs/reference/main/generative-ai.enhancedgeneratecontentresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md)

## EnhancedGenerateContentResponse interface

Response object wrapped with helper methods.

**Signature:**

```typescript
export interface EnhancedGenerateContentResponse extends GenerateContentResponse 
```
**Extends:** [GenerateContentResponse](./generative-ai.generatecontentresponse.md)

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [functionCall](./generative-ai.enhancedgeneratecontentresponse.functioncall.md) |  | () =&gt; [FunctionCall](./generative-ai.functioncall.md) \| undefined | Deprecated: use <code>functionCalls()</code> instead. |
|  [functionCalls](./generative-ai.enhancedgeneratecontentresponse.functioncalls.md) |  | () =&gt; [FunctionCall](./generative-ai.functioncall.md)\[\] \| undefined | Returns function calls found in any <code>Part</code>s of the first candidate of the response, if available. Throws if the prompt or candidate was blocked. |
|  [text](./generative-ai.enhancedgeneratecontentresponse.text.md) |  | () =&gt; string | Returns the text string assembled from all <code>Part</code>s of the first candidate of the response, if available. Throws if the prompt or candidate was blocked. |

---

### Reference Main Generative Ai.Enhancedgeneratecontentresponse.Text (`docs/reference/main/generative-ai.enhancedgeneratecontentresponse.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md) &gt; [text](./generative-ai.enhancedgeneratecontentresponse.text.md)

## EnhancedGenerateContentResponse.text property

Returns the text string assembled from all `Part`s of the first candidate of the response, if available. Throws if the prompt or candidate was blocked.

**Signature:**

```typescript
text: () => string;
```

---

### Reference Main Generative Ai.Enumstringschema.Enum (`docs/reference/main/generative-ai.enumstringschema.enum.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnumStringSchema](./generative-ai.enumstringschema.md) &gt; [enum](./generative-ai.enumstringschema.enum.md)

## EnumStringSchema.enum property

Possible values for this enum

**Signature:**

```typescript
enum: string[];
```

---

### Reference Main Generative Ai.Enumstringschema.Format (`docs/reference/main/generative-ai.enumstringschema.format.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnumStringSchema](./generative-ai.enumstringschema.md) &gt; [format](./generative-ai.enumstringschema.format.md)

## EnumStringSchema.format property

**Signature:**

```typescript
format: "enum";
```

---

### Reference Main Generative Ai.Enumstringschema (`docs/reference/main/generative-ai.enumstringschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnumStringSchema](./generative-ai.enumstringschema.md)

## EnumStringSchema interface

Describes a string enum

**Signature:**

```typescript
export interface EnumStringSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [enum](./generative-ai.enumstringschema.enum.md) |  | string\[\] | Possible values for this enum |
|  [format](./generative-ai.enumstringschema.format.md) |  | "enum" |  |
|  [type](./generative-ai.enumstringschema.type.md) |  | typeof [SchemaType.STRING](./generative-ai.schematype.md) |  |

---

### Reference Main Generative Ai.Enumstringschema.Type (`docs/reference/main/generative-ai.enumstringschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnumStringSchema](./generative-ai.enumstringschema.md) &gt; [type](./generative-ai.enumstringschema.type.md)

## EnumStringSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.STRING;
```

---

### Reference Main Generative Ai.Errordetails.  Type  (`docs/reference/main/generative-ai.errordetails.__type_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; ["@type"](./generative-ai.errordetails.__type_.md)

## ErrorDetails."@type" property

**Signature:**

```typescript
"@type"?: string;
```

---

### Reference Main Generative Ai.Errordetails.Domain (`docs/reference/main/generative-ai.errordetails.domain.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; [domain](./generative-ai.errordetails.domain.md)

## ErrorDetails.domain property

**Signature:**

```typescript
domain?: string;
```

---

### Reference Main Generative Ai.Errordetails (`docs/reference/main/generative-ai.errordetails.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md)

## ErrorDetails interface

Details object that may be included in an error response.

**Signature:**

```typescript
export interface ErrorDetails 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  ["@type"?](./generative-ai.errordetails.__type_.md) |  | string | _(Optional)_ |
|  [domain?](./generative-ai.errordetails.domain.md) |  | string | _(Optional)_ |
|  [metadata?](./generative-ai.errordetails.metadata.md) |  | Record&lt;string, unknown&gt; | _(Optional)_ |
|  [reason?](./generative-ai.errordetails.reason.md) |  | string | _(Optional)_ |

---

### Reference Main Generative Ai.Errordetails.Metadata (`docs/reference/main/generative-ai.errordetails.metadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; [metadata](./generative-ai.errordetails.metadata.md)

## ErrorDetails.metadata property

**Signature:**

```typescript
metadata?: Record<string, unknown>;
```

---

### Reference Main Generative Ai.Errordetails.Reason (`docs/reference/main/generative-ai.errordetails.reason.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; [reason](./generative-ai.errordetails.reason.md)

## ErrorDetails.reason property

**Signature:**

```typescript
reason?: string;
```

---

### Reference Main Generative Ai.Executablecode.Code (`docs/reference/main/generative-ai.executablecode.code.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCode](./generative-ai.executablecode.md) &gt; [code](./generative-ai.executablecode.code.md)

## ExecutableCode.code property

The code to be executed.

**Signature:**

```typescript
code: string;
```

---

### Reference Main Generative Ai.Executablecode.Language (`docs/reference/main/generative-ai.executablecode.language.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCode](./generative-ai.executablecode.md) &gt; [language](./generative-ai.executablecode.language.md)

## ExecutableCode.language property

Programming language of the `code`.

**Signature:**

```typescript
language: ExecutableCodeLanguage;
```

---

### Reference Main Generative Ai.Executablecode (`docs/reference/main/generative-ai.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCode](./generative-ai.executablecode.md)

## ExecutableCode interface

Code generated by the model that is meant to be executed, where the result is returned to the model. Only generated when using the code execution tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.

**Signature:**

```typescript
export interface ExecutableCode 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [code](./generative-ai.executablecode.code.md) |  | string | The code to be executed. |
|  [language](./generative-ai.executablecode.language.md) |  | [ExecutableCodeLanguage](./generative-ai.executablecodelanguage.md) | Programming language of the <code>code</code>. |

---

### Reference Main Generative Ai.Executablecodelanguage (`docs/reference/main/generative-ai.executablecodelanguage.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodeLanguage](./generative-ai.executablecodelanguage.md)

## ExecutableCodeLanguage enum


**Signature:**

```typescript
export declare enum ExecutableCodeLanguage 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  LANGUAGE\_UNSPECIFIED | <code>&quot;language_unspecified&quot;</code> |  |
|  PYTHON | <code>&quot;python&quot;</code> |  |

---

### Reference Main Generative Ai.Executablecodepart.Codeexecutionresult (`docs/reference/main/generative-ai.executablecodepart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [codeExecutionResult](./generative-ai.executablecodepart.codeexecutionresult.md)

## ExecutableCodePart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Main Generative Ai.Executablecodepart.Executablecode (`docs/reference/main/generative-ai.executablecodepart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [executableCode](./generative-ai.executablecodepart.executablecode.md)

## ExecutableCodePart.executableCode property

**Signature:**

```typescript
executableCode: ExecutableCode;
```

---

### Reference Main Generative Ai.Executablecodepart.Filedata (`docs/reference/main/generative-ai.executablecodepart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [fileData](./generative-ai.executablecodepart.filedata.md)

## ExecutableCodePart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Main Generative Ai.Executablecodepart.Functioncall (`docs/reference/main/generative-ai.executablecodepart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [functionCall](./generative-ai.executablecodepart.functioncall.md)

## ExecutableCodePart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Main Generative Ai.Executablecodepart.Functionresponse (`docs/reference/main/generative-ai.executablecodepart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [functionResponse](./generative-ai.executablecodepart.functionresponse.md)

## ExecutableCodePart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Main Generative Ai.Executablecodepart.Inlinedata (`docs/reference/main/generative-ai.executablecodepart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [inlineData](./generative-ai.executablecodepart.inlinedata.md)

## ExecutableCodePart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Main Generative Ai.Executablecodepart (`docs/reference/main/generative-ai.executablecodepart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md)

## ExecutableCodePart interface

Content part containing executable code generated by the model.

**Signature:**

```typescript
export interface ExecutableCodePart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.executablecodepart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode](./generative-ai.executablecodepart.executablecode.md) |  | [ExecutableCode](./generative-ai.executablecode.md) |  |
|  [fileData?](./generative-ai.executablecodepart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall?](./generative-ai.executablecodepart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse?](./generative-ai.executablecodepart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData?](./generative-ai.executablecodepart.inlinedata.md) |  | never | _(Optional)_ |
|  [text?](./generative-ai.executablecodepart.text.md) |  | never | _(Optional)_ |

---

### Reference Main Generative Ai.Executablecodepart.Text (`docs/reference/main/generative-ai.executablecodepart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [text](./generative-ai.executablecodepart.text.md)

## ExecutableCodePart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Main Generative Ai.Filedata.Fileuri (`docs/reference/main/generative-ai.filedata.fileuri.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileData](./generative-ai.filedata.md) &gt; [fileUri](./generative-ai.filedata.fileuri.md)

## FileData.fileUri property

**Signature:**

```typescript
fileUri: string;
```

---

### Reference Main Generative Ai.Filedata (`docs/reference/main/generative-ai.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileData](./generative-ai.filedata.md)

## FileData interface

Data pointing to a file uploaded with the Files API.

**Signature:**

```typescript
export interface FileData 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [fileUri](./generative-ai.filedata.fileuri.md) |  | string |  |
|  [mimeType](./generative-ai.filedata.mimetype.md) |  | string |  |

---

### Reference Main Generative Ai.Filedata.Mimetype (`docs/reference/main/generative-ai.filedata.mimetype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileData](./generative-ai.filedata.md) &gt; [mimeType](./generative-ai.filedata.mimetype.md)

## FileData.mimeType property

**Signature:**

```typescript
mimeType: string;
```

---

### Reference Main Generative Ai.Filedatapart.Codeexecutionresult (`docs/reference/main/generative-ai.filedatapart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [codeExecutionResult](./generative-ai.filedatapart.codeexecutionresult.md)

## FileDataPart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Main Generative Ai.Filedatapart.Executablecode (`docs/reference/main/generative-ai.filedatapart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [executableCode](./generative-ai.filedatapart.executablecode.md)

## FileDataPart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Main Generative Ai.Filedatapart.Filedata (`docs/reference/main/generative-ai.filedatapart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [fileData](./generative-ai.filedatapart.filedata.md)

## FileDataPart.fileData property

**Signature:**

```typescript
fileData: FileData;
```

---

### Reference Main Generative Ai.Filedatapart.Functioncall (`docs/reference/main/generative-ai.filedatapart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [functionCall](./generative-ai.filedatapart.functioncall.md)

## FileDataPart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Main Generative Ai.Filedatapart.Functionresponse (`docs/reference/main/generative-ai.filedatapart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [functionResponse](./generative-ai.filedatapart.functionresponse.md)

## FileDataPart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Main Generative Ai.Filedatapart.Inlinedata (`docs/reference/main/generative-ai.filedatapart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [inlineData](./generative-ai.filedatapart.inlinedata.md)

## FileDataPart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Main Generative Ai.Filedatapart (`docs/reference/main/generative-ai.filedatapart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md)

## FileDataPart interface

Content part interface if the part represents FileData.

**Signature:**

```typescript
export interface FileDataPart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.filedatapart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode?](./generative-ai.filedatapart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData](./generative-ai.filedatapart.filedata.md) |  | [FileData](./generative-ai.filedata.md) |  |
|  [functionCall?](./generative-ai.filedatapart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse?](./generative-ai.filedatapart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData?](./generative-ai.filedatapart.inlinedata.md) |  | never | _(Optional)_ |
|  [text?](./generative-ai.filedatapart.text.md) |  | never | _(Optional)_ |

---

### Reference Main Generative Ai.Filedatapart.Text (`docs/reference/main/generative-ai.filedatapart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [text](./generative-ai.filedatapart.text.md)

## FileDataPart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Main Generative Ai.Finishreason (`docs/reference/main/generative-ai.finishreason.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FinishReason](./generative-ai.finishreason.md)

## FinishReason enum

Reason that a candidate finished.

**Signature:**

```typescript
export declare enum FinishReason 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  BLOCKLIST | <code>&quot;BLOCKLIST&quot;</code> |  |
|  FINISH\_REASON\_UNSPECIFIED | <code>&quot;FINISH_REASON_UNSPECIFIED&quot;</code> |  |
|  LANGUAGE | <code>&quot;LANGUAGE&quot;</code> |  |
|  MALFORMED\_FUNCTION\_CALL | <code>&quot;MALFORMED_FUNCTION_CALL&quot;</code> |  |
|  MAX\_TOKENS | <code>&quot;MAX_TOKENS&quot;</code> |  |
|  OTHER | <code>&quot;OTHER&quot;</code> |  |
|  PROHIBITED\_CONTENT | <code>&quot;PROHIBITED_CONTENT&quot;</code> |  |
|  RECITATION | <code>&quot;RECITATION&quot;</code> |  |
|  SAFETY | <code>&quot;SAFETY&quot;</code> |  |
|  SPII | <code>&quot;SPII&quot;</code> |  |
|  STOP | <code>&quot;STOP&quot;</code> |  |

---

### Reference Main Generative Ai.Functioncall.Args (`docs/reference/main/generative-ai.functioncall.args.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCall](./generative-ai.functioncall.md) &gt; [args](./generative-ai.functioncall.args.md)

## FunctionCall.args property

**Signature:**

```typescript
args: object;
```

---

### Reference Main Generative Ai.Functioncall (`docs/reference/main/generative-ai.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCall](./generative-ai.functioncall.md)

## FunctionCall interface

A predicted \[FunctionCall\] returned from the model that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing the parameters and their values.

**Signature:**

```typescript
export interface FunctionCall 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [args](./generative-ai.functioncall.args.md) |  | object |  |
|  [name](./generative-ai.functioncall.name.md) |  | string |  |

---

### Reference Main Generative Ai.Functioncall.Name (`docs/reference/main/generative-ai.functioncall.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCall](./generative-ai.functioncall.md) &gt; [name](./generative-ai.functioncall.name.md)

## FunctionCall.name property

**Signature:**

```typescript
name: string;
```

---

### Reference Main Generative Ai.Functioncallingconfig.Allowedfunctionnames (`docs/reference/main/generative-ai.functioncallingconfig.allowedfunctionnames.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallingConfig](./generative-ai.functioncallingconfig.md) &gt; [allowedFunctionNames](./generative-ai.functioncallingconfig.allowedfunctionnames.md)

## FunctionCallingConfig.allowedFunctionNames property

**Signature:**

```typescript
allowedFunctionNames?: string[];
```

---

### Reference Main Generative Ai.Functioncallingconfig (`docs/reference/main/generative-ai.functioncallingconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallingConfig](./generative-ai.functioncallingconfig.md)

## FunctionCallingConfig interface


**Signature:**

```typescript
export interface FunctionCallingConfig 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [allowedFunctionNames?](./generative-ai.functioncallingconfig.allowedfunctionnames.md) |  | string\[\] | _(Optional)_ |
|  [mode?](./generative-ai.functioncallingconfig.mode.md) |  | [FunctionCallingMode](./generative-ai.functioncallingmode.md) | _(Optional)_ |

---

### Reference Main Generative Ai.Functioncallingconfig.Mode (`docs/reference/main/generative-ai.functioncallingconfig.mode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallingConfig](./generative-ai.functioncallingconfig.md) &gt; [mode](./generative-ai.functioncallingconfig.mode.md)

## FunctionCallingConfig.mode property

**Signature:**

```typescript
mode?: FunctionCallingMode;
```

---

### Reference Main Generative Ai.Functioncallingmode (`docs/reference/main/generative-ai.functioncallingmode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallingMode](./generative-ai.functioncallingmode.md)

## FunctionCallingMode enum


**Signature:**

```typescript
export declare enum FunctionCallingMode 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  ANY | <code>&quot;ANY&quot;</code> |  |
|  AUTO | <code>&quot;AUTO&quot;</code> |  |
|  MODE\_UNSPECIFIED | <code>&quot;MODE_UNSPECIFIED&quot;</code> |  |
|  NONE | <code>&quot;NONE&quot;</code> |  |

---

### Reference Main Generative Ai.Functioncallpart.Codeexecutionresult (`docs/reference/main/generative-ai.functioncallpart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [codeExecutionResult](./generative-ai.functioncallpart.codeexecutionresult.md)

## FunctionCallPart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Main Generative Ai.Functioncallpart.Executablecode (`docs/reference/main/generative-ai.functioncallpart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [executableCode](./generative-ai.functioncallpart.executablecode.md)

## FunctionCallPart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Main Generative Ai.Functioncallpart.Filedata (`docs/reference/main/generative-ai.functioncallpart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [fileData](./generative-ai.functioncallpart.filedata.md)

## FunctionCallPart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Main Generative Ai.Functioncallpart.Functioncall (`docs/reference/main/generative-ai.functioncallpart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [functionCall](./generative-ai.functioncallpart.functioncall.md)

## FunctionCallPart.functionCall property

**Signature:**

```typescript
functionCall: FunctionCall;
```

---

### Reference Main Generative Ai.Functioncallpart.Functionresponse (`docs/reference/main/generative-ai.functioncallpart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [functionResponse](./generative-ai.functioncallpart.functionresponse.md)

## FunctionCallPart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Main Generative Ai.Functioncallpart.Inlinedata (`docs/reference/main/generative-ai.functioncallpart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [inlineData](./generative-ai.functioncallpart.inlinedata.md)

## FunctionCallPart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Main Generative Ai.Functioncallpart (`docs/reference/main/generative-ai.functioncallpart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md)

## FunctionCallPart interface

Content part interface if the part represents a FunctionCall.

**Signature:**

```typescript
export interface FunctionCallPart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.functioncallpart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode?](./generative-ai.functioncallpart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData?](./generative-ai.functioncallpart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall](./generative-ai.functioncallpart.functioncall.md) |  | [FunctionCall](./generative-ai.functioncall.md) |  |
|  [functionResponse?](./generative-ai.functioncallpart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData?](./generative-ai.functioncallpart.inlinedata.md) |  | never | _(Optional)_ |
|  [text?](./generative-ai.functioncallpart.text.md) |  | never | _(Optional)_ |

---

### Reference Main Generative Ai.Functioncallpart.Text (`docs/reference/main/generative-ai.functioncallpart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [text](./generative-ai.functioncallpart.text.md)

## FunctionCallPart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Main Generative Ai.Functiondeclaration.Description (`docs/reference/main/generative-ai.functiondeclaration.description.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclaration](./generative-ai.functiondeclaration.md) &gt; [description](./generative-ai.functiondeclaration.description.md)

## FunctionDeclaration.description property

Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.

**Signature:**

```typescript
description?: string;
```

---

### Reference Main Generative Ai.Functiondeclaration (`docs/reference/main/generative-ai.functiondeclaration.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclaration](./generative-ai.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.

**Signature:**

```typescript
export declare interface FunctionDeclaration 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [description?](./generative-ai.functiondeclaration.description.md) |  | string | _(Optional)_ Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. |
|  [name](./generative-ai.functiondeclaration.name.md) |  | 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?](./generative-ai.functiondeclaration.parameters.md) |  | [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) | _(Optional)_ Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. |

---

### Reference Main Generative Ai.Functiondeclaration.Name (`docs/reference/main/generative-ai.functiondeclaration.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclaration](./generative-ai.functiondeclaration.md) &gt; [name](./generative-ai.functiondeclaration.name.md)

## FunctionDeclaration.name property

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.

**Signature:**

```typescript
name: string;
```

---

### Reference Main Generative Ai.Functiondeclaration.Parameters (`docs/reference/main/generative-ai.functiondeclaration.parameters.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclaration](./generative-ai.functiondeclaration.md) &gt; [parameters](./generative-ai.functiondeclaration.parameters.md)

## FunctionDeclaration.parameters property

Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset.

**Signature:**

```typescript
parameters?: FunctionDeclarationSchema;
```

## Example

with 1 required and 1 optional parameter: type: OBJECT properties:

```
param1:

  type: STRING
param2:

 type: INTEGER
required:

  - param1
```

---

### Reference Main Generative Ai.Functiondeclarationschema.Description (`docs/reference/main/generative-ai.functiondeclarationschema.description.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) &gt; [description](./generative-ai.functiondeclarationschema.description.md)

## FunctionDeclarationSchema.description property

Optional. Description of the parameter.

**Signature:**

```typescript
description?: string;
```

---

### Reference Main Generative Ai.Functiondeclarationschema (`docs/reference/main/generative-ai.functiondeclarationschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md)

## FunctionDeclarationSchema interface

Schema for parameters passed to [FunctionDeclaration.parameters](./generative-ai.functiondeclaration.parameters.md).

**Signature:**

```typescript
export interface FunctionDeclarationSchema 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [description?](./generative-ai.functiondeclarationschema.description.md) |  | string | _(Optional)_ Optional. Description of the parameter. |
|  [properties](./generative-ai.functiondeclarationschema.properties.md) |  | { \[k: string\]: [FunctionDeclarationSchemaProperty](./generative-ai.functiondeclarationschemaproperty.md); } | The format of the parameter. |
|  [required?](./generative-ai.functiondeclarationschema.required.md) |  | string\[\] | _(Optional)_ Optional. Array of required parameters. |
|  [type](./generative-ai.functiondeclarationschema.type.md) |  | [SchemaType](./generative-ai.schematype.md) | The type of the parameter. |

---

### Reference Main Generative Ai.Functiondeclarationschema.Properties (`docs/reference/main/generative-ai.functiondeclarationschema.properties.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) &gt; [properties](./generative-ai.functiondeclarationschema.properties.md)

## FunctionDeclarationSchema.properties property

The format of the parameter.

**Signature:**

```typescript
properties: {
        [k: string]: FunctionDeclarationSchemaProperty;
    };
```

---

### Reference Main Generative Ai.Functiondeclarationschema.Required (`docs/reference/main/generative-ai.functiondeclarationschema.required.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) &gt; [required](./generative-ai.functiondeclarationschema.required.md)

## FunctionDeclarationSchema.required property

Optional. Array of required parameters.

**Signature:**

```typescript
required?: string[];
```

---

### Reference Main Generative Ai.Functiondeclarationschema.Type (`docs/reference/main/generative-ai.functiondeclarationschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) &gt; [type](./generative-ai.functiondeclarationschema.type.md)

## FunctionDeclarationSchema.type property

The type of the parameter.

**Signature:**

```typescript
type: SchemaType;
```

---

### Reference Main Generative Ai.Functiondeclarationschemaproperty (`docs/reference/main/generative-ai.functiondeclarationschemaproperty.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchemaProperty](./generative-ai.functiondeclarationschemaproperty.md)

## FunctionDeclarationSchemaProperty type

Schema for top-level function declaration

**Signature:**

```typescript
export type FunctionDeclarationSchemaProperty = Schema;
```
**References:** [Schema](./generative-ai.schema.md)

---

### Reference Main Generative Ai.Functiondeclarationstool.Functiondeclarations (`docs/reference/main/generative-ai.functiondeclarationstool.functiondeclarations.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationsTool](./generative-ai.functiondeclarationstool.md) &gt; [functionDeclarations](./generative-ai.functiondeclarationstool.functiondeclarations.md)

## FunctionDeclarationsTool.functionDeclarations property

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\]\[content.part.functionCall\] in the response. User should provide a \[FunctionResponse\]\[content.part.functionResponse\] for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

**Signature:**

```typescript
functionDeclarations?: FunctionDeclaration[];
```

---

### Reference Main Generative Ai.Functiondeclarationstool (`docs/reference/main/generative-ai.functiondeclarationstool.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationsTool](./generative-ai.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.

**Signature:**

```typescript
export declare interface FunctionDeclarationsTool 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [functionDeclarations?](./generative-ai.functiondeclarationstool.functiondeclarations.md) |  | [FunctionDeclaration](./generative-ai.functiondeclaration.md)\[\] | _(Optional)_ 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\]\[content.part.functionCall\] in the response. User should provide a \[FunctionResponse\]\[content.part.functionResponse\] for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided. |

---

### Reference Main Generative Ai.Functionresponse (`docs/reference/main/generative-ai.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponse](./generative-ai.functionresponse.md)

## FunctionResponse interface

The result output from a \[FunctionCall\] that contains a string representing the \[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 \[FunctionCall\] made based on model prediction.

**Signature:**

```typescript
export interface FunctionResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [name](./generative-ai.functionresponse.name.md) |  | string |  |
|  [response](./generative-ai.functionresponse.response.md) |  | object |  |

---

### Reference Main Generative Ai.Functionresponse.Name (`docs/reference/main/generative-ai.functionresponse.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponse](./generative-ai.functionresponse.md) &gt; [name](./generative-ai.functionresponse.name.md)

## FunctionResponse.name property

**Signature:**

```typescript
name: string;
```

---

### Reference Main Generative Ai.Functionresponse.Response (`docs/reference/main/generative-ai.functionresponse.response.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponse](./generative-ai.functionresponse.md) &gt; [response](./generative-ai.functionresponse.response.md)

## FunctionResponse.response property

**Signature:**

```typescript
response: object;
```

---

### Reference Main Generative Ai.Functionresponsepart.Codeexecutionresult (`docs/reference/main/generative-ai.functionresponsepart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [codeExecutionResult](./generative-ai.functionresponsepart.codeexecutionresult.md)

## FunctionResponsePart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Main Generative Ai.Functionresponsepart.Executablecode (`docs/reference/main/generative-ai.functionresponsepart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [executableCode](./generative-ai.functionresponsepart.executablecode.md)

## FunctionResponsePart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Main Generative Ai.Functionresponsepart.Filedata (`docs/reference/main/generative-ai.functionresponsepart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [fileData](./generative-ai.functionresponsepart.filedata.md)

## FunctionResponsePart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Main Generative Ai.Functionresponsepart.Functioncall (`docs/reference/main/generative-ai.functionresponsepart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [functionCall](./generative-ai.functionresponsepart.functioncall.md)

## FunctionResponsePart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Main Generative Ai.Functionresponsepart.Functionresponse (`docs/reference/main/generative-ai.functionresponsepart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [functionResponse](./generative-ai.functionresponsepart.functionresponse.md)

## FunctionResponsePart.functionResponse property

**Signature:**

```typescript
functionResponse: FunctionResponse;
```

---

### Reference Main Generative Ai.Functionresponsepart.Inlinedata (`docs/reference/main/generative-ai.functionresponsepart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [inlineData](./generative-ai.functionresponsepart.inlinedata.md)

## FunctionResponsePart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Main Generative Ai.Functionresponsepart (`docs/reference/main/generative-ai.functionresponsepart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md)

## FunctionResponsePart interface

Content part interface if the part represents FunctionResponse.

**Signature:**

```typescript
export interface FunctionResponsePart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.functionresponsepart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode?](./generative-ai.functionresponsepart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData?](./generative-ai.functionresponsepart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall?](./generative-ai.functionresponsepart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse](./generative-ai.functionresponsepart.functionresponse.md) |  | [FunctionResponse](./generative-ai.functionresponse.md) |  |
|  [inlineData?](./generative-ai.functionresponsepart.inlinedata.md) |  | never | _(Optional)_ |
|  [text?](./generative-ai.functionresponsepart.text.md) |  | never | _(Optional)_ |

---

### Reference Main Generative Ai.Functionresponsepart.Text (`docs/reference/main/generative-ai.functionresponsepart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [text](./generative-ai.functionresponsepart.text.md)

## FunctionResponsePart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Main Generative Ai.Generatecontentcandidate.Avglogprobs (`docs/reference/main/generative-ai.generatecontentcandidate.avglogprobs.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) &gt; [avgLogprobs](./generative-ai.generatecontentcandidate.avglogprobs.md)

## GenerateContentCandidate.avgLogprobs property

Average log probability score of the candidate.

**Signature:**

```typescript
avgLogprobs?: number;
```

---

### Reference Main Generative Ai.Generatecontentcandidate.Citationmetadata (`docs/reference/main/generative-ai.generatecontentcandidate.citationmetadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) &gt; [citationMetadata](./generative-ai.generatecontentcandidate.citationmetadata.md)

## GenerateContentCandidate.citationMetadata property

**Signature:**

```typescript
citationMetadata?: CitationMetadata;
```

---

### Reference Main Generative Ai.Generatecontentcandidate.Content (`docs/reference/main/generative-ai.generatecontentcandidate.content.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) &gt; [content](./generative-ai.generatecontentcandidate.content.md)

## GenerateContentCandidate.content property

**Signature:**

```typescript
content: Content;
```

---

### Reference Main Generative Ai.Generatecontentcandidate.Finishmessage (`docs/reference/main/generative-ai.generatecontentcandidate.finishmessage.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) &gt; [finishMessage](./generative-ai.generatecontentcandidate.finishmessage.md)

## GenerateContentCandidate.finishMessage property

**Signature:**

```typescript
finishMessage?: string;
```

---

### Reference Main Generative Ai.Generatecontentcandidate.Finishreason (`docs/reference/main/generative-ai.generatecontentcandidate.finishreason.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) &gt; [finishReason](./generative-ai.generatecontentcandidate.finishreason.md)

## GenerateContentCandidate.finishReason property

**Signature:**

```typescript
finishReason?: FinishReason;
```

---

### Reference Main Generative Ai.Generatecontentcandidate.Groundingmetadata (`docs/reference/main/generative-ai.generatecontentcandidate.groundingmetadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) &gt; [groundingMetadata](./generative-ai.generatecontentcandidate.groundingmetadata.md)

## GenerateContentCandidate.groundingMetadata property

Search grounding metadata.

**Signature:**

```typescript
groundingMetadata?: GroundingMetadata;
```

---

### Reference Main Generative Ai.Generatecontentcandidate.Logprobsresult (`docs/reference/main/generative-ai.generatecontentcandidate.logprobsresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) &gt; [logprobsResult](./generative-ai.generatecontentcandidate.logprobsresult.md)

## GenerateContentCandidate.logprobsResult property

Log-likelihood scores for the response tokens and top tokens.

**Signature:**

```typescript
logprobsResult?: LogprobsResult;
```

---

### Reference Main Generative Ai.Generatecontentcandidate (`docs/reference/main/generative-ai.generatecontentcandidate.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md)

## GenerateContentCandidate interface

A candidate returned as part of a [GenerateContentResponse](./generative-ai.generatecontentresponse.md).

**Signature:**

```typescript
export interface GenerateContentCandidate 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [avgLogprobs?](./generative-ai.generatecontentcandidate.avglogprobs.md) |  | number | _(Optional)_ Average log probability score of the candidate. |
|  [citationMetadata?](./generative-ai.generatecontentcandidate.citationmetadata.md) |  | [CitationMetadata](./generative-ai.citationmetadata.md) | _(Optional)_ |
|  [content](./generative-ai.generatecontentcandidate.content.md) |  | [Content](./generative-ai.content.md) |  |
|  [finishMessage?](./generative-ai.generatecontentcandidate.finishmessage.md) |  | string | _(Optional)_ |
|  [finishReason?](./generative-ai.generatecontentcandidate.finishreason.md) |  | [FinishReason](./generative-ai.finishreason.md) | _(Optional)_ |
|  [groundingMetadata?](./generative-ai.generatecontentcandidate.groundingmetadata.md) |  | [GroundingMetadata](./generative-ai.groundingmetadata.md) | _(Optional)_ Search grounding metadata. |
|  [index](./generative-ai.generatecontentcandidate.index.md) |  | number |  |
|  [logprobsResult?](./generative-ai.generatecontentcandidate.logprobsresult.md) |  | [LogprobsResult](./generative-ai.logprobsresult.md) | _(Optional)_ Log-likelihood scores for the response tokens and top tokens. |
|  [safetyRatings?](./generative-ai.generatecontentcandidate.safetyratings.md) |  | [SafetyRating](./generative-ai.safetyrating.md)\[\] | _(Optional)_ |

---

### Reference Main Generative Ai.Generatecontentcandidate.Safetyratings (`docs/reference/main/generative-ai.generatecontentcandidate.safetyratings.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) &gt; [safetyRatings](./generative-ai.generatecontentcandidate.safetyratings.md)

## GenerateContentCandidate.safetyRatings property

**Signature:**

```typescript
safetyRatings?: SafetyRating[];
```

---

### Reference Main Generative Ai.Generatecontentrequest.Cachedcontent (`docs/reference/main/generative-ai.generatecontentrequest.cachedcontent.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentRequest](./generative-ai.generatecontentrequest.md) &gt; [cachedContent](./generative-ai.generatecontentrequest.cachedcontent.md)

## GenerateContentRequest.cachedContent property

This is the name of a `CachedContent` and not the cache object itself.

**Signature:**

```typescript
cachedContent?: string;
```

---

### Reference Main Generative Ai.Generatecontentrequest.Contents (`docs/reference/main/generative-ai.generatecontentrequest.contents.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentRequest](./generative-ai.generatecontentrequest.md) &gt; [contents](./generative-ai.generatecontentrequest.contents.md)

## GenerateContentRequest.contents property

**Signature:**

```typescript
contents: Content[];
```

---

### Reference Main Generative Ai.Generatecontentrequest (`docs/reference/main/generative-ai.generatecontentrequest.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentRequest](./generative-ai.generatecontentrequest.md)

## GenerateContentRequest interface

Request sent to `generateContent` endpoint.

**Signature:**

```typescript
export interface GenerateContentRequest extends BaseParams 
```
**Extends:** [BaseParams](./generative-ai.baseparams.md)

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [cachedContent?](./generative-ai.generatecontentrequest.cachedcontent.md) |  | string | _(Optional)_ This is the name of a <code>CachedContent</code> and not the cache object itself. |
|  [contents](./generative-ai.generatecontentrequest.contents.md) |  | [Content](./generative-ai.content.md)\[\] |  |
|  [systemInstruction?](./generative-ai.generatecontentrequest.systeminstruction.md) |  | string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) | _(Optional)_ |
|  [toolConfig?](./generative-ai.generatecontentrequest.toolconfig.md) |  | [ToolConfig](./generative-ai.toolconfig.md) | _(Optional)_ |
|  [tools?](./generative-ai.generatecontentrequest.tools.md) |  | [Tool](./generative-ai.tool.md)\[\] | _(Optional)_ |

---

### Reference Main Generative Ai.Generatecontentrequest.Systeminstruction (`docs/reference/main/generative-ai.generatecontentrequest.systeminstruction.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentRequest](./generative-ai.generatecontentrequest.md) &gt; [systemInstruction](./generative-ai.generatecontentrequest.systeminstruction.md)

## GenerateContentRequest.systemInstruction property

**Signature:**

```typescript
systemInstruction?: string | Part | Content;
```

---

### Reference Main Generative Ai.Generatecontentrequest.Toolconfig (`docs/reference/main/generative-ai.generatecontentrequest.toolconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentRequest](./generative-ai.generatecontentrequest.md) &gt; [toolConfig](./generative-ai.generatecontentrequest.toolconfig.md)

## GenerateContentRequest.toolConfig property

**Signature:**

```typescript
toolConfig?: ToolConfig;
```

---

### Reference Main Generative Ai.Generatecontentrequest.Tools (`docs/reference/main/generative-ai.generatecontentrequest.tools.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentRequest](./generative-ai.generatecontentrequest.md) &gt; [tools](./generative-ai.generatecontentrequest.tools.md)

## GenerateContentRequest.tools property

**Signature:**

```typescript
tools?: Tool[];
```

---

### Reference Main Generative Ai.Generatecontentresponse.Candidates (`docs/reference/main/generative-ai.generatecontentresponse.candidates.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentResponse](./generative-ai.generatecontentresponse.md) &gt; [candidates](./generative-ai.generatecontentresponse.candidates.md)

## GenerateContentResponse.candidates property

Candidate responses from the model.

**Signature:**

```typescript
candidates?: GenerateContentCandidate[];
```

---

### Reference Main Generative Ai.Generatecontentresponse (`docs/reference/main/generative-ai.generatecontentresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentResponse](./generative-ai.generatecontentresponse.md)

## GenerateContentResponse interface

Individual response from [GenerativeModel.generateContent()](./generative-ai.generativemodel.generatecontent.md) and [GenerativeModel.generateContentStream()](./generative-ai.generativemodel.generatecontentstream.md). `generateContentStream()` will return one in each chunk until the stream is done.

**Signature:**

```typescript
export interface GenerateContentResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [candidates?](./generative-ai.generatecontentresponse.candidates.md) |  | [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md)\[\] | _(Optional)_ Candidate responses from the model. |
|  [promptFeedback?](./generative-ai.generatecontentresponse.promptfeedback.md) |  | [PromptFeedback](./generative-ai.promptfeedback.md) | _(Optional)_ The prompt's feedback related to the content filters. |
|  [usageMetadata?](./generative-ai.generatecontentresponse.usagemetadata.md) |  | [UsageMetadata](./generative-ai.usagemetadata.md) | _(Optional)_ Metadata on the generation request's token usage. |

---

### Reference Main Generative Ai.Generatecontentresponse.Promptfeedback (`docs/reference/main/generative-ai.generatecontentresponse.promptfeedback.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentResponse](./generative-ai.generatecontentresponse.md) &gt; [promptFeedback](./generative-ai.generatecontentresponse.promptfeedback.md)

## GenerateContentResponse.promptFeedback property

The prompt's feedback related to the content filters.

**Signature:**

```typescript
promptFeedback?: PromptFeedback;
```

---

### Reference Main Generative Ai.Generatecontentresponse.Usagemetadata (`docs/reference/main/generative-ai.generatecontentresponse.usagemetadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentResponse](./generative-ai.generatecontentresponse.md) &gt; [usageMetadata](./generative-ai.generatecontentresponse.usagemetadata.md)

## GenerateContentResponse.usageMetadata property

Metadata on the generation request's token usage.

**Signature:**

```typescript
usageMetadata?: UsageMetadata;
```

---

### Reference Main Generative Ai.Generatecontentresult (`docs/reference/main/generative-ai.generatecontentresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentResult](./generative-ai.generatecontentresult.md)

## GenerateContentResult interface

Result object returned from generateContent() call.

**Signature:**

```typescript
export interface GenerateContentResult 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [response](./generative-ai.generatecontentresult.response.md) |  | [EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md) |  |

---

### Reference Main Generative Ai.Generatecontentresult.Response (`docs/reference/main/generative-ai.generatecontentresult.response.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentResult](./generative-ai.generatecontentresult.md) &gt; [response](./generative-ai.generatecontentresult.response.md)

## GenerateContentResult.response property

**Signature:**

```typescript
response: EnhancedGenerateContentResponse;
```

---

### Reference Main Generative Ai.Generatecontentstreamresult (`docs/reference/main/generative-ai.generatecontentstreamresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md)

## GenerateContentStreamResult interface

Result object returned from generateContentStream() 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:**

```typescript
export interface GenerateContentStreamResult 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [response](./generative-ai.generatecontentstreamresult.response.md) |  | Promise&lt;[EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md)&gt; |  |
|  [stream](./generative-ai.generatecontentstreamresult.stream.md) |  | AsyncGenerator&lt;[EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md)&gt; |  |

---

### Reference Main Generative Ai.Generatecontentstreamresult.Response (`docs/reference/main/generative-ai.generatecontentstreamresult.response.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md) &gt; [response](./generative-ai.generatecontentstreamresult.response.md)

## GenerateContentStreamResult.response property

**Signature:**

```typescript
response: Promise<EnhancedGenerateContentResponse>;
```

---

### Reference Main Generative Ai.Generatecontentstreamresult.Stream (`docs/reference/main/generative-ai.generatecontentstreamresult.stream.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md) &gt; [stream](./generative-ai.generatecontentstreamresult.stream.md)

## GenerateContentStreamResult.stream property

**Signature:**

```typescript
stream: AsyncGenerator<EnhancedGenerateContentResponse>;
```

---

### Reference Main Generative Ai.Generationconfig.Candidatecount (`docs/reference/main/generative-ai.generationconfig.candidatecount.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [candidateCount](./generative-ai.generationconfig.candidatecount.md)

## GenerationConfig.candidateCount property

**Signature:**

```typescript
candidateCount?: number;
```

---

### Reference Main Generative Ai.Generationconfig.Frequencypenalty (`docs/reference/main/generative-ai.generationconfig.frequencypenalty.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [frequencyPenalty](./generative-ai.generationconfig.frequencypenalty.md)

## GenerationConfig.frequencyPenalty property

Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far.

**Signature:**

```typescript
frequencyPenalty?: number;
```

---

### Reference Main Generative Ai.Generationconfig.Logprobs (`docs/reference/main/generative-ai.generationconfig.logprobs.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [logprobs](./generative-ai.generationconfig.logprobs.md)

## GenerationConfig.logprobs property

Valid if responseLogProbs is set to True. This will set the number of top logprobs to return at each decoding step in the logprobsResult.

**Signature:**

```typescript
logprobs?: number;
```

---

### Reference Main Generative Ai.Generationconfig.Maxoutputtokens (`docs/reference/main/generative-ai.generationconfig.maxoutputtokens.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [maxOutputTokens](./generative-ai.generationconfig.maxoutputtokens.md)

## GenerationConfig.maxOutputTokens property

**Signature:**

```typescript
maxOutputTokens?: number;
```

---

### Reference Main Generative Ai.Generationconfig (`docs/reference/main/generative-ai.generationconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md)

## GenerationConfig interface

Config options for content-related requests

**Signature:**

```typescript
export interface GenerationConfig 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [candidateCount?](./generative-ai.generationconfig.candidatecount.md) |  | number | _(Optional)_ |
|  [frequencyPenalty?](./generative-ai.generationconfig.frequencypenalty.md) |  | number | _(Optional)_ Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. |
|  [logprobs?](./generative-ai.generationconfig.logprobs.md) |  | number | _(Optional)_ Valid if responseLogProbs is set to True. This will set the number of top logprobs to return at each decoding step in the logprobsResult. |
|  [maxOutputTokens?](./generative-ai.generationconfig.maxoutputtokens.md) |  | number | _(Optional)_ |
|  [presencePenalty?](./generative-ai.generationconfig.presencepenalty.md) |  | number | _(Optional)_ Presence penalty applied to the next token's logprobs if the token has already been seen in the response. |
|  [responseLogprobs?](./generative-ai.generationconfig.responselogprobs.md) |  | boolean | _(Optional)_ If True, export the logprobs results in response. |
|  [responseMimeType?](./generative-ai.generationconfig.responsemimetype.md) |  | string | _(Optional)_ Output response mimetype of the generated candidate text. Supported mimetype: <code>text/plain</code>: (default) Text output. <code>application/json</code>: JSON response in the candidates. |
|  [responseSchema?](./generative-ai.generationconfig.responseschema.md) |  | [ResponseSchema](./generative-ai.responseschema.md) | _(Optional)_ Output response schema of the generated candidate text. Note: This only applies when the specified <code>responseMIMEType</code> supports a schema; currently this is limited to <code>application/json</code>. |
|  [stopSequences?](./generative-ai.generationconfig.stopsequences.md) |  | string\[\] | _(Optional)_ |
|  [temperature?](./generative-ai.generationconfig.temperature.md) |  | number | _(Optional)_ |
|  [topK?](./generative-ai.generationconfig.topk.md) |  | number | _(Optional)_ |
|  [topP?](./generative-ai.generationconfig.topp.md) |  | number | _(Optional)_ |

---

### Reference Main Generative Ai.Generationconfig.Presencepenalty (`docs/reference/main/generative-ai.generationconfig.presencepenalty.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [presencePenalty](./generative-ai.generationconfig.presencepenalty.md)

## GenerationConfig.presencePenalty property

Presence penalty applied to the next token's logprobs if the token has already been seen in the response.

**Signature:**

```typescript
presencePenalty?: number;
```

---

### Reference Main Generative Ai.Generationconfig.Responselogprobs (`docs/reference/main/generative-ai.generationconfig.responselogprobs.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [responseLogprobs](./generative-ai.generationconfig.responselogprobs.md)

## GenerationConfig.responseLogprobs property

If True, export the logprobs results in response.

**Signature:**

```typescript
responseLogprobs?: boolean;
```

---

### Reference Main Generative Ai.Generationconfig.Responsemimetype (`docs/reference/main/generative-ai.generationconfig.responsemimetype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [responseMimeType](./generative-ai.generationconfig.responsemimetype.md)

## GenerationConfig.responseMimeType property

Output response mimetype of the generated candidate text. Supported mimetype: `text/plain`: (default) Text output. `application/json`: JSON response in the candidates.

**Signature:**

```typescript
responseMimeType?: string;
```

---

### Reference Main Generative Ai.Generationconfig.Responseschema (`docs/reference/main/generative-ai.generationconfig.responseschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [responseSchema](./generative-ai.generationconfig.responseschema.md)

## GenerationConfig.responseSchema property

Output response schema of the generated candidate text. Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json`.

**Signature:**

```typescript
responseSchema?: ResponseSchema;
```

---

### Reference Main Generative Ai.Generationconfig.Stopsequences (`docs/reference/main/generative-ai.generationconfig.stopsequences.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [stopSequences](./generative-ai.generationconfig.stopsequences.md)

## GenerationConfig.stopSequences property

**Signature:**

```typescript
stopSequences?: string[];
```

---

### Reference Main Generative Ai.Generationconfig.Temperature (`docs/reference/main/generative-ai.generationconfig.temperature.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [temperature](./generative-ai.generationconfig.temperature.md)

## GenerationConfig.temperature property

**Signature:**

```typescript
temperature?: number;
```

---

### Reference Main Generative Ai.Generationconfig.Topk (`docs/reference/main/generative-ai.generationconfig.topk.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [topK](./generative-ai.generationconfig.topk.md)

## GenerationConfig.topK property

**Signature:**

```typescript
topK?: number;
```

---

### Reference Main Generative Ai.Generationconfig.Topp (`docs/reference/main/generative-ai.generationconfig.topp.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerationConfig](./generative-ai.generationconfig.md) &gt; [topP](./generative-ai.generationconfig.topp.md)

## GenerationConfig.topP property

**Signature:**

```typescript
topP?: number;
```

---

### Reference Main Generative Ai.Generativecontentblob.Data (`docs/reference/main/generative-ai.generativecontentblob.data.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeContentBlob](./generative-ai.generativecontentblob.md) &gt; [data](./generative-ai.generativecontentblob.data.md)

## GenerativeContentBlob.data property

Image as a base64 string.

**Signature:**

```typescript
data: string;
```

---

### Reference Main Generative Ai.Generativecontentblob (`docs/reference/main/generative-ai.generativecontentblob.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeContentBlob](./generative-ai.generativecontentblob.md)

## GenerativeContentBlob interface

Interface for sending an image.

**Signature:**

```typescript
export interface GenerativeContentBlob 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [data](./generative-ai.generativecontentblob.data.md) |  | string | Image as a base64 string. |
|  [mimeType](./generative-ai.generativecontentblob.mimetype.md) |  | string |  |

---

### Reference Main Generative Ai.Generativecontentblob.Mimetype (`docs/reference/main/generative-ai.generativecontentblob.mimetype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeContentBlob](./generative-ai.generativecontentblob.md) &gt; [mimeType](./generative-ai.generativecontentblob.mimetype.md)

## GenerativeContentBlob.mimeType property

**Signature:**

```typescript
mimeType: string;
```

---

### Reference Main Generative Ai.Generativemodel. Constructor  (`docs/reference/main/generative-ai.generativemodel._constructor_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [(constructor)](./generative-ai.generativemodel._constructor_.md)

## GenerativeModel.(constructor)

Constructs a new instance of the `GenerativeModel` class

**Signature:**

```typescript
constructor(apiKey: string, modelParams: ModelParams, _requestOptions?: RequestOptions);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  apiKey | string |  |
|  modelParams | [ModelParams](./generative-ai.modelparams.md) |  |
|  \_requestOptions | [RequestOptions](./generative-ai.requestoptions.md) | _(Optional)_ |

---

### Reference Main Generative Ai.Generativemodel.Apikey (`docs/reference/main/generative-ai.generativemodel.apikey.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [apiKey](./generative-ai.generativemodel.apikey.md)

## GenerativeModel.apiKey property

**Signature:**

```typescript
apiKey: string;
```

---

### Reference Main Generative Ai.Generativemodel.Batchembedcontents (`docs/reference/main/generative-ai.generativemodel.batchembedcontents.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [batchEmbedContents](./generative-ai.generativemodel.batchembedcontents.md)

## GenerativeModel.batchEmbedContents() method

Embeds an array of [EmbedContentRequest](./generative-ai.embedcontentrequest.md)s.

Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).

**Signature:**

```typescript
batchEmbedContents(batchEmbedContentRequest: BatchEmbedContentsRequest, requestOptions?: SingleRequestOptions): Promise<BatchEmbedContentsResponse>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  batchEmbedContentRequest | [BatchEmbedContentsRequest](./generative-ai.batchembedcontentsrequest.md) |  |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[BatchEmbedContentsResponse](./generative-ai.batchembedcontentsresponse.md)&gt;

---

### Reference Main Generative Ai.Generativemodel.Cachedcontent (`docs/reference/main/generative-ai.generativemodel.cachedcontent.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [cachedContent](./generative-ai.generativemodel.cachedcontent.md)

## GenerativeModel.cachedContent property

**Signature:**

```typescript
cachedContent: CachedContent;
```

---

### Reference Main Generative Ai.Generativemodel.Counttokens (`docs/reference/main/generative-ai.generativemodel.counttokens.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [countTokens](./generative-ai.generativemodel.counttokens.md)

## GenerativeModel.countTokens() method

Counts the tokens in the provided request.

Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).

**Signature:**

```typescript
countTokens(request: CountTokensRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<CountTokensResponse>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  request | [CountTokensRequest](./generative-ai.counttokensrequest.md) \| string \| Array&lt;string \| [Part](./generative-ai.part.md)&gt; |  |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[CountTokensResponse](./generative-ai.counttokensresponse.md)&gt;

---

### Reference Main Generative Ai.Generativemodel.Embedcontent (`docs/reference/main/generative-ai.generativemodel.embedcontent.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [embedContent](./generative-ai.generativemodel.embedcontent.md)

## GenerativeModel.embedContent() method

Embeds the provided content.

Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).

**Signature:**

```typescript
embedContent(request: EmbedContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<EmbedContentResponse>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  request | [EmbedContentRequest](./generative-ai.embedcontentrequest.md) \| string \| Array&lt;string \| [Part](./generative-ai.part.md)&gt; |  |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[EmbedContentResponse](./generative-ai.embedcontentresponse.md)&gt;

---

### Reference Main Generative Ai.Generativemodel.Generatecontent (`docs/reference/main/generative-ai.generativemodel.generatecontent.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [generateContent](./generative-ai.generativemodel.generatecontent.md)

## GenerativeModel.generateContent() method

Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./generative-ai.generatecontentresponse.md).

Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).

**Signature:**

```typescript
generateContent(request: GenerateContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentResult>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  request | [GenerateContentRequest](./generative-ai.generatecontentrequest.md) \| string \| Array&lt;string \| [Part](./generative-ai.part.md)&gt; |  |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[GenerateContentResult](./generative-ai.generatecontentresult.md)&gt;

---

### Reference Main Generative Ai.Generativemodel.Generatecontentstream (`docs/reference/main/generative-ai.generativemodel.generatecontentstream.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [generateContentStream](./generative-ai.generativemodel.generatecontentstream.md)

## GenerativeModel.generateContentStream() method

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.

Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).

**Signature:**

```typescript
generateContentStream(request: GenerateContentRequest | string | Array<string | Part>, requestOptions?: SingleRequestOptions): Promise<GenerateContentStreamResult>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  request | [GenerateContentRequest](./generative-ai.generatecontentrequest.md) \| string \| Array&lt;string \| [Part](./generative-ai.part.md)&gt; |  |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md)&gt;

---

### Reference Main Generative Ai.Generativemodel.Generationconfig (`docs/reference/main/generative-ai.generativemodel.generationconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [generationConfig](./generative-ai.generativemodel.generationconfig.md)

## GenerativeModel.generationConfig property

**Signature:**

```typescript
generationConfig: GenerationConfig;
```

---

### Reference Main Generative Ai.Generativemodel (`docs/reference/main/generative-ai.generativemodel.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md)

## GenerativeModel class

Class for generative model APIs.

**Signature:**

```typescript
export declare class GenerativeModel 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(apiKey, modelParams, \_requestOptions)](./generative-ai.generativemodel._constructor_.md) |  | Constructs a new instance of the <code>GenerativeModel</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [apiKey](./generative-ai.generativemodel.apikey.md) |  | string |  |
|  [cachedContent](./generative-ai.generativemodel.cachedcontent.md) |  | [CachedContent](./generative-ai.cachedcontent.md) |  |
|  [generationConfig](./generative-ai.generativemodel.generationconfig.md) |  | [GenerationConfig](./generative-ai.generationconfig.md) |  |
|  [model](./generative-ai.generativemodel.model.md) |  | string |  |
|  [safetySettings](./generative-ai.generativemodel.safetysettings.md) |  | [SafetySetting](./generative-ai.safetysetting.md)\[\] |  |
|  [systemInstruction?](./generative-ai.generativemodel.systeminstruction.md) |  | [Content](./generative-ai.content.md) | _(Optional)_ |
|  [toolConfig?](./generative-ai.generativemodel.toolconfig.md) |  | [ToolConfig](./generative-ai.toolconfig.md) | _(Optional)_ |
|  [tools?](./generative-ai.generativemodel.tools.md) |  | [Tool](./generative-ai.tool.md)\[\] | _(Optional)_ |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [batchEmbedContents(batchEmbedContentRequest, requestOptions)](./generative-ai.generativemodel.batchembedcontents.md) |  | <p>Embeds an array of [EmbedContentRequest](./generative-ai.embedcontentrequest.md)s.</p><p>Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).</p> |
|  [countTokens(request, requestOptions)](./generative-ai.generativemodel.counttokens.md) |  | <p>Counts the tokens in the provided request.</p><p>Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).</p> |
|  [embedContent(request, requestOptions)](./generative-ai.generativemodel.embedcontent.md) |  | <p>Embeds the provided content.</p><p>Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).</p> |
|  [generateContent(request, requestOptions)](./generative-ai.generativemodel.generatecontent.md) |  | <p>Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./generative-ai.generatecontentresponse.md).</p><p>Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).</p> |
|  [generateContentStream(request, requestOptions)](./generative-ai.generativemodel.generatecontentstream.md) |  | <p>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.</p><p>Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).</p> |
|  [startChat(startChatParams)](./generative-ai.generativemodel.startchat.md) |  | Gets a new [ChatSession](./generative-ai.chatsession.md) instance which can be used for multi-turn chats. |

---

### Reference Main Generative Ai.Generativemodel.Model (`docs/reference/main/generative-ai.generativemodel.model.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [model](./generative-ai.generativemodel.model.md)

## GenerativeModel.model property

**Signature:**

```typescript
model: string;
```

---

### Reference Main Generative Ai.Generativemodel.Safetysettings (`docs/reference/main/generative-ai.generativemodel.safetysettings.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [safetySettings](./generative-ai.generativemodel.safetysettings.md)

## GenerativeModel.safetySettings property

**Signature:**

```typescript
safetySettings: SafetySetting[];
```

---

### Reference Main Generative Ai.Generativemodel.Startchat (`docs/reference/main/generative-ai.generativemodel.startchat.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [startChat](./generative-ai.generativemodel.startchat.md)

## GenerativeModel.startChat() method

Gets a new [ChatSession](./generative-ai.chatsession.md) instance which can be used for multi-turn chats.

**Signature:**

```typescript
startChat(startChatParams?: StartChatParams): ChatSession;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  startChatParams | [StartChatParams](./generative-ai.startchatparams.md) | _(Optional)_ |

**Returns:**

[ChatSession](./generative-ai.chatsession.md)

---

### Reference Main Generative Ai.Generativemodel.Systeminstruction (`docs/reference/main/generative-ai.generativemodel.systeminstruction.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [systemInstruction](./generative-ai.generativemodel.systeminstruction.md)

## GenerativeModel.systemInstruction property

**Signature:**

```typescript
systemInstruction?: Content;
```

---

### Reference Main Generative Ai.Generativemodel.Toolconfig (`docs/reference/main/generative-ai.generativemodel.toolconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [toolConfig](./generative-ai.generativemodel.toolconfig.md)

## GenerativeModel.toolConfig property

**Signature:**

```typescript
toolConfig?: ToolConfig;
```

---

### Reference Main Generative Ai.Generativemodel.Tools (`docs/reference/main/generative-ai.generativemodel.tools.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeModel](./generative-ai.generativemodel.md) &gt; [tools](./generative-ai.generativemodel.tools.md)

## GenerativeModel.tools property

**Signature:**

```typescript
tools?: Tool[];
```

---

### Reference Main Generative Ai.Googlegenerativeai. Constructor  (`docs/reference/main/generative-ai.googlegenerativeai._constructor_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAI](./generative-ai.googlegenerativeai.md) &gt; [(constructor)](./generative-ai.googlegenerativeai._constructor_.md)

## GoogleGenerativeAI.(constructor)

Constructs a new instance of the `GoogleGenerativeAI` class

**Signature:**

```typescript
constructor(apiKey: string);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  apiKey | string |  |

---

### Reference Main Generative Ai.Googlegenerativeai.Apikey (`docs/reference/main/generative-ai.googlegenerativeai.apikey.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAI](./generative-ai.googlegenerativeai.md) &gt; [apiKey](./generative-ai.googlegenerativeai.apikey.md)

## GoogleGenerativeAI.apiKey property

**Signature:**

```typescript
apiKey: string;
```

---

### Reference Main Generative Ai.Googlegenerativeai.Getgenerativemodel (`docs/reference/main/generative-ai.googlegenerativeai.getgenerativemodel.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAI](./generative-ai.googlegenerativeai.md) &gt; [getGenerativeModel](./generative-ai.googlegenerativeai.getgenerativemodel.md)

## GoogleGenerativeAI.getGenerativeModel() method

Gets a [GenerativeModel](./generative-ai.generativemodel.md) instance for the provided model name.

**Signature:**

```typescript
getGenerativeModel(modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  modelParams | [ModelParams](./generative-ai.modelparams.md) |  |
|  requestOptions | [RequestOptions](./generative-ai.requestoptions.md) | _(Optional)_ |

**Returns:**

[GenerativeModel](./generative-ai.generativemodel.md)

---

### Reference Main Generative Ai.Googlegenerativeai.Getgenerativemodelfromcachedcontent (`docs/reference/main/generative-ai.googlegenerativeai.getgenerativemodelfromcachedcontent.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAI](./generative-ai.googlegenerativeai.md) &gt; [getGenerativeModelFromCachedContent](./generative-ai.googlegenerativeai.getgenerativemodelfromcachedcontent.md)

## GoogleGenerativeAI.getGenerativeModelFromCachedContent() method

Creates a [GenerativeModel](./generative-ai.generativemodel.md) instance from provided content cache.

**Signature:**

```typescript
getGenerativeModelFromCachedContent(cachedContent: CachedContent, modelParams?: Partial<ModelParams>, requestOptions?: RequestOptions): GenerativeModel;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  cachedContent | [CachedContent](./generative-ai.cachedcontent.md) |  |
|  modelParams | Partial&lt;[ModelParams](./generative-ai.modelparams.md)&gt; | _(Optional)_ |
|  requestOptions | [RequestOptions](./generative-ai.requestoptions.md) | _(Optional)_ |

**Returns:**

[GenerativeModel](./generative-ai.generativemodel.md)

---

### Reference Main Generative Ai.Googlegenerativeai (`docs/reference/main/generative-ai.googlegenerativeai.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAI](./generative-ai.googlegenerativeai.md)

## GoogleGenerativeAI class

Top-level class for this SDK

**Signature:**

```typescript
export declare class GoogleGenerativeAI 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(apiKey)](./generative-ai.googlegenerativeai._constructor_.md) |  | Constructs a new instance of the <code>GoogleGenerativeAI</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [apiKey](./generative-ai.googlegenerativeai.apikey.md) |  | string |  |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [getGenerativeModel(modelParams, requestOptions)](./generative-ai.googlegenerativeai.getgenerativemodel.md) |  | Gets a [GenerativeModel](./generative-ai.generativemodel.md) instance for the provided model name. |
|  [getGenerativeModelFromCachedContent(cachedContent, modelParams, requestOptions)](./generative-ai.googlegenerativeai.getgenerativemodelfromcachedcontent.md) |  | Creates a [GenerativeModel](./generative-ai.generativemodel.md) instance from provided content cache. |

---

### Reference Main Generative Ai.Googlegenerativeaiaborterror (`docs/reference/main/generative-ai.googlegenerativeaiaborterror.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIAbortError](./generative-ai.googlegenerativeaiaborterror.md)

## GoogleGenerativeAIAbortError class

Error thrown when a request is aborted, either due to a timeout or intentional cancellation by the user.

**Signature:**

```typescript
export declare class GoogleGenerativeAIAbortError extends GoogleGenerativeAIError 
```
**Extends:** [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md)

---

### Reference Main Generative Ai.Googlegenerativeaierror. Constructor  (`docs/reference/main/generative-ai.googlegenerativeaierror._constructor_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md) &gt; [(constructor)](./generative-ai.googlegenerativeaierror._constructor_.md)

## GoogleGenerativeAIError.(constructor)

Constructs a new instance of the `GoogleGenerativeAIError` class

**Signature:**

```typescript
constructor(message: string);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  message | string |  |

---

### Reference Main Generative Ai.Googlegenerativeaierror (`docs/reference/main/generative-ai.googlegenerativeaierror.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md)

## GoogleGenerativeAIError class

Basic error type for this SDK.

**Signature:**

```typescript
export declare class GoogleGenerativeAIError extends Error 
```
**Extends:** Error

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(message)](./generative-ai.googlegenerativeaierror._constructor_.md) |  | Constructs a new instance of the <code>GoogleGenerativeAIError</code> class |

---

### Reference Main Generative Ai.Googlegenerativeaifetcherror. Constructor  (`docs/reference/main/generative-ai.googlegenerativeaifetcherror._constructor_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) &gt; [(constructor)](./generative-ai.googlegenerativeaifetcherror._constructor_.md)

## GoogleGenerativeAIFetchError.(constructor)

Constructs a new instance of the `GoogleGenerativeAIFetchError` class

**Signature:**

```typescript
constructor(message: string, status?: number, statusText?: string, errorDetails?: ErrorDetails[]);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  message | string |  |
|  status | number | _(Optional)_ |
|  statusText | string | _(Optional)_ |
|  errorDetails | [ErrorDetails](./generative-ai.errordetails.md)\[\] | _(Optional)_ |

---

### Reference Main Generative Ai.Googlegenerativeaifetcherror.Errordetails (`docs/reference/main/generative-ai.googlegenerativeaifetcherror.errordetails.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) &gt; [errorDetails](./generative-ai.googlegenerativeaifetcherror.errordetails.md)

## GoogleGenerativeAIFetchError.errorDetails property

**Signature:**

```typescript
errorDetails?: ErrorDetails[];
```

---

### Reference Main Generative Ai.Googlegenerativeaifetcherror (`docs/reference/main/generative-ai.googlegenerativeaifetcherror.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md)

## GoogleGenerativeAIFetchError class

Error class covering HTTP errors when calling the server. Includes HTTP status, statusText, and optional details, if provided in the server response.

**Signature:**

```typescript
export declare class GoogleGenerativeAIFetchError extends GoogleGenerativeAIError 
```
**Extends:** [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md)

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(message, status, statusText, errorDetails)](./generative-ai.googlegenerativeaifetcherror._constructor_.md) |  | Constructs a new instance of the <code>GoogleGenerativeAIFetchError</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [errorDetails?](./generative-ai.googlegenerativeaifetcherror.errordetails.md) |  | [ErrorDetails](./generative-ai.errordetails.md)\[\] | _(Optional)_ |
|  [status?](./generative-ai.googlegenerativeaifetcherror.status.md) |  | number | _(Optional)_ |
|  [statusText?](./generative-ai.googlegenerativeaifetcherror.statustext.md) |  | string | _(Optional)_ |

---

### Reference Main Generative Ai.Googlegenerativeaifetcherror.Status (`docs/reference/main/generative-ai.googlegenerativeaifetcherror.status.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) &gt; [status](./generative-ai.googlegenerativeaifetcherror.status.md)

## GoogleGenerativeAIFetchError.status property

**Signature:**

```typescript
status?: number;
```

---

### Reference Main Generative Ai.Googlegenerativeaifetcherror.Statustext (`docs/reference/main/generative-ai.googlegenerativeaifetcherror.statustext.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) &gt; [statusText](./generative-ai.googlegenerativeaifetcherror.statustext.md)

## GoogleGenerativeAIFetchError.statusText property

**Signature:**

```typescript
statusText?: string;
```

---

### Reference Main Generative Ai.Googlegenerativeairequestinputerror (`docs/reference/main/generative-ai.googlegenerativeairequestinputerror.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIRequestInputError](./generative-ai.googlegenerativeairequestinputerror.md)

## GoogleGenerativeAIRequestInputError class

Errors in the contents of a request originating from user input.

**Signature:**

```typescript
export declare class GoogleGenerativeAIRequestInputError extends GoogleGenerativeAIError 
```
**Extends:** [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md)

---

### Reference Main Generative Ai.Googlegenerativeairesponseerror. Constructor  (`docs/reference/main/generative-ai.googlegenerativeairesponseerror._constructor_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIResponseError](./generative-ai.googlegenerativeairesponseerror.md) &gt; [(constructor)](./generative-ai.googlegenerativeairesponseerror._constructor_.md)

## GoogleGenerativeAIResponseError.(constructor)

Constructs a new instance of the `GoogleGenerativeAIResponseError` class

**Signature:**

```typescript
constructor(message: string, response?: T);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  message | string |  |
|  response | T | _(Optional)_ |

---

### Reference Main Generative Ai.Googlegenerativeairesponseerror (`docs/reference/main/generative-ai.googlegenerativeairesponseerror.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIResponseError](./generative-ai.googlegenerativeairesponseerror.md)

## GoogleGenerativeAIResponseError class

Errors in the contents of a response from the model. This includes parsing errors, or responses including a safety block reason.

**Signature:**

```typescript
export declare class GoogleGenerativeAIResponseError<T> extends GoogleGenerativeAIError 
```
**Extends:** [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md)

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(message, response)](./generative-ai.googlegenerativeairesponseerror._constructor_.md) |  | Constructs a new instance of the <code>GoogleGenerativeAIResponseError</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [response?](./generative-ai.googlegenerativeairesponseerror.response.md) |  | T | _(Optional)_ |

---

### Reference Main Generative Ai.Googlegenerativeairesponseerror.Response (`docs/reference/main/generative-ai.googlegenerativeairesponseerror.response.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIResponseError](./generative-ai.googlegenerativeairesponseerror.md) &gt; [response](./generative-ai.googlegenerativeairesponseerror.response.md)

## GoogleGenerativeAIResponseError.response property

**Signature:**

```typescript
response?: T;
```

---

### Reference Main Generative Ai.Googlesearchretrieval.Dynamicretrievalconfig (`docs/reference/main/generative-ai.googlesearchretrieval.dynamicretrievalconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleSearchRetrieval](./generative-ai.googlesearchretrieval.md) &gt; [dynamicRetrievalConfig](./generative-ai.googlesearchretrieval.dynamicretrievalconfig.md)

## GoogleSearchRetrieval.dynamicRetrievalConfig property

Specifies the dynamic retrieval configuration for the given source.

**Signature:**

```typescript
dynamicRetrievalConfig?: DynamicRetrievalConfig;
```

---

### Reference Main Generative Ai.Googlesearchretrieval (`docs/reference/main/generative-ai.googlesearchretrieval.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleSearchRetrieval](./generative-ai.googlesearchretrieval.md)

## GoogleSearchRetrieval interface

Retrieval tool that is powered by Google search.

**Signature:**

```typescript
export declare interface GoogleSearchRetrieval 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [dynamicRetrievalConfig?](./generative-ai.googlesearchretrieval.dynamicretrievalconfig.md) |  | [DynamicRetrievalConfig](./generative-ai.dynamicretrievalconfig.md) | _(Optional)_ Specifies the dynamic retrieval configuration for the given source. |

---

### Reference Main Generative Ai.Googlesearchretrievaltool.Googlesearchretrieval (`docs/reference/main/generative-ai.googlesearchretrievaltool.googlesearchretrieval.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleSearchRetrievalTool](./generative-ai.googlesearchretrievaltool.md) &gt; [googleSearchRetrieval](./generative-ai.googlesearchretrievaltool.googlesearchretrieval.md)

## GoogleSearchRetrievalTool.googleSearchRetrieval property

Google search retrieval tool config.

**Signature:**

```typescript
googleSearchRetrieval?: GoogleSearchRetrieval;
```

---

### Reference Main Generative Ai.Googlesearchretrievaltool (`docs/reference/main/generative-ai.googlesearchretrievaltool.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleSearchRetrievalTool](./generative-ai.googlesearchretrievaltool.md)

## GoogleSearchRetrievalTool interface

Retrieval tool that is powered by Google search.

**Signature:**

```typescript
export declare interface GoogleSearchRetrievalTool 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [googleSearchRetrieval?](./generative-ai.googlesearchretrievaltool.googlesearchretrieval.md) |  | [GoogleSearchRetrieval](./generative-ai.googlesearchretrieval.md) | _(Optional)_ Google search retrieval tool config. |

---

### Reference Main Generative Ai.Groundingchunk (`docs/reference/main/generative-ai.groundingchunk.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingChunk](./generative-ai.groundingchunk.md)

## GroundingChunk interface

Grounding chunk.

**Signature:**

```typescript
export declare interface GroundingChunk 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [web?](./generative-ai.groundingchunk.web.md) |  | [GroundingChunkWeb](./generative-ai.groundingchunkweb.md) | _(Optional)_ Chunk from the web. |

---

### Reference Main Generative Ai.Groundingchunk.Web (`docs/reference/main/generative-ai.groundingchunk.web.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingChunk](./generative-ai.groundingchunk.md) &gt; [web](./generative-ai.groundingchunk.web.md)

## GroundingChunk.web property

Chunk from the web.

**Signature:**

```typescript
web?: GroundingChunkWeb;
```

---

### Reference Main Generative Ai.Groundingchunkweb (`docs/reference/main/generative-ai.groundingchunkweb.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingChunkWeb](./generative-ai.groundingchunkweb.md)

## GroundingChunkWeb interface

Chunk from the web.

**Signature:**

```typescript
export declare interface GroundingChunkWeb 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [title?](./generative-ai.groundingchunkweb.title.md) |  | string | _(Optional)_ Title of the chunk. |
|  [uri?](./generative-ai.groundingchunkweb.uri.md) |  | string | _(Optional)_ URI reference of the chunk. |

---

### Reference Main Generative Ai.Groundingchunkweb.Title (`docs/reference/main/generative-ai.groundingchunkweb.title.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingChunkWeb](./generative-ai.groundingchunkweb.md) &gt; [title](./generative-ai.groundingchunkweb.title.md)

## GroundingChunkWeb.title property

Title of the chunk.

**Signature:**

```typescript
title?: string;
```

---

### Reference Main Generative Ai.Groundingchunkweb.Uri (`docs/reference/main/generative-ai.groundingchunkweb.uri.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingChunkWeb](./generative-ai.groundingchunkweb.md) &gt; [uri](./generative-ai.groundingchunkweb.uri.md)

## GroundingChunkWeb.uri property

URI reference of the chunk.

**Signature:**

```typescript
uri?: string;
```

---

### Reference Main Generative Ai.Groundingmetadata.Groundingchunks (`docs/reference/main/generative-ai.groundingmetadata.groundingchunks.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingMetadata](./generative-ai.groundingmetadata.md) &gt; [groundingChunks](./generative-ai.groundingmetadata.groundingchunks.md)

## GroundingMetadata.groundingChunks property

List of supporting references retrieved from specified grounding source.

**Signature:**

```typescript
groundingChunks?: GroundingChunk[];
```

---

### Reference Main Generative Ai.Groundingmetadata.Groundingsupports (`docs/reference/main/generative-ai.groundingmetadata.groundingsupports.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingMetadata](./generative-ai.groundingmetadata.md) &gt; [groundingSupports](./generative-ai.groundingmetadata.groundingsupports.md)

## GroundingMetadata.groundingSupports property

List of grounding support.

**Signature:**

```typescript
groundingSupports?: GroundingSupport[];
```

---

### Reference Main Generative Ai.Groundingmetadata (`docs/reference/main/generative-ai.groundingmetadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingMetadata](./generative-ai.groundingmetadata.md)

## GroundingMetadata interface

Metadata returned to client when grounding is enabled.

**Signature:**

```typescript
export declare interface GroundingMetadata 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [groundingChunks?](./generative-ai.groundingmetadata.groundingchunks.md) |  | [GroundingChunk](./generative-ai.groundingchunk.md)\[\] | _(Optional)_ List of supporting references retrieved from specified grounding source. |
|  [groundingSupports?](./generative-ai.groundingmetadata.groundingsupports.md) |  | [GroundingSupport](./generative-ai.groundingsupport.md)\[\] | _(Optional)_ List of grounding support. |
|  [retrievalMetadata?](./generative-ai.groundingmetadata.retrievalmetadata.md) |  | [RetrievalMetadata](./generative-ai.retrievalmetadata.md) | _(Optional)_ Metadata related to retrieval in the grounding flow. |
|  [searchEntryPoint?](./generative-ai.groundingmetadata.searchentrypoint.md) |  | [SearchEntryPoint](./generative-ai.searchentrypoint.md) | _(Optional)_ Google search entry for the following-up web searches. |
|  [webSearchQueries](./generative-ai.groundingmetadata.websearchqueries.md) |  | string\[\] | \* Web search queries for the following-up web search. |

---

### Reference Main Generative Ai.Groundingmetadata.Retrievalmetadata (`docs/reference/main/generative-ai.groundingmetadata.retrievalmetadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingMetadata](./generative-ai.groundingmetadata.md) &gt; [retrievalMetadata](./generative-ai.groundingmetadata.retrievalmetadata.md)

## GroundingMetadata.retrievalMetadata property

Metadata related to retrieval in the grounding flow.

**Signature:**

```typescript
retrievalMetadata?: RetrievalMetadata;
```

---

### Reference Main Generative Ai.Groundingmetadata.Searchentrypoint (`docs/reference/main/generative-ai.groundingmetadata.searchentrypoint.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingMetadata](./generative-ai.groundingmetadata.md) &gt; [searchEntryPoint](./generative-ai.groundingmetadata.searchentrypoint.md)

## GroundingMetadata.searchEntryPoint property

Google search entry for the following-up web searches.

**Signature:**

```typescript
searchEntryPoint?: SearchEntryPoint;
```

---

### Reference Main Generative Ai.Groundingmetadata.Websearchqueries (`docs/reference/main/generative-ai.groundingmetadata.websearchqueries.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingMetadata](./generative-ai.groundingmetadata.md) &gt; [webSearchQueries](./generative-ai.groundingmetadata.websearchqueries.md)

## GroundingMetadata.webSearchQueries property

\* Web search queries for the following-up web search.

**Signature:**

```typescript
webSearchQueries: string[];
```

---

### Reference Main Generative Ai.Groundingsupport.Confidencescores (`docs/reference/main/generative-ai.groundingsupport.confidencescores.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingSupport](./generative-ai.groundingsupport.md) &gt; [confidenceScores](./generative-ai.groundingsupport.confidencescores.md)

## GroundingSupport.confidenceScores property

Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding\_chunk\_indices.

**Signature:**

```typescript
confidenceScores?: number[];
```

---

### Reference Main Generative Ai.Groundingsupport.Groundingchunckindices (`docs/reference/main/generative-ai.groundingsupport.groundingchunckindices.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingSupport](./generative-ai.groundingsupport.md) &gt; [groundingChunckIndices](./generative-ai.groundingsupport.groundingchunckindices.md)

## GroundingSupport.groundingChunckIndices property

A list of indices (into 'grounding\_chunk') specifying the citations associated with the claim. For instance \[1,3,4\] means that grounding\_chunk\[1\], grounding\_chunk\[3\], grounding\_chunk\[4\] are the retrieved content attributed to the claim.

**Signature:**

```typescript
groundingChunckIndices?: number[];
```

---

### Reference Main Generative Ai.Groundingsupport (`docs/reference/main/generative-ai.groundingsupport.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingSupport](./generative-ai.groundingsupport.md)

## GroundingSupport interface

Grounding support.

**Signature:**

```typescript
export declare interface GroundingSupport 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [confidenceScores?](./generative-ai.groundingsupport.confidencescores.md) |  | number\[\] | _(Optional)_ Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding\_chunk\_indices. |
|  [groundingChunckIndices?](./generative-ai.groundingsupport.groundingchunckindices.md) |  | number\[\] | _(Optional)_ A list of indices (into 'grounding\_chunk') specifying the citations associated with the claim. For instance \[1,3,4\] means that grounding\_chunk\[1\], grounding\_chunk\[3\], grounding\_chunk\[4\] are the retrieved content attributed to the claim. |
|  [segment?](./generative-ai.groundingsupport.segment.md) |  | string | _(Optional)_ URI reference of the chunk. |

---

### Reference Main Generative Ai.Groundingsupport.Segment (`docs/reference/main/generative-ai.groundingsupport.segment.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingSupport](./generative-ai.groundingsupport.md) &gt; [segment](./generative-ai.groundingsupport.segment.md)

## GroundingSupport.segment property

URI reference of the chunk.

**Signature:**

```typescript
segment?: string;
```

---

### Reference Main Generative Ai.Groundingsupportsegment (`docs/reference/main/generative-ai.groundingsupportsegment.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingSupportSegment](./generative-ai.groundingsupportsegment.md)

## GroundingSupportSegment interface

Segment of the content.

**Signature:**

```typescript
export declare interface GroundingSupportSegment 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [endIndex?](./generative-ai.groundingsupportsegment.endindex.md) |  | number | _(Optional)_ End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero. |
|  [partIndex?](./generative-ai.groundingsupportsegment.partindex.md) |  | number | _(Optional)_ The index of a Part object within its parent Content object. |
|  [startIndex?](./generative-ai.groundingsupportsegment.startindex.md) |  | number | _(Optional)_ Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero. |
|  [text?](./generative-ai.groundingsupportsegment.text.md) |  | string | _(Optional)_ The text corresponding to the segment from the response. |

---

### Reference Main Generative Ai.Groundingsupportsegment.Text (`docs/reference/main/generative-ai.groundingsupportsegment.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GroundingSupportSegment](./generative-ai.groundingsupportsegment.md) &gt; [text](./generative-ai.groundingsupportsegment.text.md)

## GroundingSupportSegment.text property

The text corresponding to the segment from the response.

**Signature:**

```typescript
text?: string;
```

---

### Reference Main Generative Ai.Harmblockthreshold (`docs/reference/main/generative-ai.harmblockthreshold.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [HarmBlockThreshold](./generative-ai.harmblockthreshold.md)

## HarmBlockThreshold enum

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 | <code>&quot;BLOCK_LOW_AND_ABOVE&quot;</code> | Content with NEGLIGIBLE will be allowed. |
|  BLOCK\_MEDIUM\_AND\_ABOVE | <code>&quot;BLOCK_MEDIUM_AND_ABOVE&quot;</code> | Content with NEGLIGIBLE and LOW will be allowed. |
|  BLOCK\_NONE | <code>&quot;BLOCK_NONE&quot;</code> | All content will be allowed. |
|  BLOCK\_ONLY\_HIGH | <code>&quot;BLOCK_ONLY_HIGH&quot;</code> | Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. |
|  HARM\_BLOCK\_THRESHOLD\_UNSPECIFIED | <code>&quot;HARM_BLOCK_THRESHOLD_UNSPECIFIED&quot;</code> | Threshold is unspecified. |

---

### Reference Main Generative Ai.Harmcategory (`docs/reference/main/generative-ai.harmcategory.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [HarmCategory](./generative-ai.harmcategory.md)

## HarmCategory enum

Harm categories that would cause prompts or candidates to be blocked.

**Signature:**

```typescript
export declare enum HarmCategory 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  HARM\_CATEGORY\_CIVIC\_INTEGRITY | <code>&quot;HARM_CATEGORY_CIVIC_INTEGRITY&quot;</code> |  |
|  HARM\_CATEGORY\_DANGEROUS\_CONTENT | <code>&quot;HARM_CATEGORY_DANGEROUS_CONTENT&quot;</code> |  |
|  HARM\_CATEGORY\_HARASSMENT | <code>&quot;HARM_CATEGORY_HARASSMENT&quot;</code> |  |
|  HARM\_CATEGORY\_HATE\_SPEECH | <code>&quot;HARM_CATEGORY_HATE_SPEECH&quot;</code> |  |
|  HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | <code>&quot;HARM_CATEGORY_SEXUALLY_EXPLICIT&quot;</code> |  |
|  HARM\_CATEGORY\_UNSPECIFIED | <code>&quot;HARM_CATEGORY_UNSPECIFIED&quot;</code> |  |

---

### Reference Main Generative Ai.Harmprobability (`docs/reference/main/generative-ai.harmprobability.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [HarmProbability](./generative-ai.harmprobability.md)

## HarmProbability enum

Probability that a prompt or candidate matches a harm category.

**Signature:**

```typescript
export declare enum HarmProbability 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  HARM\_PROBABILITY\_UNSPECIFIED | <code>&quot;HARM_PROBABILITY_UNSPECIFIED&quot;</code> | Probability is unspecified. |
|  HIGH | <code>&quot;HIGH&quot;</code> | Content has a high chance of being unsafe. |
|  LOW | <code>&quot;LOW&quot;</code> | Content has a low chance of being unsafe. |
|  MEDIUM | <code>&quot;MEDIUM&quot;</code> | Content has a medium chance of being unsafe. |
|  NEGLIGIBLE | <code>&quot;NEGLIGIBLE&quot;</code> | Content has a negligible chance of being unsafe. |

---

### Reference Main Generative Ai.Inlinedatapart.Codeexecutionresult (`docs/reference/main/generative-ai.inlinedatapart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [codeExecutionResult](./generative-ai.inlinedatapart.codeexecutionresult.md)

## InlineDataPart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Main Generative Ai.Inlinedatapart.Executablecode (`docs/reference/main/generative-ai.inlinedatapart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [executableCode](./generative-ai.inlinedatapart.executablecode.md)

## InlineDataPart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Main Generative Ai.Inlinedatapart.Filedata (`docs/reference/main/generative-ai.inlinedatapart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [fileData](./generative-ai.inlinedatapart.filedata.md)

## InlineDataPart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Main Generative Ai.Inlinedatapart.Functioncall (`docs/reference/main/generative-ai.inlinedatapart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [functionCall](./generative-ai.inlinedatapart.functioncall.md)

## InlineDataPart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Main Generative Ai.Inlinedatapart.Functionresponse (`docs/reference/main/generative-ai.inlinedatapart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [functionResponse](./generative-ai.inlinedatapart.functionresponse.md)

## InlineDataPart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Main Generative Ai.Inlinedatapart.Inlinedata (`docs/reference/main/generative-ai.inlinedatapart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [inlineData](./generative-ai.inlinedatapart.inlinedata.md)

## InlineDataPart.inlineData property

**Signature:**

```typescript
inlineData: GenerativeContentBlob;
```

---

### Reference Main Generative Ai.Inlinedatapart (`docs/reference/main/generative-ai.inlinedatapart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md)

## InlineDataPart interface

Content part interface if the part represents an image.

**Signature:**

```typescript
export interface InlineDataPart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.inlinedatapart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode?](./generative-ai.inlinedatapart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData?](./generative-ai.inlinedatapart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall?](./generative-ai.inlinedatapart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse?](./generative-ai.inlinedatapart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData](./generative-ai.inlinedatapart.inlinedata.md) |  | [GenerativeContentBlob](./generative-ai.generativecontentblob.md) |  |
|  [text?](./generative-ai.inlinedatapart.text.md) |  | never | _(Optional)_ |

---

### Reference Main Generative Ai.Inlinedatapart.Text (`docs/reference/main/generative-ai.inlinedatapart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [text](./generative-ai.inlinedatapart.text.md)

## InlineDataPart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Main Generative Ai.Integerschema.Format (`docs/reference/main/generative-ai.integerschema.format.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [IntegerSchema](./generative-ai.integerschema.md) &gt; [format](./generative-ai.integerschema.format.md)

## IntegerSchema.format property

Optional. The format of the number.

**Signature:**

```typescript
format?: "int32" | "int64";
```

---

### Reference Main Generative Ai.Integerschema (`docs/reference/main/generative-ai.integerschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [IntegerSchema](./generative-ai.integerschema.md)

## IntegerSchema interface

Describes a JSON-encodable integer.

**Signature:**

```typescript
export interface IntegerSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [format?](./generative-ai.integerschema.format.md) |  | "int32" \| "int64" | _(Optional)_ Optional. The format of the number. |
|  [type](./generative-ai.integerschema.type.md) |  | typeof [SchemaType.INTEGER](./generative-ai.schematype.md) |  |

---

### Reference Main Generative Ai.Integerschema.Type (`docs/reference/main/generative-ai.integerschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [IntegerSchema](./generative-ai.integerschema.md) &gt; [type](./generative-ai.integerschema.type.md)

## IntegerSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.INTEGER;
```

---

### Reference Main Generative Ai.Logprobscandidate.Logprobability (`docs/reference/main/generative-ai.logprobscandidate.logprobability.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [LogprobsCandidate](./generative-ai.logprobscandidate.md) &gt; [logProbability](./generative-ai.logprobscandidate.logprobability.md)

## LogprobsCandidate.logProbability property

The candidate's log probability.

**Signature:**

```typescript
logProbability: number;
```

---

### Reference Main Generative Ai.Logprobscandidate (`docs/reference/main/generative-ai.logprobscandidate.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [LogprobsCandidate](./generative-ai.logprobscandidate.md)

## LogprobsCandidate interface

Candidate for the logprobs token and score.

**Signature:**

```typescript
export interface LogprobsCandidate 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [logProbability](./generative-ai.logprobscandidate.logprobability.md) |  | number | The candidate's log probability. |
|  [token](./generative-ai.logprobscandidate.token.md) |  | string | The candidate's token string value. |
|  [tokenID](./generative-ai.logprobscandidate.tokenid.md) |  | number | The candidate's token id value. |

---

### Reference Main Generative Ai.Logprobscandidate.Token (`docs/reference/main/generative-ai.logprobscandidate.token.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [LogprobsCandidate](./generative-ai.logprobscandidate.md) &gt; [token](./generative-ai.logprobscandidate.token.md)

## LogprobsCandidate.token property

The candidate's token string value.

**Signature:**

```typescript
token: string;
```

---

### Reference Main Generative Ai.Logprobscandidate.Tokenid (`docs/reference/main/generative-ai.logprobscandidate.tokenid.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [LogprobsCandidate](./generative-ai.logprobscandidate.md) &gt; [tokenID](./generative-ai.logprobscandidate.tokenid.md)

## LogprobsCandidate.tokenID property

The candidate's token id value.

**Signature:**

```typescript
tokenID: number;
```

---

### Reference Main Generative Ai.Logprobsresult.Chosencandidates (`docs/reference/main/generative-ai.logprobsresult.chosencandidates.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [LogprobsResult](./generative-ai.logprobsresult.md) &gt; [chosenCandidates](./generative-ai.logprobsresult.chosencandidates.md)

## LogprobsResult.chosenCandidates property

Length = total number of decoding steps. The chosen candidates may or may not be in topCandidates.

**Signature:**

```typescript
chosenCandidates: LogprobsCandidate[];
```

---

### Reference Main Generative Ai.Logprobsresult (`docs/reference/main/generative-ai.logprobsresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [LogprobsResult](./generative-ai.logprobsresult.md)

## LogprobsResult interface

Logprobs Result

**Signature:**

```typescript
export interface LogprobsResult 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [chosenCandidates](./generative-ai.logprobsresult.chosencandidates.md) |  | [LogprobsCandidate](./generative-ai.logprobscandidate.md)\[\] | Length = total number of decoding steps. The chosen candidates may or may not be in topCandidates. |
|  [topCandidates](./generative-ai.logprobsresult.topcandidates.md) |  | [TopCandidates](./generative-ai.topcandidates.md)\[\] | Length = total number of decoding steps. |

---

### Reference Main Generative Ai.Logprobsresult.Topcandidates (`docs/reference/main/generative-ai.logprobsresult.topcandidates.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [LogprobsResult](./generative-ai.logprobsresult.md) &gt; [topCandidates](./generative-ai.logprobsresult.topcandidates.md)

## LogprobsResult.topCandidates property

Length = total number of decoding steps.

**Signature:**

```typescript
topCandidates: TopCandidates[];
```

---

### Reference Main Generative Ai (`docs/reference/main/generative-ai.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md)

## generative-ai package

## Classes

|  Class | Description |
|  --- | --- |
|  [ChatSession](./generative-ai.chatsession.md) | ChatSession class that enables sending chat messages and stores history of sent and received messages so far. |
|  [GenerativeModel](./generative-ai.generativemodel.md) | Class for generative model APIs. |
|  [GoogleGenerativeAI](./generative-ai.googlegenerativeai.md) | Top-level class for this SDK |
|  [GoogleGenerativeAIAbortError](./generative-ai.googlegenerativeaiaborterror.md) | Error thrown when a request is aborted, either due to a timeout or intentional cancellation by the user. |
|  [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md) | Basic error type for this SDK. |
|  [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) | Error class covering HTTP errors when calling the server. Includes HTTP status, statusText, and optional details, if provided in the server response. |
|  [GoogleGenerativeAIRequestInputError](./generative-ai.googlegenerativeairequestinputerror.md) | Errors in the contents of a request originating from user input. |
|  [GoogleGenerativeAIResponseError](./generative-ai.googlegenerativeairesponseerror.md) | Errors in the contents of a response from the model. This includes parsing errors, or responses including a safety block reason. |

## Enumerations

|  Enumeration | Description |
|  --- | --- |
|  [BlockReason](./generative-ai.blockreason.md) | Reason that a prompt was blocked. |
|  [DynamicRetrievalMode](./generative-ai.dynamicretrievalmode.md) | The mode of the predictor to be used in dynamic retrieval. |
|  [ExecutableCodeLanguage](./generative-ai.executablecodelanguage.md) |  |
|  [FinishReason](./generative-ai.finishreason.md) | Reason that a candidate finished. |
|  [FunctionCallingMode](./generative-ai.functioncallingmode.md) |  |
|  [HarmBlockThreshold](./generative-ai.harmblockthreshold.md) | Threshold above which a prompt or candidate will be blocked. |
|  [HarmCategory](./generative-ai.harmcategory.md) | Harm categories that would cause prompts or candidates to be blocked. |
|  [HarmProbability](./generative-ai.harmprobability.md) | Probability that a prompt or candidate matches a harm category. |
|  [Outcome](./generative-ai.outcome.md) | Possible outcomes of code execution. |
|  [SchemaType](./generative-ai.schematype.md) | Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ |
|  [TaskType](./generative-ai.tasktype.md) | Task type for embedding content. |

## Interfaces

|  Interface | Description |
|  --- | --- |
|  [ArraySchema](./generative-ai.arrayschema.md) | Describes an array, an ordered list of values. |
|  [BaseParams](./generative-ai.baseparams.md) | Base parameters for a number of methods. |
|  [BatchEmbedContentsRequest](./generative-ai.batchembedcontentsrequest.md) | Params for calling [GenerativeModel.batchEmbedContents()](./generative-ai.generativemodel.batchembedcontents.md) |
|  [BatchEmbedContentsResponse](./generative-ai.batchembedcontentsresponse.md) | Response from calling [GenerativeModel.batchEmbedContents()](./generative-ai.generativemodel.batchembedcontents.md). |
|  [BooleanSchema](./generative-ai.booleanschema.md) | Describes a boolean, either 'true' or 'false'. |
|  [CachedContent](./generative-ai.cachedcontent.md) | Describes <code>CachedContent</code> interface for sending to the server (if creating) or received from the server (using getters or list methods). |
|  [CachedContentBase](./generative-ai.cachedcontentbase.md) |  |
|  [CitationMetadata](./generative-ai.citationmetadata.md) | Citation metadata that may be found on a [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md). |
|  [CitationSource](./generative-ai.citationsource.md) | A single citation source. |
|  [CodeExecutionResult](./generative-ai.codeexecutionresult.md) | Result of executing the <code>ExecutableCode</code>. Only generated when using code execution, and always follows a <code>Part</code> containing the <code>ExecutableCode</code>. |
|  [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) | Content part containing the result of executed code. |
|  [CodeExecutionTool](./generative-ai.codeexecutiontool.md) | Enables the model to execute code as part of generation. |
|  [Content](./generative-ai.content.md) | Content type for both prompts and response candidates. |
|  [ContentEmbedding](./generative-ai.contentembedding.md) | A single content embedding. |
|  [CountTokensRequest](./generative-ai.counttokensrequest.md) | <p>Params for calling [GenerativeModel.countTokens()](./generative-ai.generativemodel.counttokens.md).</p><p>The request must contain either a [Content](./generative-ai.content.md) array or a [GenerateContentRequest](./generative-ai.generatecontentrequest.md), but not both. If both are provided then a [GoogleGenerativeAIRequestInputError](./generative-ai.googlegenerativeairequestinputerror.md) is thrown.</p> |
|  [CountTokensResponse](./generative-ai.counttokensresponse.md) | Response from calling [GenerativeModel.countTokens()](./generative-ai.generativemodel.counttokens.md). |
|  [DynamicRetrievalConfig](./generative-ai.dynamicretrievalconfig.md) | Specifies the dynamic retrieval configuration for the given source. |
|  [EmbedContentRequest](./generative-ai.embedcontentrequest.md) | Params for calling [GenerativeModel.embedContent()](./generative-ai.generativemodel.embedcontent.md) |
|  [EmbedContentResponse](./generative-ai.embedcontentresponse.md) | Response from calling [GenerativeModel.embedContent()](./generative-ai.generativemodel.embedcontent.md). |
|  [EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md) | Response object wrapped with helper methods. |
|  [EnumStringSchema](./generative-ai.enumstringschema.md) | Describes a string enum |
|  [ErrorDetails](./generative-ai.errordetails.md) | Details object that may be included in an error response. |
|  [ExecutableCode](./generative-ai.executablecode.md) | Code generated by the model that is meant to be executed, where the result is returned to the model. Only generated when using the code execution tool, in which the code will be automatically executed, and a corresponding <code>CodeExecutionResult</code> will also be generated. |
|  [ExecutableCodePart](./generative-ai.executablecodepart.md) | Content part containing executable code generated by the model. |
|  [FileData](./generative-ai.filedata.md) | Data pointing to a file uploaded with the Files API. |
|  [FileDataPart](./generative-ai.filedatapart.md) | Content part interface if the part represents FileData. |
|  [FunctionCall](./generative-ai.functioncall.md) | A predicted \[FunctionCall\] returned from the model that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing the parameters and their values. |
|  [FunctionCallingConfig](./generative-ai.functioncallingconfig.md) |  |
|  [FunctionCallPart](./generative-ai.functioncallpart.md) | Content part interface if the part represents a FunctionCall. |
|  [FunctionDeclaration](./generative-ai.functiondeclaration.md) | 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](./generative-ai.functiondeclarationschema.md) | Schema for parameters passed to [FunctionDeclaration.parameters](./generative-ai.functiondeclaration.parameters.md). |
|  [FunctionDeclarationsTool](./generative-ai.functiondeclarationstool.md) | 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](./generative-ai.functionresponse.md) | The result output from a \[FunctionCall\] that contains a string representing the \[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 \[FunctionCall\] made based on model prediction. |
|  [FunctionResponsePart](./generative-ai.functionresponsepart.md) | Content part interface if the part represents FunctionResponse. |
|  [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) | A candidate returned as part of a [GenerateContentResponse](./generative-ai.generatecontentresponse.md). |
|  [GenerateContentRequest](./generative-ai.generatecontentrequest.md) | Request sent to <code>generateContent</code> endpoint. |
|  [GenerateContentResponse](./generative-ai.generatecontentresponse.md) | Individual response from [GenerativeModel.generateContent()](./generative-ai.generativemodel.generatecontent.md) and [GenerativeModel.generateContentStream()](./generative-ai.generativemodel.generatecontentstream.md). <code>generateContentStream()</code> will return one in each chunk until the stream is done. |
|  [GenerateContentResult](./generative-ai.generatecontentresult.md) | Result object returned from generateContent() call. |
|  [GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md) | Result object returned from generateContentStream() call. Iterate over <code>stream</code> to get chunks as they come in and/or use the <code>response</code> promise to get the aggregated response when the stream is done. |
|  [GenerationConfig](./generative-ai.generationconfig.md) | Config options for content-related requests |
|  [GenerativeContentBlob](./generative-ai.generativecontentblob.md) | Interface for sending an image. |
|  [GoogleSearchRetrieval](./generative-ai.googlesearchretrieval.md) | Retrieval tool that is powered by Google search. |
|  [GoogleSearchRetrievalTool](./generative-ai.googlesearchretrievaltool.md) | Retrieval tool that is powered by Google search. |
|  [GroundingChunk](./generative-ai.groundingchunk.md) | Grounding chunk. |
|  [GroundingChunkWeb](./generative-ai.groundingchunkweb.md) | Chunk from the web. |
|  [GroundingMetadata](./generative-ai.groundingmetadata.md) | Metadata returned to client when grounding is enabled. |
|  [GroundingSupport](./generative-ai.groundingsupport.md) | Grounding support. |
|  [GroundingSupportSegment](./generative-ai.groundingsupportsegment.md) | Segment of the content. |
|  [InlineDataPart](./generative-ai.inlinedatapart.md) | Content part interface if the part represents an image. |
|  [IntegerSchema](./generative-ai.integerschema.md) | Describes a JSON-encodable integer. |
|  [LogprobsCandidate](./generative-ai.logprobscandidate.md) | Candidate for the logprobs token and score. |
|  [LogprobsResult](./generative-ai.logprobsresult.md) | Logprobs Result |
|  [ModelParams](./generative-ai.modelparams.md) | Params passed to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md). |
|  [NumberSchema](./generative-ai.numberschema.md) | Describes a JSON-encodable floating point number. |
|  [ObjectSchema](./generative-ai.objectschema.md) | Describes a JSON object, a mapping of specific keys to values. |
|  [PromptFeedback](./generative-ai.promptfeedback.md) | If the prompt was blocked, this will be populated with <code>blockReason</code> and the relevant <code>safetyRatings</code>. |
|  [RequestOptions](./generative-ai.requestoptions.md) | Params passed to getGenerativeModel() or GoogleAIFileManager(). |
|  [RetrievalMetadata](./generative-ai.retrievalmetadata.md) | Metadata related to retrieval in the grounding flow. |
|  [SafetyRating](./generative-ai.safetyrating.md) | A safety rating associated with a [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) |
|  [SafetySetting](./generative-ai.safetysetting.md) | Safety setting that can be sent as part of request parameters. |
|  [SearchEntryPoint](./generative-ai.searchentrypoint.md) | Google search entry point. |
|  [SimpleStringSchema](./generative-ai.simplestringschema.md) | Describes a simple string schema, with or without format |
|  [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | Params passed to atomic asynchronous operations. |
|  [StartChatParams](./generative-ai.startchatparams.md) | Params for [GenerativeModel.startChat()](./generative-ai.generativemodel.startchat.md). |
|  [TextPart](./generative-ai.textpart.md) | Content part interface if the part represents a text string. |
|  [ToolConfig](./generative-ai.toolconfig.md) | Tool config. This config is shared for all tools provided in the request. |
|  [TopCandidates](./generative-ai.topcandidates.md) | Candidates with top log probabilities at each decoding step |
|  [UsageMetadata](./generative-ai.usagemetadata.md) | Metadata on the generation request's token usage. |

## Variables

|  Variable | Description |
|  --- | --- |
|  [POSSIBLE\_ROLES](./generative-ai.possible_roles.md) | Possible roles. |

## Type Aliases

|  Type Alias | Description |
|  --- | --- |
|  [FunctionDeclarationSchemaProperty](./generative-ai.functiondeclarationschemaproperty.md) | Schema for top-level function declaration |
|  [Part](./generative-ai.part.md) | Content part - includes text or image part types. |
|  [ResponseSchema](./generative-ai.responseschema.md) | Schema passed to <code>GenerationConfig.responseSchema</code> |
|  [Schema](./generative-ai.schema.md) | 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. |
|  [StringSchema](./generative-ai.stringschema.md) | Describes a string. |
|  [Tool](./generative-ai.tool.md) | Defines a tool that model can call to access external knowledge. |

---

### Reference Main Generative Ai.Modelparams.Cachedcontent (`docs/reference/main/generative-ai.modelparams.cachedcontent.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ModelParams](./generative-ai.modelparams.md) &gt; [cachedContent](./generative-ai.modelparams.cachedcontent.md)

## ModelParams.cachedContent property

**Signature:**

```typescript
cachedContent?: CachedContent;
```

---

### Reference Main Generative Ai.Modelparams (`docs/reference/main/generative-ai.modelparams.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ModelParams](./generative-ai.modelparams.md)

## ModelParams interface

Params passed to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).

**Signature:**

```typescript
export interface ModelParams extends BaseParams 
```
**Extends:** [BaseParams](./generative-ai.baseparams.md)

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [cachedContent?](./generative-ai.modelparams.cachedcontent.md) |  | [CachedContent](./generative-ai.cachedcontent.md) | _(Optional)_ |
|  [model](./generative-ai.modelparams.model.md) |  | string |  |
|  [systemInstruction?](./generative-ai.modelparams.systeminstruction.md) |  | string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) | _(Optional)_ |
|  [toolConfig?](./generative-ai.modelparams.toolconfig.md) |  | [ToolConfig](./generative-ai.toolconfig.md) | _(Optional)_ |
|  [tools?](./generative-ai.modelparams.tools.md) |  | [Tool](./generative-ai.tool.md)\[\] | _(Optional)_ |

---

### Reference Main Generative Ai.Modelparams.Model (`docs/reference/main/generative-ai.modelparams.model.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ModelParams](./generative-ai.modelparams.md) &gt; [model](./generative-ai.modelparams.model.md)

## ModelParams.model property

**Signature:**

```typescript
model: string;
```

---

### Reference Main Generative Ai.Modelparams.Systeminstruction (`docs/reference/main/generative-ai.modelparams.systeminstruction.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ModelParams](./generative-ai.modelparams.md) &gt; [systemInstruction](./generative-ai.modelparams.systeminstruction.md)

## ModelParams.systemInstruction property

**Signature:**

```typescript
systemInstruction?: string | Part | Content;
```

---

### Reference Main Generative Ai.Modelparams.Toolconfig (`docs/reference/main/generative-ai.modelparams.toolconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ModelParams](./generative-ai.modelparams.md) &gt; [toolConfig](./generative-ai.modelparams.toolconfig.md)

## ModelParams.toolConfig property

**Signature:**

```typescript
toolConfig?: ToolConfig;
```

---

### Reference Main Generative Ai.Modelparams.Tools (`docs/reference/main/generative-ai.modelparams.tools.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ModelParams](./generative-ai.modelparams.md) &gt; [tools](./generative-ai.modelparams.tools.md)

## ModelParams.tools property

**Signature:**

```typescript
tools?: Tool[];
```

---

### Reference Main Generative Ai.Numberschema.Format (`docs/reference/main/generative-ai.numberschema.format.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [NumberSchema](./generative-ai.numberschema.md) &gt; [format](./generative-ai.numberschema.format.md)

## NumberSchema.format property

Optional. The format of the number.

**Signature:**

```typescript
format?: "float" | "double";
```

---

### Reference Main Generative Ai.Numberschema (`docs/reference/main/generative-ai.numberschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [NumberSchema](./generative-ai.numberschema.md)

## NumberSchema interface

Describes a JSON-encodable floating point number.

**Signature:**

```typescript
export interface NumberSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [format?](./generative-ai.numberschema.format.md) |  | "float" \| "double" | _(Optional)_ Optional. The format of the number. |
|  [type](./generative-ai.numberschema.type.md) |  | typeof [SchemaType.NUMBER](./generative-ai.schematype.md) |  |

---

### Reference Main Generative Ai.Numberschema.Type (`docs/reference/main/generative-ai.numberschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [NumberSchema](./generative-ai.numberschema.md) &gt; [type](./generative-ai.numberschema.type.md)

## NumberSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.NUMBER;
```

---

### Reference Main Generative Ai.Objectschema (`docs/reference/main/generative-ai.objectschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ObjectSchema](./generative-ai.objectschema.md)

## ObjectSchema interface

Describes a JSON object, a mapping of specific keys to values.

**Signature:**

```typescript
export interface ObjectSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [properties](./generative-ai.objectschema.properties.md) |  | { \[k: string\]: [Schema](./generative-ai.schema.md); } | Describes the properties of the JSON object. Must not be empty. |
|  [required?](./generative-ai.objectschema.required.md) |  | string\[\] | _(Optional)_ A list of keys declared in the properties object. Required properties will always be present in the generated object. |
|  [type](./generative-ai.objectschema.type.md) |  | typeof [SchemaType.OBJECT](./generative-ai.schematype.md) |  |

---

### Reference Main Generative Ai.Objectschema.Properties (`docs/reference/main/generative-ai.objectschema.properties.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ObjectSchema](./generative-ai.objectschema.md) &gt; [properties](./generative-ai.objectschema.properties.md)

## ObjectSchema.properties property

Describes the properties of the JSON object. Must not be empty.

**Signature:**

```typescript
properties: {
        [k: string]: Schema;
    };
```

---

### Reference Main Generative Ai.Objectschema.Required (`docs/reference/main/generative-ai.objectschema.required.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ObjectSchema](./generative-ai.objectschema.md) &gt; [required](./generative-ai.objectschema.required.md)

## ObjectSchema.required property

A list of keys declared in the properties object. Required properties will always be present in the generated object.

**Signature:**

```typescript
required?: string[];
```

---

### Reference Main Generative Ai.Objectschema.Type (`docs/reference/main/generative-ai.objectschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ObjectSchema](./generative-ai.objectschema.md) &gt; [type](./generative-ai.objectschema.type.md)

## ObjectSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.OBJECT;
```

---

### Reference Main Generative Ai.Outcome (`docs/reference/main/generative-ai.outcome.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Outcome](./generative-ai.outcome.md)

## Outcome enum

Possible outcomes of code execution.

**Signature:**

```typescript
export declare enum Outcome 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  OUTCOME\_DEADLINE\_EXCEEDED | <code>&quot;outcome_deadline_exceeded&quot;</code> | Code execution ran for too long, and was cancelled. There may or may not be a partial output present. |
|  OUTCOME\_FAILED | <code>&quot;outcome_failed&quot;</code> | Code execution finished but with a failure. <code>stderr</code> should contain the reason. |
|  OUTCOME\_OK | <code>&quot;outcome_ok&quot;</code> | Code execution completed successfully. |
|  OUTCOME\_UNSPECIFIED | <code>&quot;outcome_unspecified&quot;</code> | Unspecified status. This value should not be used. |

---

### Reference Main Generative Ai.Part (`docs/reference/main/generative-ai.part.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Part](./generative-ai.part.md)

## Part type

Content part - includes text or image part types.

**Signature:**

```typescript
export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart | ExecutableCodePart | CodeExecutionResultPart;
```
**References:** [TextPart](./generative-ai.textpart.md), [InlineDataPart](./generative-ai.inlinedatapart.md), [FunctionCallPart](./generative-ai.functioncallpart.md), [FunctionResponsePart](./generative-ai.functionresponsepart.md), [FileDataPart](./generative-ai.filedatapart.md), [ExecutableCodePart](./generative-ai.executablecodepart.md), [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md)

---

### Reference Main Generative Ai.Possible Roles (`docs/reference/main/generative-ai.possible_roles.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [POSSIBLE\_ROLES](./generative-ai.possible_roles.md)

## POSSIBLE\_ROLES variable

Possible roles.

**Signature:**

```typescript
POSSIBLE_ROLES: readonly ["user", "model", "function", "system"]
```

---

### Reference Main Generative Ai.Promptfeedback.Blockreason (`docs/reference/main/generative-ai.promptfeedback.blockreason.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [PromptFeedback](./generative-ai.promptfeedback.md) &gt; [blockReason](./generative-ai.promptfeedback.blockreason.md)

## PromptFeedback.blockReason property

**Signature:**

```typescript
blockReason: BlockReason;
```

---

### Reference Main Generative Ai.Promptfeedback.Blockreasonmessage (`docs/reference/main/generative-ai.promptfeedback.blockreasonmessage.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [PromptFeedback](./generative-ai.promptfeedback.md) &gt; [blockReasonMessage](./generative-ai.promptfeedback.blockreasonmessage.md)

## PromptFeedback.blockReasonMessage property

**Signature:**

```typescript
blockReasonMessage?: string;
```

---

### Reference Main Generative Ai.Promptfeedback (`docs/reference/main/generative-ai.promptfeedback.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [PromptFeedback](./generative-ai.promptfeedback.md)

## PromptFeedback interface

If the prompt was blocked, this will be populated with `blockReason` and the relevant `safetyRatings`.

**Signature:**

```typescript
export interface PromptFeedback 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [blockReason](./generative-ai.promptfeedback.blockreason.md) |  | [BlockReason](./generative-ai.blockreason.md) |  |
|  [blockReasonMessage?](./generative-ai.promptfeedback.blockreasonmessage.md) |  | string | _(Optional)_ |
|  [safetyRatings](./generative-ai.promptfeedback.safetyratings.md) |  | [SafetyRating](./generative-ai.safetyrating.md)\[\] |  |

---

### Reference Main Generative Ai.Promptfeedback.Safetyratings (`docs/reference/main/generative-ai.promptfeedback.safetyratings.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [PromptFeedback](./generative-ai.promptfeedback.md) &gt; [safetyRatings](./generative-ai.promptfeedback.safetyratings.md)

## PromptFeedback.safetyRatings property

**Signature:**

```typescript
safetyRatings: SafetyRating[];
```

---

### Reference Main Generative Ai.Requestoptions.Apiclient (`docs/reference/main/generative-ai.requestoptions.apiclient.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [apiClient](./generative-ai.requestoptions.apiclient.md)

## RequestOptions.apiClient property

Additional attribution information to include in the x-goog-api-client header. Used by wrapper SDKs.

**Signature:**

```typescript
apiClient?: string;
```

---

### Reference Main Generative Ai.Requestoptions.Apiversion (`docs/reference/main/generative-ai.requestoptions.apiversion.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [apiVersion](./generative-ai.requestoptions.apiversion.md)

## RequestOptions.apiVersion property

Version of API endpoint to call (e.g. "v1" or "v1beta"). If not specified, defaults to latest stable version.

**Signature:**

```typescript
apiVersion?: string;
```

---

### Reference Main Generative Ai.Requestoptions.Baseurl (`docs/reference/main/generative-ai.requestoptions.baseurl.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [baseUrl](./generative-ai.requestoptions.baseurl.md)

## RequestOptions.baseUrl property

Base endpoint url. Defaults to "https://generativelanguage.googleapis.com"

**Signature:**

```typescript
baseUrl?: string;
```

---

### Reference Main Generative Ai.Requestoptions.Customheaders (`docs/reference/main/generative-ai.requestoptions.customheaders.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [customHeaders](./generative-ai.requestoptions.customheaders.md)

## RequestOptions.customHeaders property

Custom HTTP request headers.

**Signature:**

```typescript
customHeaders?: Headers | Record<string, string>;
```

---

### Reference Main Generative Ai.Requestoptions (`docs/reference/main/generative-ai.requestoptions.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md)

## RequestOptions interface

Params passed to getGenerativeModel() or GoogleAIFileManager().

**Signature:**

```typescript
export interface RequestOptions 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [apiClient?](./generative-ai.requestoptions.apiclient.md) |  | string | _(Optional)_ Additional attribution information to include in the x-goog-api-client header. Used by wrapper SDKs. |
|  [apiVersion?](./generative-ai.requestoptions.apiversion.md) |  | string | _(Optional)_ Version of API endpoint to call (e.g. "v1" or "v1beta"). If not specified, defaults to latest stable version. |
|  [baseUrl?](./generative-ai.requestoptions.baseurl.md) |  | string | _(Optional)_ Base endpoint url. Defaults to "https://generativelanguage.googleapis.com" |
|  [customHeaders?](./generative-ai.requestoptions.customheaders.md) |  | Headers \| Record&lt;string, string&gt; | _(Optional)_ Custom HTTP request headers. |
|  [timeout?](./generative-ai.requestoptions.timeout.md) |  | number | _(Optional)_ Request timeout in milliseconds. |

---

### Reference Main Generative Ai.Requestoptions.Timeout (`docs/reference/main/generative-ai.requestoptions.timeout.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [timeout](./generative-ai.requestoptions.timeout.md)

## RequestOptions.timeout property

Request timeout in milliseconds.

**Signature:**

```typescript
timeout?: number;
```

---

### Reference Main Generative Ai.Responseschema (`docs/reference/main/generative-ai.responseschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ResponseSchema](./generative-ai.responseschema.md)

## ResponseSchema type

Schema passed to `GenerationConfig.responseSchema`

**Signature:**

```typescript
export type ResponseSchema = Schema;
```
**References:** [Schema](./generative-ai.schema.md)

---

### Reference Main Generative Ai.Retrievalmetadata.Googlesearchdynamicretrievalscore (`docs/reference/main/generative-ai.retrievalmetadata.googlesearchdynamicretrievalscore.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RetrievalMetadata](./generative-ai.retrievalmetadata.md) &gt; [googleSearchDynamicRetrievalScore](./generative-ai.retrievalmetadata.googlesearchdynamicretrievalscore.md)

## RetrievalMetadata.googleSearchDynamicRetrievalScore property

Score indicating how likely information from google search could help answer the prompt. The score is in the range \[0, 1\], where 0 is the least likely and 1 is the most likely. This score is only populated when google search grounding and dynamic retrieval is enabled. It will becompared to the threshold to determine whether to trigger google search.

**Signature:**

```typescript
googleSearchDynamicRetrievalScore?: number;
```

---

### Reference Main Generative Ai.Retrievalmetadata (`docs/reference/main/generative-ai.retrievalmetadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RetrievalMetadata](./generative-ai.retrievalmetadata.md)

## RetrievalMetadata interface

Metadata related to retrieval in the grounding flow.

**Signature:**

```typescript
export declare interface RetrievalMetadata 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [googleSearchDynamicRetrievalScore?](./generative-ai.retrievalmetadata.googlesearchdynamicretrievalscore.md) |  | number | _(Optional)_ Score indicating how likely information from google search could help answer the prompt. The score is in the range \[0, 1\], where 0 is the least likely and 1 is the most likely. This score is only populated when google search grounding and dynamic retrieval is enabled. It will becompared to the threshold to determine whether to trigger google search. |

---

### Reference Main Generative Ai.Safetyrating.Category (`docs/reference/main/generative-ai.safetyrating.category.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SafetyRating](./generative-ai.safetyrating.md) &gt; [category](./generative-ai.safetyrating.category.md)

## SafetyRating.category property

**Signature:**

```typescript
category: HarmCategory;
```

---

### Reference Main Generative Ai.Safetyrating (`docs/reference/main/generative-ai.safetyrating.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SafetyRating](./generative-ai.safetyrating.md)

## SafetyRating interface

A safety rating associated with a [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md)

**Signature:**

```typescript
export interface SafetyRating 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [category](./generative-ai.safetyrating.category.md) |  | [HarmCategory](./generative-ai.harmcategory.md) |  |
|  [probability](./generative-ai.safetyrating.probability.md) |  | [HarmProbability](./generative-ai.harmprobability.md) |  |

---

### Reference Main Generative Ai.Safetyrating.Probability (`docs/reference/main/generative-ai.safetyrating.probability.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SafetyRating](./generative-ai.safetyrating.md) &gt; [probability](./generative-ai.safetyrating.probability.md)

## SafetyRating.probability property

**Signature:**

```typescript
probability: HarmProbability;
```

---

### Reference Main Generative Ai.Safetysetting.Category (`docs/reference/main/generative-ai.safetysetting.category.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SafetySetting](./generative-ai.safetysetting.md) &gt; [category](./generative-ai.safetysetting.category.md)

## SafetySetting.category property

**Signature:**

```typescript
category: HarmCategory;
```

---

### Reference Main Generative Ai.Safetysetting (`docs/reference/main/generative-ai.safetysetting.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SafetySetting](./generative-ai.safetysetting.md)

## SafetySetting interface

Safety setting that can be sent as part of request parameters.

**Signature:**

```typescript
export interface SafetySetting 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [category](./generative-ai.safetysetting.category.md) |  | [HarmCategory](./generative-ai.harmcategory.md) |  |
|  [threshold](./generative-ai.safetysetting.threshold.md) |  | [HarmBlockThreshold](./generative-ai.harmblockthreshold.md) |  |

---

### Reference Main Generative Ai.Safetysetting.Threshold (`docs/reference/main/generative-ai.safetysetting.threshold.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SafetySetting](./generative-ai.safetysetting.md) &gt; [threshold](./generative-ai.safetysetting.threshold.md)

## SafetySetting.threshold property

**Signature:**

```typescript
threshold: HarmBlockThreshold;
```

---

### Reference Main Generative Ai.Schema (`docs/reference/main/generative-ai.schema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Schema](./generative-ai.schema.md)

## Schema type

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 type Schema = StringSchema | NumberSchema | IntegerSchema | BooleanSchema | ArraySchema | ObjectSchema;
```
**References:** [StringSchema](./generative-ai.stringschema.md), [NumberSchema](./generative-ai.numberschema.md), [IntegerSchema](./generative-ai.integerschema.md), [BooleanSchema](./generative-ai.booleanschema.md), [ArraySchema](./generative-ai.arrayschema.md), [ObjectSchema](./generative-ai.objectschema.md)

---

### Reference Main Generative Ai.Schematype (`docs/reference/main/generative-ai.schematype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SchemaType](./generative-ai.schematype.md)

## SchemaType enum

Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/

**Signature:**

```typescript
export declare enum SchemaType 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  ARRAY | <code>&quot;array&quot;</code> | Array type. |
|  BOOLEAN | <code>&quot;boolean&quot;</code> | Boolean type. |
|  INTEGER | <code>&quot;integer&quot;</code> | Integer type. |
|  NUMBER | <code>&quot;number&quot;</code> | Number type. |
|  OBJECT | <code>&quot;object&quot;</code> | Object type. |
|  STRING | <code>&quot;string&quot;</code> | String type. |

---

### Reference Main Generative Ai.Searchentrypoint (`docs/reference/main/generative-ai.searchentrypoint.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SearchEntryPoint](./generative-ai.searchentrypoint.md)

## SearchEntryPoint interface

Google search entry point.

**Signature:**

```typescript
export declare interface SearchEntryPoint 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [renderedContent?](./generative-ai.searchentrypoint.renderedcontent.md) |  | string | _(Optional)_ Web content snippet that can be embedded in a web page or an app webview. |
|  [sdkBlob?](./generative-ai.searchentrypoint.sdkblob.md) |  | string | _(Optional)_ Base64 encoded JSON representing array of &lt;search term, search url&gt; tuple. |

---

### Reference Main Generative Ai.Searchentrypoint.Renderedcontent (`docs/reference/main/generative-ai.searchentrypoint.renderedcontent.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SearchEntryPoint](./generative-ai.searchentrypoint.md) &gt; [renderedContent](./generative-ai.searchentrypoint.renderedcontent.md)

## SearchEntryPoint.renderedContent property

Web content snippet that can be embedded in a web page or an app webview.

**Signature:**

```typescript
renderedContent?: string;
```

---

### Reference Main Generative Ai.Searchentrypoint.Sdkblob (`docs/reference/main/generative-ai.searchentrypoint.sdkblob.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SearchEntryPoint](./generative-ai.searchentrypoint.md) &gt; [sdkBlob](./generative-ai.searchentrypoint.sdkblob.md)

## SearchEntryPoint.sdkBlob property

Base64 encoded JSON representing array of &lt;search term, search url&gt; tuple.

**Signature:**

```typescript
sdkBlob?: string;
```

---

### Reference Main Generative Ai.Simplestringschema.Enum (`docs/reference/main/generative-ai.simplestringschema.enum.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SimpleStringSchema](./generative-ai.simplestringschema.md) &gt; [enum](./generative-ai.simplestringschema.enum.md)

## SimpleStringSchema.enum property

**Signature:**

```typescript
enum?: never;
```

---

### Reference Main Generative Ai.Simplestringschema.Format (`docs/reference/main/generative-ai.simplestringschema.format.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SimpleStringSchema](./generative-ai.simplestringschema.md) &gt; [format](./generative-ai.simplestringschema.format.md)

## SimpleStringSchema.format property

**Signature:**

```typescript
format?: "date-time" | undefined;
```

---

### Reference Main Generative Ai.Simplestringschema (`docs/reference/main/generative-ai.simplestringschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SimpleStringSchema](./generative-ai.simplestringschema.md)

## SimpleStringSchema interface

Describes a simple string schema, with or without format

**Signature:**

```typescript
export interface SimpleStringSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [enum?](./generative-ai.simplestringschema.enum.md) |  | never | _(Optional)_ |
|  [format?](./generative-ai.simplestringschema.format.md) |  | "date-time" \| undefined | _(Optional)_ |
|  [type](./generative-ai.simplestringschema.type.md) |  | typeof [SchemaType.STRING](./generative-ai.schematype.md) |  |

---

### Reference Main Generative Ai.Simplestringschema.Type (`docs/reference/main/generative-ai.simplestringschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SimpleStringSchema](./generative-ai.simplestringschema.md) &gt; [type](./generative-ai.simplestringschema.type.md)

## SimpleStringSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.STRING;
```

---

### Reference Main Generative Ai.Singlerequestoptions (`docs/reference/main/generative-ai.singlerequestoptions.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SingleRequestOptions](./generative-ai.singlerequestoptions.md)

## SingleRequestOptions interface

Params passed to atomic asynchronous operations.

**Signature:**

```typescript
export interface SingleRequestOptions extends RequestOptions 
```
**Extends:** [RequestOptions](./generative-ai.requestoptions.md)

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [signal?](./generative-ai.singlerequestoptions.signal.md) |  | AbortSignal | <p>_(Optional)_ An object that may be used to abort asynchronous requests. The request may also be aborted due to the expiration of the timeout value, if provided.</p><p>NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations.</p> |

---

### Reference Main Generative Ai.Singlerequestoptions.Signal (`docs/reference/main/generative-ai.singlerequestoptions.signal.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SingleRequestOptions](./generative-ai.singlerequestoptions.md) &gt; [signal](./generative-ai.singlerequestoptions.signal.md)

## SingleRequestOptions.signal property

An object that may be used to abort asynchronous requests. The request may also be aborted due to the expiration of the timeout value, if provided.

NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations.

**Signature:**

```typescript
signal?: AbortSignal;
```

---

### Reference Main Generative Ai.Startchatparams.Cachedcontent (`docs/reference/main/generative-ai.startchatparams.cachedcontent.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [StartChatParams](./generative-ai.startchatparams.md) &gt; [cachedContent](./generative-ai.startchatparams.cachedcontent.md)

## StartChatParams.cachedContent property

This is the name of a `CachedContent` and not the cache object itself.

**Signature:**

```typescript
cachedContent?: string;
```

---

### Reference Main Generative Ai.Startchatparams.History (`docs/reference/main/generative-ai.startchatparams.history.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [StartChatParams](./generative-ai.startchatparams.md) &gt; [history](./generative-ai.startchatparams.history.md)

## StartChatParams.history property

**Signature:**

```typescript
history?: Content[];
```

---

### Reference Main Generative Ai.Startchatparams (`docs/reference/main/generative-ai.startchatparams.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [StartChatParams](./generative-ai.startchatparams.md)

## StartChatParams interface

Params for [GenerativeModel.startChat()](./generative-ai.generativemodel.startchat.md).

**Signature:**

```typescript
export interface StartChatParams extends BaseParams 
```
**Extends:** [BaseParams](./generative-ai.baseparams.md)

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [cachedContent?](./generative-ai.startchatparams.cachedcontent.md) |  | string | _(Optional)_ This is the name of a <code>CachedContent</code> and not the cache object itself. |
|  [history?](./generative-ai.startchatparams.history.md) |  | [Content](./generative-ai.content.md)\[\] | _(Optional)_ |
|  [systemInstruction?](./generative-ai.startchatparams.systeminstruction.md) |  | string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) | _(Optional)_ |
|  [toolConfig?](./generative-ai.startchatparams.toolconfig.md) |  | [ToolConfig](./generative-ai.toolconfig.md) | _(Optional)_ |
|  [tools?](./generative-ai.startchatparams.tools.md) |  | [Tool](./generative-ai.tool.md)\[\] | _(Optional)_ |

---

### Reference Main Generative Ai.Startchatparams.Systeminstruction (`docs/reference/main/generative-ai.startchatparams.systeminstruction.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [StartChatParams](./generative-ai.startchatparams.md) &gt; [systemInstruction](./generative-ai.startchatparams.systeminstruction.md)

## StartChatParams.systemInstruction property

**Signature:**

```typescript
systemInstruction?: string | Part | Content;
```

---

### Reference Main Generative Ai.Startchatparams.Toolconfig (`docs/reference/main/generative-ai.startchatparams.toolconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [StartChatParams](./generative-ai.startchatparams.md) &gt; [toolConfig](./generative-ai.startchatparams.toolconfig.md)

## StartChatParams.toolConfig property

**Signature:**

```typescript
toolConfig?: ToolConfig;
```

---

### Reference Main Generative Ai.Startchatparams.Tools (`docs/reference/main/generative-ai.startchatparams.tools.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [StartChatParams](./generative-ai.startchatparams.md) &gt; [tools](./generative-ai.startchatparams.tools.md)

## StartChatParams.tools property

**Signature:**

```typescript
tools?: Tool[];
```

---

### Reference Main Generative Ai.Stringschema (`docs/reference/main/generative-ai.stringschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [StringSchema](./generative-ai.stringschema.md)

## StringSchema type

Describes a string.

**Signature:**

```typescript
export type StringSchema = SimpleStringSchema | EnumStringSchema;
```
**References:** [SimpleStringSchema](./generative-ai.simplestringschema.md), [EnumStringSchema](./generative-ai.enumstringschema.md)

---

### Reference Main Generative Ai.Tasktype (`docs/reference/main/generative-ai.tasktype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TaskType](./generative-ai.tasktype.md)

## TaskType enum

Task type for embedding content.

**Signature:**

```typescript
export declare enum TaskType 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  CLASSIFICATION | <code>&quot;CLASSIFICATION&quot;</code> |  |
|  CLUSTERING | <code>&quot;CLUSTERING&quot;</code> |  |
|  RETRIEVAL\_DOCUMENT | <code>&quot;RETRIEVAL_DOCUMENT&quot;</code> |  |
|  RETRIEVAL\_QUERY | <code>&quot;RETRIEVAL_QUERY&quot;</code> |  |
|  SEMANTIC\_SIMILARITY | <code>&quot;SEMANTIC_SIMILARITY&quot;</code> |  |
|  TASK\_TYPE\_UNSPECIFIED | <code>&quot;TASK_TYPE_UNSPECIFIED&quot;</code> |  |

---

### Reference Main Generative Ai.Textpart.Codeexecutionresult (`docs/reference/main/generative-ai.textpart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [codeExecutionResult](./generative-ai.textpart.codeexecutionresult.md)

## TextPart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Main Generative Ai.Textpart.Executablecode (`docs/reference/main/generative-ai.textpart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [executableCode](./generative-ai.textpart.executablecode.md)

## TextPart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Main Generative Ai.Textpart.Filedata (`docs/reference/main/generative-ai.textpart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [fileData](./generative-ai.textpart.filedata.md)

## TextPart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Main Generative Ai.Textpart.Functioncall (`docs/reference/main/generative-ai.textpart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [functionCall](./generative-ai.textpart.functioncall.md)

## TextPart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Main Generative Ai.Textpart.Functionresponse (`docs/reference/main/generative-ai.textpart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [functionResponse](./generative-ai.textpart.functionresponse.md)

## TextPart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Main Generative Ai.Textpart.Inlinedata (`docs/reference/main/generative-ai.textpart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [inlineData](./generative-ai.textpart.inlinedata.md)

## TextPart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Main Generative Ai.Textpart (`docs/reference/main/generative-ai.textpart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md)

## TextPart interface

Content part interface if the part represents a text string.

**Signature:**

```typescript
export interface TextPart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.textpart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode?](./generative-ai.textpart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData?](./generative-ai.textpart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall?](./generative-ai.textpart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse?](./generative-ai.textpart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData?](./generative-ai.textpart.inlinedata.md) |  | never | _(Optional)_ |
|  [text](./generative-ai.textpart.text.md) |  | string |  |

---

### Reference Main Generative Ai.Textpart.Text (`docs/reference/main/generative-ai.textpart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [text](./generative-ai.textpart.text.md)

## TextPart.text property

**Signature:**

```typescript
text: string;
```

---

### Reference Main Generative Ai.Tool (`docs/reference/main/generative-ai.tool.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Tool](./generative-ai.tool.md)

## Tool type

Defines a tool that model can call to access external knowledge.

**Signature:**

```typescript
export declare type Tool = FunctionDeclarationsTool | CodeExecutionTool | GoogleSearchRetrievalTool;
```
**References:** [FunctionDeclarationsTool](./generative-ai.functiondeclarationstool.md), [CodeExecutionTool](./generative-ai.codeexecutiontool.md), [GoogleSearchRetrievalTool](./generative-ai.googlesearchretrievaltool.md)

---

### Reference Main Generative Ai.Toolconfig.Functioncallingconfig (`docs/reference/main/generative-ai.toolconfig.functioncallingconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ToolConfig](./generative-ai.toolconfig.md) &gt; [functionCallingConfig](./generative-ai.toolconfig.functioncallingconfig.md)

## ToolConfig.functionCallingConfig property

**Signature:**

```typescript
functionCallingConfig: FunctionCallingConfig;
```

---

### Reference Main Generative Ai.Toolconfig (`docs/reference/main/generative-ai.toolconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ToolConfig](./generative-ai.toolconfig.md)

## ToolConfig interface

Tool config. This config is shared for all tools provided in the request.

**Signature:**

```typescript
export interface ToolConfig 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [functionCallingConfig](./generative-ai.toolconfig.functioncallingconfig.md) |  | [FunctionCallingConfig](./generative-ai.functioncallingconfig.md) |  |

---

### Reference Main Generative Ai.Topcandidates.Candidates (`docs/reference/main/generative-ai.topcandidates.candidates.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TopCandidates](./generative-ai.topcandidates.md) &gt; [candidates](./generative-ai.topcandidates.candidates.md)

## TopCandidates.candidates property

Sorted by log probability in descending order.

**Signature:**

```typescript
candidates: LogprobsCandidate[];
```

---

### Reference Main Generative Ai.Topcandidates (`docs/reference/main/generative-ai.topcandidates.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TopCandidates](./generative-ai.topcandidates.md)

## TopCandidates interface

Candidates with top log probabilities at each decoding step

**Signature:**

```typescript
export interface TopCandidates 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [candidates](./generative-ai.topcandidates.candidates.md) |  | [LogprobsCandidate](./generative-ai.logprobscandidate.md)\[\] | Sorted by log probability in descending order. |

---

### Reference Main Generative Ai.Usagemetadata.Cachedcontenttokencount (`docs/reference/main/generative-ai.usagemetadata.cachedcontenttokencount.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [UsageMetadata](./generative-ai.usagemetadata.md) &gt; [cachedContentTokenCount](./generative-ai.usagemetadata.cachedcontenttokencount.md)

## UsageMetadata.cachedContentTokenCount property

Total token count in the cached part of the prompt, i.e. in the cached content.

**Signature:**

```typescript
cachedContentTokenCount?: number;
```

---

### Reference Main Generative Ai.Usagemetadata.Candidatestokencount (`docs/reference/main/generative-ai.usagemetadata.candidatestokencount.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [UsageMetadata](./generative-ai.usagemetadata.md) &gt; [candidatesTokenCount](./generative-ai.usagemetadata.candidatestokencount.md)

## UsageMetadata.candidatesTokenCount property

Total number of tokens across the generated candidates.

**Signature:**

```typescript
candidatesTokenCount: number;
```

---

### Reference Main Generative Ai.Usagemetadata (`docs/reference/main/generative-ai.usagemetadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [UsageMetadata](./generative-ai.usagemetadata.md)

## UsageMetadata interface

Metadata on the generation request's token usage.

**Signature:**

```typescript
export interface UsageMetadata 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [cachedContentTokenCount?](./generative-ai.usagemetadata.cachedcontenttokencount.md) |  | number | _(Optional)_ Total token count in the cached part of the prompt, i.e. in the cached content. |
|  [candidatesTokenCount](./generative-ai.usagemetadata.candidatestokencount.md) |  | number | Total number of tokens across the generated candidates. |
|  [promptTokenCount](./generative-ai.usagemetadata.prompttokencount.md) |  | number | Number of tokens in the prompt. |
|  [totalTokenCount](./generative-ai.usagemetadata.totaltokencount.md) |  | number | Total token count for the generation request (prompt + candidates). |

---

### Reference Main Generative Ai.Usagemetadata.Prompttokencount (`docs/reference/main/generative-ai.usagemetadata.prompttokencount.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [UsageMetadata](./generative-ai.usagemetadata.md) &gt; [promptTokenCount](./generative-ai.usagemetadata.prompttokencount.md)

## UsageMetadata.promptTokenCount property

Number of tokens in the prompt.

**Signature:**

```typescript
promptTokenCount: number;
```

---

### Reference Main Generative Ai.Usagemetadata.Totaltokencount (`docs/reference/main/generative-ai.usagemetadata.totaltokencount.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [UsageMetadata](./generative-ai.usagemetadata.md) &gt; [totalTokenCount](./generative-ai.usagemetadata.totaltokencount.md)

## UsageMetadata.totalTokenCount property

Total token count for the generation request (prompt + candidates).

**Signature:**

```typescript
totalTokenCount: number;
```

---

### Reference Server Generative Ai.Arrayschema.Items (`docs/reference/server/generative-ai.arrayschema.items.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ArraySchema](./generative-ai.arrayschema.md) &gt; [items](./generative-ai.arrayschema.items.md)

## ArraySchema.items property

A schema describing the entries in the array.

**Signature:**

```typescript
items: Schema;
```

---

### Reference Server Generative Ai.Arrayschema.Maxitems (`docs/reference/server/generative-ai.arrayschema.maxitems.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ArraySchema](./generative-ai.arrayschema.md) &gt; [maxItems](./generative-ai.arrayschema.maxitems.md)

## ArraySchema.maxItems property

The maximum number of items in the array.

**Signature:**

```typescript
maxItems?: number;
```

---

### Reference Server Generative Ai.Arrayschema (`docs/reference/server/generative-ai.arrayschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ArraySchema](./generative-ai.arrayschema.md)

## ArraySchema interface

Describes an array, an ordered list of values.

**Signature:**

```typescript
export interface ArraySchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [items](./generative-ai.arrayschema.items.md) |  | [Schema](./generative-ai.schema.md) | A schema describing the entries in the array. |
|  [maxItems?](./generative-ai.arrayschema.maxitems.md) |  | number | _(Optional)_ The maximum number of items in the array. |
|  [minItems?](./generative-ai.arrayschema.minitems.md) |  | number | _(Optional)_ The minimum number of items in the array. |
|  [type](./generative-ai.arrayschema.type.md) |  | typeof [SchemaType.ARRAY](./generative-ai.schematype.md) |  |

---

### Reference Server Generative Ai.Arrayschema.Minitems (`docs/reference/server/generative-ai.arrayschema.minitems.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ArraySchema](./generative-ai.arrayschema.md) &gt; [minItems](./generative-ai.arrayschema.minitems.md)

## ArraySchema.minItems property

The minimum number of items in the array.

**Signature:**

```typescript
minItems?: number;
```

---

### Reference Server Generative Ai.Arrayschema.Type (`docs/reference/server/generative-ai.arrayschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ArraySchema](./generative-ai.arrayschema.md) &gt; [type](./generative-ai.arrayschema.type.md)

## ArraySchema.type property

**Signature:**

```typescript
type: typeof SchemaType.ARRAY;
```

---

### Reference Server Generative Ai.Booleanschema (`docs/reference/server/generative-ai.booleanschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BooleanSchema](./generative-ai.booleanschema.md)

## BooleanSchema interface

Describes a boolean, either 'true' or 'false'.

**Signature:**

```typescript
export interface BooleanSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [type](./generative-ai.booleanschema.type.md) |  | typeof [SchemaType.BOOLEAN](./generative-ai.schematype.md) |  |

---

### Reference Server Generative Ai.Booleanschema.Type (`docs/reference/server/generative-ai.booleanschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [BooleanSchema](./generative-ai.booleanschema.md) &gt; [type](./generative-ai.booleanschema.type.md)

## BooleanSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.BOOLEAN;
```

---

### Reference Server Generative Ai.Cachedcontent.Createtime (`docs/reference/server/generative-ai.cachedcontent.createtime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContent](./generative-ai.cachedcontent.md) &gt; [createTime](./generative-ai.cachedcontent.createtime.md)

## CachedContent.createTime property

`CachedContent` creation time in ISO string format.

**Signature:**

```typescript
createTime?: string;
```

---

### Reference Server Generative Ai.Cachedcontent (`docs/reference/server/generative-ai.cachedcontent.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContent](./generative-ai.cachedcontent.md)

## CachedContent interface

Describes `CachedContent` interface for sending to the server (if creating) or received from the server (using getters or list methods).

**Signature:**

```typescript
export interface CachedContent extends CachedContentBase 
```
**Extends:** [CachedContentBase](./generative-ai.cachedcontentbase.md)

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [createTime?](./generative-ai.cachedcontent.createtime.md) |  | string | _(Optional)_ <code>CachedContent</code> creation time in ISO string format. |
|  [name?](./generative-ai.cachedcontent.name.md) |  | string | _(Optional)_ |
|  [ttl?](./generative-ai.cachedcontent.ttl.md) |  | string | _(Optional)_ protobuf.Duration format (ex. "3.0001s"). |
|  [updateTime?](./generative-ai.cachedcontent.updatetime.md) |  | string | _(Optional)_ <code>CachedContent</code> update time in ISO string format. |

---

### Reference Server Generative Ai.Cachedcontent.Name (`docs/reference/server/generative-ai.cachedcontent.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContent](./generative-ai.cachedcontent.md) &gt; [name](./generative-ai.cachedcontent.name.md)

## CachedContent.name property

**Signature:**

```typescript
name?: string;
```

---

### Reference Server Generative Ai.Cachedcontent.Ttl (`docs/reference/server/generative-ai.cachedcontent.ttl.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContent](./generative-ai.cachedcontent.md) &gt; [ttl](./generative-ai.cachedcontent.ttl.md)

## CachedContent.ttl property

protobuf.Duration format (ex. "3.0001s").

**Signature:**

```typescript
ttl?: string;
```

---

### Reference Server Generative Ai.Cachedcontent.Updatetime (`docs/reference/server/generative-ai.cachedcontent.updatetime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContent](./generative-ai.cachedcontent.md) &gt; [updateTime](./generative-ai.cachedcontent.updatetime.md)

## CachedContent.updateTime property

`CachedContent` update time in ISO string format.

**Signature:**

```typescript
updateTime?: string;
```

---

### Reference Server Generative Ai.Cachedcontentbase.Contents (`docs/reference/server/generative-ai.cachedcontentbase.contents.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [contents](./generative-ai.cachedcontentbase.contents.md)

## CachedContentBase.contents property

**Signature:**

```typescript
contents: Content[];
```

---

### Reference Server Generative Ai.Cachedcontentbase.Displayname (`docs/reference/server/generative-ai.cachedcontentbase.displayname.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [displayName](./generative-ai.cachedcontentbase.displayname.md)

## CachedContentBase.displayName property

**Signature:**

```typescript
displayName?: string;
```

---

### Reference Server Generative Ai.Cachedcontentbase.Expiretime (`docs/reference/server/generative-ai.cachedcontentbase.expiretime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [expireTime](./generative-ai.cachedcontentbase.expiretime.md)

## CachedContentBase.expireTime property

Expiration time in ISO string format. Specify either this or `ttlSeconds` when creating a `CachedContent`.

**Signature:**

```typescript
expireTime?: string;
```

---

### Reference Server Generative Ai.Cachedcontentbase (`docs/reference/server/generative-ai.cachedcontentbase.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md)

## CachedContentBase interface


**Signature:**

```typescript
export interface CachedContentBase 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [contents](./generative-ai.cachedcontentbase.contents.md) |  | [Content](./generative-ai.content.md)\[\] |  |
|  [displayName?](./generative-ai.cachedcontentbase.displayname.md) |  | string | _(Optional)_ |
|  [expireTime?](./generative-ai.cachedcontentbase.expiretime.md) |  | string | _(Optional)_ Expiration time in ISO string format. Specify either this or <code>ttlSeconds</code> when creating a <code>CachedContent</code>. |
|  [model?](./generative-ai.cachedcontentbase.model.md) |  | string | _(Optional)_ |
|  [systemInstruction?](./generative-ai.cachedcontentbase.systeminstruction.md) |  | string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) | _(Optional)_ |
|  [toolConfig?](./generative-ai.cachedcontentbase.toolconfig.md) |  | [ToolConfig](./generative-ai.toolconfig.md) | _(Optional)_ |
|  [tools?](./generative-ai.cachedcontentbase.tools.md) |  | [Tool](./generative-ai.tool.md)\[\] | _(Optional)_ |

---

### Reference Server Generative Ai.Cachedcontentbase.Model (`docs/reference/server/generative-ai.cachedcontentbase.model.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [model](./generative-ai.cachedcontentbase.model.md)

## CachedContentBase.model property

**Signature:**

```typescript
model?: string;
```

---

### Reference Server Generative Ai.Cachedcontentbase.Systeminstruction (`docs/reference/server/generative-ai.cachedcontentbase.systeminstruction.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [systemInstruction](./generative-ai.cachedcontentbase.systeminstruction.md)

## CachedContentBase.systemInstruction property

**Signature:**

```typescript
systemInstruction?: string | Part | Content;
```

---

### Reference Server Generative Ai.Cachedcontentbase.Toolconfig (`docs/reference/server/generative-ai.cachedcontentbase.toolconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [toolConfig](./generative-ai.cachedcontentbase.toolconfig.md)

## CachedContentBase.toolConfig property

**Signature:**

```typescript
toolConfig?: ToolConfig;
```

---

### Reference Server Generative Ai.Cachedcontentbase.Tools (`docs/reference/server/generative-ai.cachedcontentbase.tools.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentBase](./generative-ai.cachedcontentbase.md) &gt; [tools](./generative-ai.cachedcontentbase.tools.md)

## CachedContentBase.tools property

**Signature:**

```typescript
tools?: Tool[];
```

---

### Reference Server Generative Ai.Cachedcontentcreateparams (`docs/reference/server/generative-ai.cachedcontentcreateparams.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentCreateParams](./generative-ai.cachedcontentcreateparams.md)

## CachedContentCreateParams interface

Params to pass to [GoogleAICacheManager.create()](./generative-ai.googleaicachemanager.create.md).

**Signature:**

```typescript
export interface CachedContentCreateParams extends CachedContentBase 
```
**Extends:** [CachedContentBase](./generative-ai.cachedcontentbase.md)

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [ttlSeconds?](./generative-ai.cachedcontentcreateparams.ttlseconds.md) |  | number | _(Optional)_ <code>CachedContent</code> ttl in seconds. Specify either this or <code>expireTime</code> when creating a <code>CachedContent</code>. |

---

### Reference Server Generative Ai.Cachedcontentcreateparams.Ttlseconds (`docs/reference/server/generative-ai.cachedcontentcreateparams.ttlseconds.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentCreateParams](./generative-ai.cachedcontentcreateparams.md) &gt; [ttlSeconds](./generative-ai.cachedcontentcreateparams.ttlseconds.md)

## CachedContentCreateParams.ttlSeconds property

`CachedContent` ttl in seconds. Specify either this or `expireTime` when creating a `CachedContent`.

**Signature:**

```typescript
ttlSeconds?: number;
```

---

### Reference Server Generative Ai.Cachedcontentupdateinputfields.Expiretime (`docs/reference/server/generative-ai.cachedcontentupdateinputfields.expiretime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentUpdateInputFields](./generative-ai.cachedcontentupdateinputfields.md) &gt; [expireTime](./generative-ai.cachedcontentupdateinputfields.expiretime.md)

## CachedContentUpdateInputFields.expireTime property

**Signature:**

```typescript
expireTime?: string;
```

---

### Reference Server Generative Ai.Cachedcontentupdateinputfields (`docs/reference/server/generative-ai.cachedcontentupdateinputfields.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentUpdateInputFields](./generative-ai.cachedcontentupdateinputfields.md)

## CachedContentUpdateInputFields interface

Fields that can be updated in an existing content cache.

**Signature:**

```typescript
export interface CachedContentUpdateInputFields 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [expireTime?](./generative-ai.cachedcontentupdateinputfields.expiretime.md) |  | string | _(Optional)_ |
|  [ttlSeconds?](./generative-ai.cachedcontentupdateinputfields.ttlseconds.md) |  | number | _(Optional)_ |

---

### Reference Server Generative Ai.Cachedcontentupdateinputfields.Ttlseconds (`docs/reference/server/generative-ai.cachedcontentupdateinputfields.ttlseconds.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentUpdateInputFields](./generative-ai.cachedcontentupdateinputfields.md) &gt; [ttlSeconds](./generative-ai.cachedcontentupdateinputfields.ttlseconds.md)

## CachedContentUpdateInputFields.ttlSeconds property

**Signature:**

```typescript
ttlSeconds?: number;
```

---

### Reference Server Generative Ai.Cachedcontentupdateparams.Cachedcontent (`docs/reference/server/generative-ai.cachedcontentupdateparams.cachedcontent.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentUpdateParams](./generative-ai.cachedcontentupdateparams.md) &gt; [cachedContent](./generative-ai.cachedcontentupdateparams.cachedcontent.md)

## CachedContentUpdateParams.cachedContent property

**Signature:**

```typescript
cachedContent: CachedContentUpdateInputFields;
```

---

### Reference Server Generative Ai.Cachedcontentupdateparams (`docs/reference/server/generative-ai.cachedcontentupdateparams.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentUpdateParams](./generative-ai.cachedcontentupdateparams.md)

## CachedContentUpdateParams interface

Params to pass to [GoogleAICacheManager.update()](./generative-ai.googleaicachemanager.update.md).

**Signature:**

```typescript
export interface CachedContentUpdateParams 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [cachedContent](./generative-ai.cachedcontentupdateparams.cachedcontent.md) |  | [CachedContentUpdateInputFields](./generative-ai.cachedcontentupdateinputfields.md) |  |
|  [updateMask?](./generative-ai.cachedcontentupdateparams.updatemask.md) |  | string\[\] | _(Optional)_ protobuf FieldMask. If not specified, updates all provided fields. |

---

### Reference Server Generative Ai.Cachedcontentupdateparams.Updatemask (`docs/reference/server/generative-ai.cachedcontentupdateparams.updatemask.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CachedContentUpdateParams](./generative-ai.cachedcontentupdateparams.md) &gt; [updateMask](./generative-ai.cachedcontentupdateparams.updatemask.md)

## CachedContentUpdateParams.updateMask property

protobuf FieldMask. If not specified, updates all provided fields.

**Signature:**

```typescript
updateMask?: string[];
```

---

### Reference Server Generative Ai.Codeexecutionresult (`docs/reference/server/generative-ai.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResult](./generative-ai.codeexecutionresult.md)

## CodeExecutionResult interface

Result of executing the `ExecutableCode`. Only generated when using code execution, and always follows a `Part` containing the `ExecutableCode`.

**Signature:**

```typescript
export interface CodeExecutionResult 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [outcome](./generative-ai.codeexecutionresult.outcome.md) |  | [Outcome](./generative-ai.outcome.md) | Outcome of the code execution. |
|  [output](./generative-ai.codeexecutionresult.output.md) |  | string | Contains stdout when code execution is successful, stderr or other description otherwise. |

---

### Reference Server Generative Ai.Codeexecutionresult.Outcome (`docs/reference/server/generative-ai.codeexecutionresult.outcome.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResult](./generative-ai.codeexecutionresult.md) &gt; [outcome](./generative-ai.codeexecutionresult.outcome.md)

## CodeExecutionResult.outcome property

Outcome of the code execution.

**Signature:**

```typescript
outcome: Outcome;
```

---

### Reference Server Generative Ai.Codeexecutionresult.Output (`docs/reference/server/generative-ai.codeexecutionresult.output.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResult](./generative-ai.codeexecutionresult.md) &gt; [output](./generative-ai.codeexecutionresult.output.md)

## CodeExecutionResult.output property

Contains stdout when code execution is successful, stderr or other description otherwise.

**Signature:**

```typescript
output: string;
```

---

### Reference Server Generative Ai.Codeexecutionresultpart.Codeexecutionresult (`docs/reference/server/generative-ai.codeexecutionresultpart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [codeExecutionResult](./generative-ai.codeexecutionresultpart.codeexecutionresult.md)

## CodeExecutionResultPart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult: CodeExecutionResult;
```

---

### Reference Server Generative Ai.Codeexecutionresultpart.Executablecode (`docs/reference/server/generative-ai.codeexecutionresultpart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [executableCode](./generative-ai.codeexecutionresultpart.executablecode.md)

## CodeExecutionResultPart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Server Generative Ai.Codeexecutionresultpart.Filedata (`docs/reference/server/generative-ai.codeexecutionresultpart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [fileData](./generative-ai.codeexecutionresultpart.filedata.md)

## CodeExecutionResultPart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Server Generative Ai.Codeexecutionresultpart.Functioncall (`docs/reference/server/generative-ai.codeexecutionresultpart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [functionCall](./generative-ai.codeexecutionresultpart.functioncall.md)

## CodeExecutionResultPart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Server Generative Ai.Codeexecutionresultpart.Functionresponse (`docs/reference/server/generative-ai.codeexecutionresultpart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [functionResponse](./generative-ai.codeexecutionresultpart.functionresponse.md)

## CodeExecutionResultPart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Server Generative Ai.Codeexecutionresultpart.Inlinedata (`docs/reference/server/generative-ai.codeexecutionresultpart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [inlineData](./generative-ai.codeexecutionresultpart.inlinedata.md)

## CodeExecutionResultPart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Server Generative Ai.Codeexecutionresultpart (`docs/reference/server/generative-ai.codeexecutionresultpart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md)

## CodeExecutionResultPart interface

Content part containing the result of executed code.

**Signature:**

```typescript
export interface CodeExecutionResultPart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult](./generative-ai.codeexecutionresultpart.codeexecutionresult.md) |  | [CodeExecutionResult](./generative-ai.codeexecutionresult.md) |  |
|  [executableCode?](./generative-ai.codeexecutionresultpart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData?](./generative-ai.codeexecutionresultpart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall?](./generative-ai.codeexecutionresultpart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse?](./generative-ai.codeexecutionresultpart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData?](./generative-ai.codeexecutionresultpart.inlinedata.md) |  | never | _(Optional)_ |
|  [text?](./generative-ai.codeexecutionresultpart.text.md) |  | never | _(Optional)_ |

---

### Reference Server Generative Ai.Codeexecutionresultpart.Text (`docs/reference/server/generative-ai.codeexecutionresultpart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) &gt; [text](./generative-ai.codeexecutionresultpart.text.md)

## CodeExecutionResultPart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Server Generative Ai.Codeexecutiontool.Codeexecution (`docs/reference/server/generative-ai.codeexecutiontool.codeexecution.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionTool](./generative-ai.codeexecutiontool.md) &gt; [codeExecution](./generative-ai.codeexecutiontool.codeexecution.md)

## CodeExecutionTool.codeExecution property

Provide an empty object to enable code execution. This field may have subfields added in the future.

**Signature:**

```typescript
codeExecution: {};
```

---

### Reference Server Generative Ai.Codeexecutiontool (`docs/reference/server/generative-ai.codeexecutiontool.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [CodeExecutionTool](./generative-ai.codeexecutiontool.md)

## CodeExecutionTool interface

Enables the model to execute code as part of generation.

**Signature:**

```typescript
export interface CodeExecutionTool 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecution](./generative-ai.codeexecutiontool.codeexecution.md) |  | {} | Provide an empty object to enable code execution. This field may have subfields added in the future. |

---

### Reference Server Generative Ai.Content (`docs/reference/server/generative-ai.content.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Content](./generative-ai.content.md)

## Content interface

Content type for both prompts and response candidates.

**Signature:**

```typescript
export interface Content 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [parts](./generative-ai.content.parts.md) |  | [Part](./generative-ai.part.md)\[\] |  |
|  [role](./generative-ai.content.role.md) |  | string |  |

---

### Reference Server Generative Ai.Content.Parts (`docs/reference/server/generative-ai.content.parts.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Content](./generative-ai.content.md) &gt; [parts](./generative-ai.content.parts.md)

## Content.parts property

**Signature:**

```typescript
parts: Part[];
```

---

### Reference Server Generative Ai.Content.Role (`docs/reference/server/generative-ai.content.role.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Content](./generative-ai.content.md) &gt; [role](./generative-ai.content.role.md)

## Content.role property

**Signature:**

```typescript
role: string;
```

---

### Reference Server Generative Ai.Enumstringschema.Enum (`docs/reference/server/generative-ai.enumstringschema.enum.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnumStringSchema](./generative-ai.enumstringschema.md) &gt; [enum](./generative-ai.enumstringschema.enum.md)

## EnumStringSchema.enum property

Possible values for this enum

**Signature:**

```typescript
enum: string[];
```

---

### Reference Server Generative Ai.Enumstringschema.Format (`docs/reference/server/generative-ai.enumstringschema.format.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnumStringSchema](./generative-ai.enumstringschema.md) &gt; [format](./generative-ai.enumstringschema.format.md)

## EnumStringSchema.format property

**Signature:**

```typescript
format: "enum";
```

---

### Reference Server Generative Ai.Enumstringschema (`docs/reference/server/generative-ai.enumstringschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnumStringSchema](./generative-ai.enumstringschema.md)

## EnumStringSchema interface

Describes a string enum

**Signature:**

```typescript
export interface EnumStringSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [enum](./generative-ai.enumstringschema.enum.md) |  | string\[\] | Possible values for this enum |
|  [format](./generative-ai.enumstringschema.format.md) |  | "enum" |  |
|  [type](./generative-ai.enumstringschema.type.md) |  | typeof [SchemaType.STRING](./generative-ai.schematype.md) |  |

---

### Reference Server Generative Ai.Enumstringschema.Type (`docs/reference/server/generative-ai.enumstringschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [EnumStringSchema](./generative-ai.enumstringschema.md) &gt; [type](./generative-ai.enumstringschema.type.md)

## EnumStringSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.STRING;
```

---

### Reference Server Generative Ai.Errordetails.  Type  (`docs/reference/server/generative-ai.errordetails.__type_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; ["@type"](./generative-ai.errordetails.__type_.md)

## ErrorDetails."@type" property

**Signature:**

```typescript
"@type"?: string;
```

---

### Reference Server Generative Ai.Errordetails.Domain (`docs/reference/server/generative-ai.errordetails.domain.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; [domain](./generative-ai.errordetails.domain.md)

## ErrorDetails.domain property

**Signature:**

```typescript
domain?: string;
```

---

### Reference Server Generative Ai.Errordetails (`docs/reference/server/generative-ai.errordetails.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md)

## ErrorDetails interface

Details object that may be included in an error response.

**Signature:**

```typescript
export interface ErrorDetails 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  ["@type"?](./generative-ai.errordetails.__type_.md) |  | string | _(Optional)_ |
|  [domain?](./generative-ai.errordetails.domain.md) |  | string | _(Optional)_ |
|  [metadata?](./generative-ai.errordetails.metadata.md) |  | Record&lt;string, unknown&gt; | _(Optional)_ |
|  [reason?](./generative-ai.errordetails.reason.md) |  | string | _(Optional)_ |

---

### Reference Server Generative Ai.Errordetails.Metadata (`docs/reference/server/generative-ai.errordetails.metadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; [metadata](./generative-ai.errordetails.metadata.md)

## ErrorDetails.metadata property

**Signature:**

```typescript
metadata?: Record<string, unknown>;
```

---

### Reference Server Generative Ai.Errordetails.Reason (`docs/reference/server/generative-ai.errordetails.reason.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ErrorDetails](./generative-ai.errordetails.md) &gt; [reason](./generative-ai.errordetails.reason.md)

## ErrorDetails.reason property

**Signature:**

```typescript
reason?: string;
```

---

### Reference Server Generative Ai.Executablecode.Code (`docs/reference/server/generative-ai.executablecode.code.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCode](./generative-ai.executablecode.md) &gt; [code](./generative-ai.executablecode.code.md)

## ExecutableCode.code property

The code to be executed.

**Signature:**

```typescript
code: string;
```

---

### Reference Server Generative Ai.Executablecode.Language (`docs/reference/server/generative-ai.executablecode.language.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCode](./generative-ai.executablecode.md) &gt; [language](./generative-ai.executablecode.language.md)

## ExecutableCode.language property

Programming language of the `code`.

**Signature:**

```typescript
language: ExecutableCodeLanguage;
```

---

### Reference Server Generative Ai.Executablecode (`docs/reference/server/generative-ai.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCode](./generative-ai.executablecode.md)

## ExecutableCode interface

Code generated by the model that is meant to be executed, where the result is returned to the model. Only generated when using the code execution tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.

**Signature:**

```typescript
export interface ExecutableCode 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [code](./generative-ai.executablecode.code.md) |  | string | The code to be executed. |
|  [language](./generative-ai.executablecode.language.md) |  | [ExecutableCodeLanguage](./generative-ai.executablecodelanguage.md) | Programming language of the <code>code</code>. |

---

### Reference Server Generative Ai.Executablecodelanguage (`docs/reference/server/generative-ai.executablecodelanguage.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodeLanguage](./generative-ai.executablecodelanguage.md)

## ExecutableCodeLanguage enum


**Signature:**

```typescript
export declare enum ExecutableCodeLanguage 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  LANGUAGE\_UNSPECIFIED | <code>&quot;language_unspecified&quot;</code> |  |
|  PYTHON | <code>&quot;python&quot;</code> |  |

---

### Reference Server Generative Ai.Executablecodepart.Codeexecutionresult (`docs/reference/server/generative-ai.executablecodepart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [codeExecutionResult](./generative-ai.executablecodepart.codeexecutionresult.md)

## ExecutableCodePart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Server Generative Ai.Executablecodepart.Executablecode (`docs/reference/server/generative-ai.executablecodepart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [executableCode](./generative-ai.executablecodepart.executablecode.md)

## ExecutableCodePart.executableCode property

**Signature:**

```typescript
executableCode: ExecutableCode;
```

---

### Reference Server Generative Ai.Executablecodepart.Filedata (`docs/reference/server/generative-ai.executablecodepart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [fileData](./generative-ai.executablecodepart.filedata.md)

## ExecutableCodePart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Server Generative Ai.Executablecodepart.Functioncall (`docs/reference/server/generative-ai.executablecodepart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [functionCall](./generative-ai.executablecodepart.functioncall.md)

## ExecutableCodePart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Server Generative Ai.Executablecodepart.Functionresponse (`docs/reference/server/generative-ai.executablecodepart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [functionResponse](./generative-ai.executablecodepart.functionresponse.md)

## ExecutableCodePart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Server Generative Ai.Executablecodepart.Inlinedata (`docs/reference/server/generative-ai.executablecodepart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [inlineData](./generative-ai.executablecodepart.inlinedata.md)

## ExecutableCodePart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Server Generative Ai.Executablecodepart (`docs/reference/server/generative-ai.executablecodepart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md)

## ExecutableCodePart interface

Content part containing executable code generated by the model.

**Signature:**

```typescript
export interface ExecutableCodePart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.executablecodepart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode](./generative-ai.executablecodepart.executablecode.md) |  | [ExecutableCode](./generative-ai.executablecode.md) |  |
|  [fileData?](./generative-ai.executablecodepart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall?](./generative-ai.executablecodepart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse?](./generative-ai.executablecodepart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData?](./generative-ai.executablecodepart.inlinedata.md) |  | never | _(Optional)_ |
|  [text?](./generative-ai.executablecodepart.text.md) |  | never | _(Optional)_ |

---

### Reference Server Generative Ai.Executablecodepart.Text (`docs/reference/server/generative-ai.executablecodepart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ExecutableCodePart](./generative-ai.executablecodepart.md) &gt; [text](./generative-ai.executablecodepart.text.md)

## ExecutableCodePart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Server Generative Ai.Filedata.Fileuri (`docs/reference/server/generative-ai.filedata.fileuri.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileData](./generative-ai.filedata.md) &gt; [fileUri](./generative-ai.filedata.fileuri.md)

## FileData.fileUri property

**Signature:**

```typescript
fileUri: string;
```

---

### Reference Server Generative Ai.Filedata (`docs/reference/server/generative-ai.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileData](./generative-ai.filedata.md)

## FileData interface

Data pointing to a file uploaded with the Files API.

**Signature:**

```typescript
export interface FileData 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [fileUri](./generative-ai.filedata.fileuri.md) |  | string |  |
|  [mimeType](./generative-ai.filedata.mimetype.md) |  | string |  |

---

### Reference Server Generative Ai.Filedata.Mimetype (`docs/reference/server/generative-ai.filedata.mimetype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileData](./generative-ai.filedata.md) &gt; [mimeType](./generative-ai.filedata.mimetype.md)

## FileData.mimeType property

**Signature:**

```typescript
mimeType: string;
```

---

### Reference Server Generative Ai.Filedatapart.Codeexecutionresult (`docs/reference/server/generative-ai.filedatapart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [codeExecutionResult](./generative-ai.filedatapart.codeexecutionresult.md)

## FileDataPart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Server Generative Ai.Filedatapart.Executablecode (`docs/reference/server/generative-ai.filedatapart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [executableCode](./generative-ai.filedatapart.executablecode.md)

## FileDataPart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Server Generative Ai.Filedatapart.Filedata (`docs/reference/server/generative-ai.filedatapart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [fileData](./generative-ai.filedatapart.filedata.md)

## FileDataPart.fileData property

**Signature:**

```typescript
fileData: FileData;
```

---

### Reference Server Generative Ai.Filedatapart.Functioncall (`docs/reference/server/generative-ai.filedatapart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [functionCall](./generative-ai.filedatapart.functioncall.md)

## FileDataPart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Server Generative Ai.Filedatapart.Functionresponse (`docs/reference/server/generative-ai.filedatapart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [functionResponse](./generative-ai.filedatapart.functionresponse.md)

## FileDataPart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Server Generative Ai.Filedatapart.Inlinedata (`docs/reference/server/generative-ai.filedatapart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [inlineData](./generative-ai.filedatapart.inlinedata.md)

## FileDataPart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Server Generative Ai.Filedatapart (`docs/reference/server/generative-ai.filedatapart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md)

## FileDataPart interface

Content part interface if the part represents FileData.

**Signature:**

```typescript
export interface FileDataPart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.filedatapart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode?](./generative-ai.filedatapart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData](./generative-ai.filedatapart.filedata.md) |  | [FileData](./generative-ai.filedata.md) |  |
|  [functionCall?](./generative-ai.filedatapart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse?](./generative-ai.filedatapart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData?](./generative-ai.filedatapart.inlinedata.md) |  | never | _(Optional)_ |
|  [text?](./generative-ai.filedatapart.text.md) |  | never | _(Optional)_ |

---

### Reference Server Generative Ai.Filedatapart.Text (`docs/reference/server/generative-ai.filedatapart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileDataPart](./generative-ai.filedatapart.md) &gt; [text](./generative-ai.filedatapart.text.md)

## FileDataPart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Server Generative Ai.Filemetadata.Displayname (`docs/reference/server/generative-ai.filemetadata.displayname.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadata](./generative-ai.filemetadata.md) &gt; [displayName](./generative-ai.filemetadata.displayname.md)

## FileMetadata.displayName property

**Signature:**

```typescript
displayName?: string;
```

---

### Reference Server Generative Ai.Filemetadata (`docs/reference/server/generative-ai.filemetadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadata](./generative-ai.filemetadata.md)

## FileMetadata interface

Metadata to provide alongside a file upload

**Signature:**

```typescript
export interface FileMetadata 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [displayName?](./generative-ai.filemetadata.displayname.md) |  | string | _(Optional)_ |
|  [mimeType](./generative-ai.filemetadata.mimetype.md) |  | string |  |
|  [name?](./generative-ai.filemetadata.name.md) |  | string | _(Optional)_ |

---

### Reference Server Generative Ai.Filemetadata.Mimetype (`docs/reference/server/generative-ai.filemetadata.mimetype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadata](./generative-ai.filemetadata.md) &gt; [mimeType](./generative-ai.filemetadata.mimetype.md)

## FileMetadata.mimeType property

**Signature:**

```typescript
mimeType: string;
```

---

### Reference Server Generative Ai.Filemetadata.Name (`docs/reference/server/generative-ai.filemetadata.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadata](./generative-ai.filemetadata.md) &gt; [name](./generative-ai.filemetadata.name.md)

## FileMetadata.name property

**Signature:**

```typescript
name?: string;
```

---

### Reference Server Generative Ai.Filemetadataresponse.Createtime (`docs/reference/server/generative-ai.filemetadataresponse.createtime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [createTime](./generative-ai.filemetadataresponse.createtime.md)

## FileMetadataResponse.createTime property

**Signature:**

```typescript
createTime: string;
```

---

### Reference Server Generative Ai.Filemetadataresponse.Displayname (`docs/reference/server/generative-ai.filemetadataresponse.displayname.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [displayName](./generative-ai.filemetadataresponse.displayname.md)

## FileMetadataResponse.displayName property

**Signature:**

```typescript
displayName?: string;
```

---

### Reference Server Generative Ai.Filemetadataresponse.Error (`docs/reference/server/generative-ai.filemetadataresponse.error.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [error](./generative-ai.filemetadataresponse.error.md)

## FileMetadataResponse.error property

Error populated if file processing has failed.

**Signature:**

```typescript
error?: RpcStatus;
```

---

### Reference Server Generative Ai.Filemetadataresponse.Expirationtime (`docs/reference/server/generative-ai.filemetadataresponse.expirationtime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [expirationTime](./generative-ai.filemetadataresponse.expirationtime.md)

## FileMetadataResponse.expirationTime property

**Signature:**

```typescript
expirationTime: string;
```

---

### Reference Server Generative Ai.Filemetadataresponse (`docs/reference/server/generative-ai.filemetadataresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md)

## FileMetadataResponse interface

File metadata response from server.

**Signature:**

```typescript
export interface FileMetadataResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [createTime](./generative-ai.filemetadataresponse.createtime.md) |  | string |  |
|  [displayName?](./generative-ai.filemetadataresponse.displayname.md) |  | string | _(Optional)_ |
|  [error?](./generative-ai.filemetadataresponse.error.md) |  | [RpcStatus](./generative-ai.rpcstatus.md) | _(Optional)_ Error populated if file processing has failed. |
|  [expirationTime](./generative-ai.filemetadataresponse.expirationtime.md) |  | string |  |
|  [mimeType](./generative-ai.filemetadataresponse.mimetype.md) |  | string |  |
|  [name](./generative-ai.filemetadataresponse.name.md) |  | string |  |
|  [sha256Hash](./generative-ai.filemetadataresponse.sha256hash.md) |  | string |  |
|  [sizeBytes](./generative-ai.filemetadataresponse.sizebytes.md) |  | string |  |
|  [state](./generative-ai.filemetadataresponse.state.md) |  | [FileState](./generative-ai.filestate.md) |  |
|  [updateTime](./generative-ai.filemetadataresponse.updatetime.md) |  | string |  |
|  [uri](./generative-ai.filemetadataresponse.uri.md) |  | string |  |
|  [videoMetadata?](./generative-ai.filemetadataresponse.videometadata.md) |  | [VideoMetadata](./generative-ai.videometadata.md) | _(Optional)_ Video metadata populated after processing is complete. |

---

### Reference Server Generative Ai.Filemetadataresponse.Mimetype (`docs/reference/server/generative-ai.filemetadataresponse.mimetype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [mimeType](./generative-ai.filemetadataresponse.mimetype.md)

## FileMetadataResponse.mimeType property

**Signature:**

```typescript
mimeType: string;
```

---

### Reference Server Generative Ai.Filemetadataresponse.Name (`docs/reference/server/generative-ai.filemetadataresponse.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [name](./generative-ai.filemetadataresponse.name.md)

## FileMetadataResponse.name property

**Signature:**

```typescript
name: string;
```

---

### Reference Server Generative Ai.Filemetadataresponse.Sha256hash (`docs/reference/server/generative-ai.filemetadataresponse.sha256hash.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [sha256Hash](./generative-ai.filemetadataresponse.sha256hash.md)

## FileMetadataResponse.sha256Hash property

**Signature:**

```typescript
sha256Hash: string;
```

---

### Reference Server Generative Ai.Filemetadataresponse.Sizebytes (`docs/reference/server/generative-ai.filemetadataresponse.sizebytes.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [sizeBytes](./generative-ai.filemetadataresponse.sizebytes.md)

## FileMetadataResponse.sizeBytes property

**Signature:**

```typescript
sizeBytes: string;
```

---

### Reference Server Generative Ai.Filemetadataresponse.State (`docs/reference/server/generative-ai.filemetadataresponse.state.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [state](./generative-ai.filemetadataresponse.state.md)

## FileMetadataResponse.state property

**Signature:**

```typescript
state: FileState;
```

---

### Reference Server Generative Ai.Filemetadataresponse.Updatetime (`docs/reference/server/generative-ai.filemetadataresponse.updatetime.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [updateTime](./generative-ai.filemetadataresponse.updatetime.md)

## FileMetadataResponse.updateTime property

**Signature:**

```typescript
updateTime: string;
```

---

### Reference Server Generative Ai.Filemetadataresponse.Uri (`docs/reference/server/generative-ai.filemetadataresponse.uri.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [uri](./generative-ai.filemetadataresponse.uri.md)

## FileMetadataResponse.uri property

**Signature:**

```typescript
uri: string;
```

---

### Reference Server Generative Ai.Filemetadataresponse.Videometadata (`docs/reference/server/generative-ai.filemetadataresponse.videometadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileMetadataResponse](./generative-ai.filemetadataresponse.md) &gt; [videoMetadata](./generative-ai.filemetadataresponse.videometadata.md)

## FileMetadataResponse.videoMetadata property

Video metadata populated after processing is complete.

**Signature:**

```typescript
videoMetadata?: VideoMetadata;
```

---

### Reference Server Generative Ai.Filestate (`docs/reference/server/generative-ai.filestate.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FileState](./generative-ai.filestate.md)

## FileState enum

Processing state of the `File`.

**Signature:**

```typescript
export declare enum FileState 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  ACTIVE | <code>&quot;ACTIVE&quot;</code> |  |
|  FAILED | <code>&quot;FAILED&quot;</code> |  |
|  PROCESSING | <code>&quot;PROCESSING&quot;</code> |  |
|  STATE\_UNSPECIFIED | <code>&quot;STATE_UNSPECIFIED&quot;</code> |  |

---

### Reference Server Generative Ai.Functioncall.Args (`docs/reference/server/generative-ai.functioncall.args.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCall](./generative-ai.functioncall.md) &gt; [args](./generative-ai.functioncall.args.md)

## FunctionCall.args property

**Signature:**

```typescript
args: object;
```

---

### Reference Server Generative Ai.Functioncall (`docs/reference/server/generative-ai.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCall](./generative-ai.functioncall.md)

## FunctionCall interface

A predicted \[FunctionCall\] returned from the model that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing the parameters and their values.

**Signature:**

```typescript
export interface FunctionCall 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [args](./generative-ai.functioncall.args.md) |  | object |  |
|  [name](./generative-ai.functioncall.name.md) |  | string |  |

---

### Reference Server Generative Ai.Functioncall.Name (`docs/reference/server/generative-ai.functioncall.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCall](./generative-ai.functioncall.md) &gt; [name](./generative-ai.functioncall.name.md)

## FunctionCall.name property

**Signature:**

```typescript
name: string;
```

---

### Reference Server Generative Ai.Functioncallingconfig.Allowedfunctionnames (`docs/reference/server/generative-ai.functioncallingconfig.allowedfunctionnames.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallingConfig](./generative-ai.functioncallingconfig.md) &gt; [allowedFunctionNames](./generative-ai.functioncallingconfig.allowedfunctionnames.md)

## FunctionCallingConfig.allowedFunctionNames property

**Signature:**

```typescript
allowedFunctionNames?: string[];
```

---

### Reference Server Generative Ai.Functioncallingconfig (`docs/reference/server/generative-ai.functioncallingconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallingConfig](./generative-ai.functioncallingconfig.md)

## FunctionCallingConfig interface


**Signature:**

```typescript
export interface FunctionCallingConfig 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [allowedFunctionNames?](./generative-ai.functioncallingconfig.allowedfunctionnames.md) |  | string\[\] | _(Optional)_ |
|  [mode?](./generative-ai.functioncallingconfig.mode.md) |  | [FunctionCallingMode](./generative-ai.functioncallingmode.md) | _(Optional)_ |

---

### Reference Server Generative Ai.Functioncallingconfig.Mode (`docs/reference/server/generative-ai.functioncallingconfig.mode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallingConfig](./generative-ai.functioncallingconfig.md) &gt; [mode](./generative-ai.functioncallingconfig.mode.md)

## FunctionCallingConfig.mode property

**Signature:**

```typescript
mode?: FunctionCallingMode;
```

---

### Reference Server Generative Ai.Functioncallingmode (`docs/reference/server/generative-ai.functioncallingmode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallingMode](./generative-ai.functioncallingmode.md)

## FunctionCallingMode enum


**Signature:**

```typescript
export declare enum FunctionCallingMode 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  ANY | <code>&quot;ANY&quot;</code> |  |
|  AUTO | <code>&quot;AUTO&quot;</code> |  |
|  MODE\_UNSPECIFIED | <code>&quot;MODE_UNSPECIFIED&quot;</code> |  |
|  NONE | <code>&quot;NONE&quot;</code> |  |

---

### Reference Server Generative Ai.Functioncallpart.Codeexecutionresult (`docs/reference/server/generative-ai.functioncallpart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [codeExecutionResult](./generative-ai.functioncallpart.codeexecutionresult.md)

## FunctionCallPart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Server Generative Ai.Functioncallpart.Executablecode (`docs/reference/server/generative-ai.functioncallpart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [executableCode](./generative-ai.functioncallpart.executablecode.md)

## FunctionCallPart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Server Generative Ai.Functioncallpart.Filedata (`docs/reference/server/generative-ai.functioncallpart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [fileData](./generative-ai.functioncallpart.filedata.md)

## FunctionCallPart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Server Generative Ai.Functioncallpart.Functioncall (`docs/reference/server/generative-ai.functioncallpart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [functionCall](./generative-ai.functioncallpart.functioncall.md)

## FunctionCallPart.functionCall property

**Signature:**

```typescript
functionCall: FunctionCall;
```

---

### Reference Server Generative Ai.Functioncallpart.Functionresponse (`docs/reference/server/generative-ai.functioncallpart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [functionResponse](./generative-ai.functioncallpart.functionresponse.md)

## FunctionCallPart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Server Generative Ai.Functioncallpart.Inlinedata (`docs/reference/server/generative-ai.functioncallpart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [inlineData](./generative-ai.functioncallpart.inlinedata.md)

## FunctionCallPart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Server Generative Ai.Functioncallpart (`docs/reference/server/generative-ai.functioncallpart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md)

## FunctionCallPart interface

Content part interface if the part represents a FunctionCall.

**Signature:**

```typescript
export interface FunctionCallPart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.functioncallpart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode?](./generative-ai.functioncallpart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData?](./generative-ai.functioncallpart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall](./generative-ai.functioncallpart.functioncall.md) |  | [FunctionCall](./generative-ai.functioncall.md) |  |
|  [functionResponse?](./generative-ai.functioncallpart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData?](./generative-ai.functioncallpart.inlinedata.md) |  | never | _(Optional)_ |
|  [text?](./generative-ai.functioncallpart.text.md) |  | never | _(Optional)_ |

---

### Reference Server Generative Ai.Functioncallpart.Text (`docs/reference/server/generative-ai.functioncallpart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionCallPart](./generative-ai.functioncallpart.md) &gt; [text](./generative-ai.functioncallpart.text.md)

## FunctionCallPart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Server Generative Ai.Functiondeclaration.Description (`docs/reference/server/generative-ai.functiondeclaration.description.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclaration](./generative-ai.functiondeclaration.md) &gt; [description](./generative-ai.functiondeclaration.description.md)

## FunctionDeclaration.description property

Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.

**Signature:**

```typescript
description?: string;
```

---

### Reference Server Generative Ai.Functiondeclaration (`docs/reference/server/generative-ai.functiondeclaration.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclaration](./generative-ai.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.

**Signature:**

```typescript
export declare interface FunctionDeclaration 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [description?](./generative-ai.functiondeclaration.description.md) |  | string | _(Optional)_ Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. |
|  [name](./generative-ai.functiondeclaration.name.md) |  | 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?](./generative-ai.functiondeclaration.parameters.md) |  | [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) | _(Optional)_ Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. |

---

### Reference Server Generative Ai.Functiondeclaration.Name (`docs/reference/server/generative-ai.functiondeclaration.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclaration](./generative-ai.functiondeclaration.md) &gt; [name](./generative-ai.functiondeclaration.name.md)

## FunctionDeclaration.name property

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.

**Signature:**

```typescript
name: string;
```

---

### Reference Server Generative Ai.Functiondeclaration.Parameters (`docs/reference/server/generative-ai.functiondeclaration.parameters.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclaration](./generative-ai.functiondeclaration.md) &gt; [parameters](./generative-ai.functiondeclaration.parameters.md)

## FunctionDeclaration.parameters property

Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset.

**Signature:**

```typescript
parameters?: FunctionDeclarationSchema;
```

## Example

with 1 required and 1 optional parameter: type: OBJECT properties:

```
param1:

  type: STRING
param2:

 type: INTEGER
required:

  - param1
```

---

### Reference Server Generative Ai.Functiondeclarationschema.Description (`docs/reference/server/generative-ai.functiondeclarationschema.description.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) &gt; [description](./generative-ai.functiondeclarationschema.description.md)

## FunctionDeclarationSchema.description property

Optional. Description of the parameter.

**Signature:**

```typescript
description?: string;
```

---

### Reference Server Generative Ai.Functiondeclarationschema (`docs/reference/server/generative-ai.functiondeclarationschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md)

## FunctionDeclarationSchema interface

Schema for parameters passed to [FunctionDeclaration.parameters](./generative-ai.functiondeclaration.parameters.md).

**Signature:**

```typescript
export interface FunctionDeclarationSchema 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [description?](./generative-ai.functiondeclarationschema.description.md) |  | string | _(Optional)_ Optional. Description of the parameter. |
|  [properties](./generative-ai.functiondeclarationschema.properties.md) |  | { \[k: string\]: [FunctionDeclarationSchemaProperty](./generative-ai.functiondeclarationschemaproperty.md); } | The format of the parameter. |
|  [required?](./generative-ai.functiondeclarationschema.required.md) |  | string\[\] | _(Optional)_ Optional. Array of required parameters. |
|  [type](./generative-ai.functiondeclarationschema.type.md) |  | [SchemaType](./generative-ai.schematype.md) | The type of the parameter. |

---

### Reference Server Generative Ai.Functiondeclarationschema.Properties (`docs/reference/server/generative-ai.functiondeclarationschema.properties.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) &gt; [properties](./generative-ai.functiondeclarationschema.properties.md)

## FunctionDeclarationSchema.properties property

The format of the parameter.

**Signature:**

```typescript
properties: {
        [k: string]: FunctionDeclarationSchemaProperty;
    };
```

---

### Reference Server Generative Ai.Functiondeclarationschema.Required (`docs/reference/server/generative-ai.functiondeclarationschema.required.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) &gt; [required](./generative-ai.functiondeclarationschema.required.md)

## FunctionDeclarationSchema.required property

Optional. Array of required parameters.

**Signature:**

```typescript
required?: string[];
```

---

### Reference Server Generative Ai.Functiondeclarationschema.Type (`docs/reference/server/generative-ai.functiondeclarationschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) &gt; [type](./generative-ai.functiondeclarationschema.type.md)

## FunctionDeclarationSchema.type property

The type of the parameter.

**Signature:**

```typescript
type: SchemaType;
```

---

### Reference Server Generative Ai.Functiondeclarationschemaproperty (`docs/reference/server/generative-ai.functiondeclarationschemaproperty.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationSchemaProperty](./generative-ai.functiondeclarationschemaproperty.md)

## FunctionDeclarationSchemaProperty type

Schema for top-level function declaration

**Signature:**

```typescript
export type FunctionDeclarationSchemaProperty = Schema;
```
**References:** [Schema](./generative-ai.schema.md)

---

### Reference Server Generative Ai.Functiondeclarationstool.Functiondeclarations (`docs/reference/server/generative-ai.functiondeclarationstool.functiondeclarations.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationsTool](./generative-ai.functiondeclarationstool.md) &gt; [functionDeclarations](./generative-ai.functiondeclarationstool.functiondeclarations.md)

## FunctionDeclarationsTool.functionDeclarations property

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\]\[content.part.functionCall\] in the response. User should provide a \[FunctionResponse\]\[content.part.functionResponse\] for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided.

**Signature:**

```typescript
functionDeclarations?: FunctionDeclaration[];
```

---

### Reference Server Generative Ai.Functiondeclarationstool (`docs/reference/server/generative-ai.functiondeclarationstool.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionDeclarationsTool](./generative-ai.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.

**Signature:**

```typescript
export declare interface FunctionDeclarationsTool 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [functionDeclarations?](./generative-ai.functiondeclarationstool.functiondeclarations.md) |  | [FunctionDeclaration](./generative-ai.functiondeclaration.md)\[\] | _(Optional)_ 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\]\[content.part.functionCall\] in the response. User should provide a \[FunctionResponse\]\[content.part.functionResponse\] for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided. |

---

### Reference Server Generative Ai.Functionresponse (`docs/reference/server/generative-ai.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponse](./generative-ai.functionresponse.md)

## FunctionResponse interface

The result output from a \[FunctionCall\] that contains a string representing the \[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 \[FunctionCall\] made based on model prediction.

**Signature:**

```typescript
export interface FunctionResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [name](./generative-ai.functionresponse.name.md) |  | string |  |
|  [response](./generative-ai.functionresponse.response.md) |  | object |  |

---

### Reference Server Generative Ai.Functionresponse.Name (`docs/reference/server/generative-ai.functionresponse.name.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponse](./generative-ai.functionresponse.md) &gt; [name](./generative-ai.functionresponse.name.md)

## FunctionResponse.name property

**Signature:**

```typescript
name: string;
```

---

### Reference Server Generative Ai.Functionresponse.Response (`docs/reference/server/generative-ai.functionresponse.response.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponse](./generative-ai.functionresponse.md) &gt; [response](./generative-ai.functionresponse.response.md)

## FunctionResponse.response property

**Signature:**

```typescript
response: object;
```

---

### Reference Server Generative Ai.Functionresponsepart.Codeexecutionresult (`docs/reference/server/generative-ai.functionresponsepart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [codeExecutionResult](./generative-ai.functionresponsepart.codeexecutionresult.md)

## FunctionResponsePart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Server Generative Ai.Functionresponsepart.Executablecode (`docs/reference/server/generative-ai.functionresponsepart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [executableCode](./generative-ai.functionresponsepart.executablecode.md)

## FunctionResponsePart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Server Generative Ai.Functionresponsepart.Filedata (`docs/reference/server/generative-ai.functionresponsepart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [fileData](./generative-ai.functionresponsepart.filedata.md)

## FunctionResponsePart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Server Generative Ai.Functionresponsepart.Functioncall (`docs/reference/server/generative-ai.functionresponsepart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [functionCall](./generative-ai.functionresponsepart.functioncall.md)

## FunctionResponsePart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Server Generative Ai.Functionresponsepart.Functionresponse (`docs/reference/server/generative-ai.functionresponsepart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [functionResponse](./generative-ai.functionresponsepart.functionresponse.md)

## FunctionResponsePart.functionResponse property

**Signature:**

```typescript
functionResponse: FunctionResponse;
```

---

### Reference Server Generative Ai.Functionresponsepart.Inlinedata (`docs/reference/server/generative-ai.functionresponsepart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [inlineData](./generative-ai.functionresponsepart.inlinedata.md)

## FunctionResponsePart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Server Generative Ai.Functionresponsepart (`docs/reference/server/generative-ai.functionresponsepart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md)

## FunctionResponsePart interface

Content part interface if the part represents FunctionResponse.

**Signature:**

```typescript
export interface FunctionResponsePart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.functionresponsepart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode?](./generative-ai.functionresponsepart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData?](./generative-ai.functionresponsepart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall?](./generative-ai.functionresponsepart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse](./generative-ai.functionresponsepart.functionresponse.md) |  | [FunctionResponse](./generative-ai.functionresponse.md) |  |
|  [inlineData?](./generative-ai.functionresponsepart.inlinedata.md) |  | never | _(Optional)_ |
|  [text?](./generative-ai.functionresponsepart.text.md) |  | never | _(Optional)_ |

---

### Reference Server Generative Ai.Functionresponsepart.Text (`docs/reference/server/generative-ai.functionresponsepart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [FunctionResponsePart](./generative-ai.functionresponsepart.md) &gt; [text](./generative-ai.functionresponsepart.text.md)

## FunctionResponsePart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Server Generative Ai.Generativecontentblob.Data (`docs/reference/server/generative-ai.generativecontentblob.data.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeContentBlob](./generative-ai.generativecontentblob.md) &gt; [data](./generative-ai.generativecontentblob.data.md)

## GenerativeContentBlob.data property

Image as a base64 string.

**Signature:**

```typescript
data: string;
```

---

### Reference Server Generative Ai.Generativecontentblob (`docs/reference/server/generative-ai.generativecontentblob.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeContentBlob](./generative-ai.generativecontentblob.md)

## GenerativeContentBlob interface

Interface for sending an image.

**Signature:**

```typescript
export interface GenerativeContentBlob 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [data](./generative-ai.generativecontentblob.data.md) |  | string | Image as a base64 string. |
|  [mimeType](./generative-ai.generativecontentblob.mimetype.md) |  | string |  |

---

### Reference Server Generative Ai.Generativecontentblob.Mimetype (`docs/reference/server/generative-ai.generativecontentblob.mimetype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GenerativeContentBlob](./generative-ai.generativecontentblob.md) &gt; [mimeType](./generative-ai.generativecontentblob.mimetype.md)

## GenerativeContentBlob.mimeType property

**Signature:**

```typescript
mimeType: string;
```

---

### Reference Server Generative Ai.Googleaicachemanager. Constructor  (`docs/reference/server/generative-ai.googleaicachemanager._constructor_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAICacheManager](./generative-ai.googleaicachemanager.md) &gt; [(constructor)](./generative-ai.googleaicachemanager._constructor_.md)

## GoogleAICacheManager.(constructor)

Constructs a new instance of the `GoogleAICacheManager` class

**Signature:**

```typescript
constructor(apiKey: string, _requestOptions?: RequestOptions);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  apiKey | string |  |
|  \_requestOptions | [RequestOptions](./generative-ai.requestoptions.md) | _(Optional)_ |

---

### Reference Server Generative Ai.Googleaicachemanager.Apikey (`docs/reference/server/generative-ai.googleaicachemanager.apikey.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAICacheManager](./generative-ai.googleaicachemanager.md) &gt; [apiKey](./generative-ai.googleaicachemanager.apikey.md)

## GoogleAICacheManager.apiKey property

**Signature:**

```typescript
apiKey: string;
```

---

### Reference Server Generative Ai.Googleaicachemanager.Create (`docs/reference/server/generative-ai.googleaicachemanager.create.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAICacheManager](./generative-ai.googleaicachemanager.md) &gt; [create](./generative-ai.googleaicachemanager.create.md)

## GoogleAICacheManager.create() method

Upload a new content cache

**Signature:**

```typescript
create(createOptions: CachedContentCreateParams): Promise<CachedContent>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  createOptions | [CachedContentCreateParams](./generative-ai.cachedcontentcreateparams.md) |  |

**Returns:**

Promise&lt;[CachedContent](./generative-ai.cachedcontent.md)&gt;

---

### Reference Server Generative Ai.Googleaicachemanager.Delete (`docs/reference/server/generative-ai.googleaicachemanager.delete.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAICacheManager](./generative-ai.googleaicachemanager.md) &gt; [delete](./generative-ai.googleaicachemanager.delete.md)

## GoogleAICacheManager.delete() method

Delete content cache with given name

**Signature:**

```typescript
delete(name: string): Promise<void>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  name | string |  |

**Returns:**

Promise&lt;void&gt;

---

### Reference Server Generative Ai.Googleaicachemanager.Get (`docs/reference/server/generative-ai.googleaicachemanager.get.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAICacheManager](./generative-ai.googleaicachemanager.md) &gt; [get](./generative-ai.googleaicachemanager.get.md)

## GoogleAICacheManager.get() method

Get a content cache

**Signature:**

```typescript
get(name: string): Promise<CachedContent>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  name | string |  |

**Returns:**

Promise&lt;[CachedContent](./generative-ai.cachedcontent.md)&gt;

---

### Reference Server Generative Ai.Googleaicachemanager.List (`docs/reference/server/generative-ai.googleaicachemanager.list.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAICacheManager](./generative-ai.googleaicachemanager.md) &gt; [list](./generative-ai.googleaicachemanager.list.md)

## GoogleAICacheManager.list() method

List all uploaded content caches

**Signature:**

```typescript
list(listParams?: ListParams): Promise<ListCacheResponse>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  listParams | [ListParams](./generative-ai.listparams.md) | _(Optional)_ |

**Returns:**

Promise&lt;[ListCacheResponse](./generative-ai.listcacheresponse.md)&gt;

---

### Reference Server Generative Ai.Googleaicachemanager (`docs/reference/server/generative-ai.googleaicachemanager.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAICacheManager](./generative-ai.googleaicachemanager.md)

## GoogleAICacheManager class

Class for managing GoogleAI content caches.

**Signature:**

```typescript
export declare class GoogleAICacheManager 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(apiKey, \_requestOptions)](./generative-ai.googleaicachemanager._constructor_.md) |  | Constructs a new instance of the <code>GoogleAICacheManager</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [apiKey](./generative-ai.googleaicachemanager.apikey.md) |  | string |  |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [create(createOptions)](./generative-ai.googleaicachemanager.create.md) |  | Upload a new content cache |
|  [delete(name)](./generative-ai.googleaicachemanager.delete.md) |  | Delete content cache with given name |
|  [get(name)](./generative-ai.googleaicachemanager.get.md) |  | Get a content cache |
|  [list(listParams)](./generative-ai.googleaicachemanager.list.md) |  | List all uploaded content caches |
|  [update(name, updateParams)](./generative-ai.googleaicachemanager.update.md) |  | Update an existing content cache |

---

### Reference Server Generative Ai.Googleaicachemanager.Update (`docs/reference/server/generative-ai.googleaicachemanager.update.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAICacheManager](./generative-ai.googleaicachemanager.md) &gt; [update](./generative-ai.googleaicachemanager.update.md)

## GoogleAICacheManager.update() method

Update an existing content cache

**Signature:**

```typescript
update(name: string, updateParams: CachedContentUpdateParams): Promise<CachedContent>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  name | string |  |
|  updateParams | [CachedContentUpdateParams](./generative-ai.cachedcontentupdateparams.md) |  |

**Returns:**

Promise&lt;[CachedContent](./generative-ai.cachedcontent.md)&gt;

---

### Reference Server Generative Ai.Googleaifilemanager. Constructor  (`docs/reference/server/generative-ai.googleaifilemanager._constructor_.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [(constructor)](./generative-ai.googleaifilemanager._constructor_.md)

## GoogleAIFileManager.(constructor)

Constructs a new instance of the `GoogleAIFileManager` class

**Signature:**

```typescript
constructor(apiKey: string, _requestOptions?: RequestOptions);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  apiKey | string |  |
|  \_requestOptions | [RequestOptions](./generative-ai.requestoptions.md) | _(Optional)_ |

---

### Reference Server Generative Ai.Googleaifilemanager.Apikey (`docs/reference/server/generative-ai.googleaifilemanager.apikey.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [apiKey](./generative-ai.googleaifilemanager.apikey.md)

## GoogleAIFileManager.apiKey property

**Signature:**

```typescript
apiKey: string;
```

---

### Reference Server Generative Ai.Googleaifilemanager.Deletefile (`docs/reference/server/generative-ai.googleaifilemanager.deletefile.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [deleteFile](./generative-ai.googleaifilemanager.deletefile.md)

## GoogleAIFileManager.deleteFile() method

Delete file with given ID.

**Signature:**

```typescript
deleteFile(fileId: string): Promise<void>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  fileId | string |  |

**Returns:**

Promise&lt;void&gt;

---

### Reference Server Generative Ai.Googleaifilemanager.Getfile (`docs/reference/server/generative-ai.googleaifilemanager.getfile.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [getFile](./generative-ai.googleaifilemanager.getfile.md)

## GoogleAIFileManager.getFile() method

Get metadata for file with given ID.

Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.

**Signature:**

```typescript
getFile(fileId: string, requestOptions?: SingleRequestOptions): Promise<FileMetadataResponse>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  fileId | string |  |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[FileMetadataResponse](./generative-ai.filemetadataresponse.md)&gt;

---

### Reference Server Generative Ai.Googleaifilemanager.Listfiles (`docs/reference/server/generative-ai.googleaifilemanager.listfiles.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [listFiles](./generative-ai.googleaifilemanager.listfiles.md)

## GoogleAIFileManager.listFiles() method

List all uploaded files.

Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.

**Signature:**

```typescript
listFiles(listParams?: ListParams, requestOptions?: SingleRequestOptions): Promise<ListFilesResponse>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  listParams | [ListParams](./generative-ai.listparams.md) | _(Optional)_ |
|  requestOptions | [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | _(Optional)_ |

**Returns:**

Promise&lt;[ListFilesResponse](./generative-ai.listfilesresponse.md)&gt;

---

### Reference Server Generative Ai.Googleaifilemanager (`docs/reference/server/generative-ai.googleaifilemanager.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md)

## GoogleAIFileManager class

Class for managing GoogleAI file uploads.

**Signature:**

```typescript
export declare class GoogleAIFileManager 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(apiKey, \_requestOptions)](./generative-ai.googleaifilemanager._constructor_.md) |  | Constructs a new instance of the <code>GoogleAIFileManager</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [apiKey](./generative-ai.googleaifilemanager.apikey.md) |  | string |  |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [deleteFile(fileId)](./generative-ai.googleaifilemanager.deletefile.md) |  | Delete file with given ID. |
|  [getFile(fileId, requestOptions)](./generative-ai.googleaifilemanager.getfile.md) |  | <p>Get metadata for file with given ID.</p><p>Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.</p> |
|  [listFiles(listParams, requestOptions)](./generative-ai.googleaifilemanager.listfiles.md) |  | <p>List all uploaded files.</p><p>Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.</p> |
|  [uploadFile(fileData, fileMetadata)](./generative-ai.googleaifilemanager.uploadfile.md) |  | Upload a file. |

---

### Reference Server Generative Ai.Googleaifilemanager.Uploadfile (`docs/reference/server/generative-ai.googleaifilemanager.uploadfile.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) &gt; [uploadFile](./generative-ai.googleaifilemanager.uploadfile.md)

## GoogleAIFileManager.uploadFile() method

Upload a file.

**Signature:**

```typescript
uploadFile(fileData: string | Buffer, fileMetadata: FileMetadata): Promise<UploadFileResponse>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  fileData | string \| Buffer |  |
|  fileMetadata | [FileMetadata](./generative-ai.filemetadata.md) |  |

**Returns:**

Promise&lt;[UploadFileResponse](./generative-ai.uploadfileresponse.md)&gt;

---

### Reference Server Generative Ai.Inlinedatapart.Codeexecutionresult (`docs/reference/server/generative-ai.inlinedatapart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [codeExecutionResult](./generative-ai.inlinedatapart.codeexecutionresult.md)

## InlineDataPart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Server Generative Ai.Inlinedatapart.Executablecode (`docs/reference/server/generative-ai.inlinedatapart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [executableCode](./generative-ai.inlinedatapart.executablecode.md)

## InlineDataPart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Server Generative Ai.Inlinedatapart.Filedata (`docs/reference/server/generative-ai.inlinedatapart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [fileData](./generative-ai.inlinedatapart.filedata.md)

## InlineDataPart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Server Generative Ai.Inlinedatapart.Functioncall (`docs/reference/server/generative-ai.inlinedatapart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [functionCall](./generative-ai.inlinedatapart.functioncall.md)

## InlineDataPart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Server Generative Ai.Inlinedatapart.Functionresponse (`docs/reference/server/generative-ai.inlinedatapart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [functionResponse](./generative-ai.inlinedatapart.functionresponse.md)

## InlineDataPart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Server Generative Ai.Inlinedatapart.Inlinedata (`docs/reference/server/generative-ai.inlinedatapart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [inlineData](./generative-ai.inlinedatapart.inlinedata.md)

## InlineDataPart.inlineData property

**Signature:**

```typescript
inlineData: GenerativeContentBlob;
```

---

### Reference Server Generative Ai.Inlinedatapart (`docs/reference/server/generative-ai.inlinedatapart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md)

## InlineDataPart interface

Content part interface if the part represents an image.

**Signature:**

```typescript
export interface InlineDataPart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.inlinedatapart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode?](./generative-ai.inlinedatapart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData?](./generative-ai.inlinedatapart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall?](./generative-ai.inlinedatapart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse?](./generative-ai.inlinedatapart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData](./generative-ai.inlinedatapart.inlinedata.md) |  | [GenerativeContentBlob](./generative-ai.generativecontentblob.md) |  |
|  [text?](./generative-ai.inlinedatapart.text.md) |  | never | _(Optional)_ |

---

### Reference Server Generative Ai.Inlinedatapart.Text (`docs/reference/server/generative-ai.inlinedatapart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [InlineDataPart](./generative-ai.inlinedatapart.md) &gt; [text](./generative-ai.inlinedatapart.text.md)

## InlineDataPart.text property

**Signature:**

```typescript
text?: never;
```

---

### Reference Server Generative Ai.Integerschema.Format (`docs/reference/server/generative-ai.integerschema.format.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [IntegerSchema](./generative-ai.integerschema.md) &gt; [format](./generative-ai.integerschema.format.md)

## IntegerSchema.format property

Optional. The format of the number.

**Signature:**

```typescript
format?: "int32" | "int64";
```

---

### Reference Server Generative Ai.Integerschema (`docs/reference/server/generative-ai.integerschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [IntegerSchema](./generative-ai.integerschema.md)

## IntegerSchema interface

Describes a JSON-encodable integer.

**Signature:**

```typescript
export interface IntegerSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [format?](./generative-ai.integerschema.format.md) |  | "int32" \| "int64" | _(Optional)_ Optional. The format of the number. |
|  [type](./generative-ai.integerschema.type.md) |  | typeof [SchemaType.INTEGER](./generative-ai.schematype.md) |  |

---

### Reference Server Generative Ai.Integerschema.Type (`docs/reference/server/generative-ai.integerschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [IntegerSchema](./generative-ai.integerschema.md) &gt; [type](./generative-ai.integerschema.type.md)

## IntegerSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.INTEGER;
```

---

### Reference Server Generative Ai.Listcacheresponse.Cachedcontents (`docs/reference/server/generative-ai.listcacheresponse.cachedcontents.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListCacheResponse](./generative-ai.listcacheresponse.md) &gt; [cachedContents](./generative-ai.listcacheresponse.cachedcontents.md)

## ListCacheResponse.cachedContents property

**Signature:**

```typescript
cachedContents: CachedContent[];
```

---

### Reference Server Generative Ai.Listcacheresponse (`docs/reference/server/generative-ai.listcacheresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListCacheResponse](./generative-ai.listcacheresponse.md)

## ListCacheResponse interface


**Signature:**

```typescript
export interface ListCacheResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [cachedContents](./generative-ai.listcacheresponse.cachedcontents.md) |  | [CachedContent](./generative-ai.cachedcontent.md)\[\] |  |
|  [nextPageToken?](./generative-ai.listcacheresponse.nextpagetoken.md) |  | string | _(Optional)_ |

---

### Reference Server Generative Ai.Listcacheresponse.Nextpagetoken (`docs/reference/server/generative-ai.listcacheresponse.nextpagetoken.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListCacheResponse](./generative-ai.listcacheresponse.md) &gt; [nextPageToken](./generative-ai.listcacheresponse.nextpagetoken.md)

## ListCacheResponse.nextPageToken property

**Signature:**

```typescript
nextPageToken?: string;
```

---

### Reference Server Generative Ai.Listfilesresponse.Files (`docs/reference/server/generative-ai.listfilesresponse.files.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListFilesResponse](./generative-ai.listfilesresponse.md) &gt; [files](./generative-ai.listfilesresponse.files.md)

## ListFilesResponse.files property

**Signature:**

```typescript
files: FileMetadataResponse[];
```

---

### Reference Server Generative Ai.Listfilesresponse (`docs/reference/server/generative-ai.listfilesresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListFilesResponse](./generative-ai.listfilesresponse.md)

## ListFilesResponse interface

Response from calling [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md)

**Signature:**

```typescript
export interface ListFilesResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [files](./generative-ai.listfilesresponse.files.md) |  | [FileMetadataResponse](./generative-ai.filemetadataresponse.md)\[\] |  |
|  [nextPageToken?](./generative-ai.listfilesresponse.nextpagetoken.md) |  | string | _(Optional)_ |

---

### Reference Server Generative Ai.Listfilesresponse.Nextpagetoken (`docs/reference/server/generative-ai.listfilesresponse.nextpagetoken.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListFilesResponse](./generative-ai.listfilesresponse.md) &gt; [nextPageToken](./generative-ai.listfilesresponse.nextpagetoken.md)

## ListFilesResponse.nextPageToken property

**Signature:**

```typescript
nextPageToken?: string;
```

---

### Reference Server Generative Ai.Listparams (`docs/reference/server/generative-ai.listparams.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListParams](./generative-ai.listparams.md)

## ListParams interface

Params to pass to [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md) or [GoogleAICacheManager.list()](./generative-ai.googleaicachemanager.list.md)

**Signature:**

```typescript
export interface ListParams 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [pageSize?](./generative-ai.listparams.pagesize.md) |  | number | _(Optional)_ |
|  [pageToken?](./generative-ai.listparams.pagetoken.md) |  | string | _(Optional)_ |

---

### Reference Server Generative Ai.Listparams.Pagesize (`docs/reference/server/generative-ai.listparams.pagesize.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListParams](./generative-ai.listparams.md) &gt; [pageSize](./generative-ai.listparams.pagesize.md)

## ListParams.pageSize property

**Signature:**

```typescript
pageSize?: number;
```

---

### Reference Server Generative Ai.Listparams.Pagetoken (`docs/reference/server/generative-ai.listparams.pagetoken.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ListParams](./generative-ai.listparams.md) &gt; [pageToken](./generative-ai.listparams.pagetoken.md)

## ListParams.pageToken property

**Signature:**

```typescript
pageToken?: string;
```

---

### Reference Server Generative Ai (`docs/reference/server/generative-ai.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md)

## generative-ai package

## Classes

|  Class | Description |
|  --- | --- |
|  [GoogleAICacheManager](./generative-ai.googleaicachemanager.md) | Class for managing GoogleAI content caches. |
|  [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) | Class for managing GoogleAI file uploads. |

## Enumerations

|  Enumeration | Description |
|  --- | --- |
|  [ExecutableCodeLanguage](./generative-ai.executablecodelanguage.md) |  |
|  [FileState](./generative-ai.filestate.md) | Processing state of the <code>File</code>. |
|  [FunctionCallingMode](./generative-ai.functioncallingmode.md) |  |
|  [Outcome](./generative-ai.outcome.md) | Possible outcomes of code execution. |
|  [SchemaType](./generative-ai.schematype.md) | Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ |

## Interfaces

|  Interface | Description |
|  --- | --- |
|  [ArraySchema](./generative-ai.arrayschema.md) | Describes an array, an ordered list of values. |
|  [BooleanSchema](./generative-ai.booleanschema.md) | Describes a boolean, either 'true' or 'false'. |
|  [CachedContent](./generative-ai.cachedcontent.md) | Describes <code>CachedContent</code> interface for sending to the server (if creating) or received from the server (using getters or list methods). |
|  [CachedContentBase](./generative-ai.cachedcontentbase.md) |  |
|  [CachedContentCreateParams](./generative-ai.cachedcontentcreateparams.md) | Params to pass to [GoogleAICacheManager.create()](./generative-ai.googleaicachemanager.create.md). |
|  [CachedContentUpdateInputFields](./generative-ai.cachedcontentupdateinputfields.md) | Fields that can be updated in an existing content cache. |
|  [CachedContentUpdateParams](./generative-ai.cachedcontentupdateparams.md) | Params to pass to [GoogleAICacheManager.update()](./generative-ai.googleaicachemanager.update.md). |
|  [CodeExecutionResult](./generative-ai.codeexecutionresult.md) | Result of executing the <code>ExecutableCode</code>. Only generated when using code execution, and always follows a <code>Part</code> containing the <code>ExecutableCode</code>. |
|  [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) | Content part containing the result of executed code. |
|  [CodeExecutionTool](./generative-ai.codeexecutiontool.md) | Enables the model to execute code as part of generation. |
|  [Content](./generative-ai.content.md) | Content type for both prompts and response candidates. |
|  [EnumStringSchema](./generative-ai.enumstringschema.md) | Describes a string enum |
|  [ErrorDetails](./generative-ai.errordetails.md) | Details object that may be included in an error response. |
|  [ExecutableCode](./generative-ai.executablecode.md) | Code generated by the model that is meant to be executed, where the result is returned to the model. Only generated when using the code execution tool, in which the code will be automatically executed, and a corresponding <code>CodeExecutionResult</code> will also be generated. |
|  [ExecutableCodePart](./generative-ai.executablecodepart.md) | Content part containing executable code generated by the model. |
|  [FileData](./generative-ai.filedata.md) | Data pointing to a file uploaded with the Files API. |
|  [FileDataPart](./generative-ai.filedatapart.md) | Content part interface if the part represents FileData. |
|  [FileMetadata](./generative-ai.filemetadata.md) | Metadata to provide alongside a file upload |
|  [FileMetadataResponse](./generative-ai.filemetadataresponse.md) | File metadata response from server. |
|  [FunctionCall](./generative-ai.functioncall.md) | A predicted \[FunctionCall\] returned from the model that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing the parameters and their values. |
|  [FunctionCallingConfig](./generative-ai.functioncallingconfig.md) |  |
|  [FunctionCallPart](./generative-ai.functioncallpart.md) | Content part interface if the part represents a FunctionCall. |
|  [FunctionDeclaration](./generative-ai.functiondeclaration.md) | 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](./generative-ai.functiondeclarationschema.md) | Schema for parameters passed to [FunctionDeclaration.parameters](./generative-ai.functiondeclaration.parameters.md). |
|  [FunctionDeclarationsTool](./generative-ai.functiondeclarationstool.md) | 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](./generative-ai.functionresponse.md) | The result output from a \[FunctionCall\] that contains a string representing the \[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 \[FunctionCall\] made based on model prediction. |
|  [FunctionResponsePart](./generative-ai.functionresponsepart.md) | Content part interface if the part represents FunctionResponse. |
|  [GenerativeContentBlob](./generative-ai.generativecontentblob.md) | Interface for sending an image. |
|  [InlineDataPart](./generative-ai.inlinedatapart.md) | Content part interface if the part represents an image. |
|  [IntegerSchema](./generative-ai.integerschema.md) | Describes a JSON-encodable integer. |
|  [ListCacheResponse](./generative-ai.listcacheresponse.md) |  |
|  [ListFilesResponse](./generative-ai.listfilesresponse.md) | Response from calling [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md) |
|  [ListParams](./generative-ai.listparams.md) | Params to pass to [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md) or [GoogleAICacheManager.list()](./generative-ai.googleaicachemanager.list.md) |
|  [NumberSchema](./generative-ai.numberschema.md) | Describes a JSON-encodable floating point number. |
|  [ObjectSchema](./generative-ai.objectschema.md) | Describes a JSON object, a mapping of specific keys to values. |
|  [RequestOptions](./generative-ai.requestoptions.md) | Params passed to getGenerativeModel() or GoogleAIFileManager(). |
|  [RpcStatus](./generative-ai.rpcstatus.md) | Standard RPC error status object. |
|  [SimpleStringSchema](./generative-ai.simplestringschema.md) | Describes a simple string schema, with or without format |
|  [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | Params passed to atomic asynchronous operations. |
|  [TextPart](./generative-ai.textpart.md) | Content part interface if the part represents a text string. |
|  [ToolConfig](./generative-ai.toolconfig.md) | Tool config. This config is shared for all tools provided in the request. |
|  [UploadFileResponse](./generative-ai.uploadfileresponse.md) | Response from calling [GoogleAIFileManager.uploadFile()](./generative-ai.googleaifilemanager.uploadfile.md) |
|  [VideoMetadata](./generative-ai.videometadata.md) | Metadata populated when video has been processed. |

## Type Aliases

|  Type Alias | Description |
|  --- | --- |
|  [FunctionDeclarationSchemaProperty](./generative-ai.functiondeclarationschemaproperty.md) | Schema for top-level function declaration |
|  [Part](./generative-ai.part.md) | Content part - includes text or image part types. |
|  [ResponseSchema](./generative-ai.responseschema.md) | Schema passed to <code>GenerationConfig.responseSchema</code> |
|  [Schema](./generative-ai.schema.md) | 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. |
|  [StringSchema](./generative-ai.stringschema.md) | Describes a string. |
|  [Tool](./generative-ai.tool.md) | Defines a tool that model can call to access external knowledge. |

---

### Reference Server Generative Ai.Numberschema.Format (`docs/reference/server/generative-ai.numberschema.format.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [NumberSchema](./generative-ai.numberschema.md) &gt; [format](./generative-ai.numberschema.format.md)

## NumberSchema.format property

Optional. The format of the number.

**Signature:**

```typescript
format?: "float" | "double";
```

---

### Reference Server Generative Ai.Numberschema (`docs/reference/server/generative-ai.numberschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [NumberSchema](./generative-ai.numberschema.md)

## NumberSchema interface

Describes a JSON-encodable floating point number.

**Signature:**

```typescript
export interface NumberSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [format?](./generative-ai.numberschema.format.md) |  | "float" \| "double" | _(Optional)_ Optional. The format of the number. |
|  [type](./generative-ai.numberschema.type.md) |  | typeof [SchemaType.NUMBER](./generative-ai.schematype.md) |  |

---

### Reference Server Generative Ai.Numberschema.Type (`docs/reference/server/generative-ai.numberschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [NumberSchema](./generative-ai.numberschema.md) &gt; [type](./generative-ai.numberschema.type.md)

## NumberSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.NUMBER;
```

---

### Reference Server Generative Ai.Objectschema (`docs/reference/server/generative-ai.objectschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ObjectSchema](./generative-ai.objectschema.md)

## ObjectSchema interface

Describes a JSON object, a mapping of specific keys to values.

**Signature:**

```typescript
export interface ObjectSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [properties](./generative-ai.objectschema.properties.md) |  | { \[k: string\]: [Schema](./generative-ai.schema.md); } | Describes the properties of the JSON object. Must not be empty. |
|  [required?](./generative-ai.objectschema.required.md) |  | string\[\] | _(Optional)_ A list of keys declared in the properties object. Required properties will always be present in the generated object. |
|  [type](./generative-ai.objectschema.type.md) |  | typeof [SchemaType.OBJECT](./generative-ai.schematype.md) |  |

---

### Reference Server Generative Ai.Objectschema.Properties (`docs/reference/server/generative-ai.objectschema.properties.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ObjectSchema](./generative-ai.objectschema.md) &gt; [properties](./generative-ai.objectschema.properties.md)

## ObjectSchema.properties property

Describes the properties of the JSON object. Must not be empty.

**Signature:**

```typescript
properties: {
        [k: string]: Schema;
    };
```

---

### Reference Server Generative Ai.Objectschema.Required (`docs/reference/server/generative-ai.objectschema.required.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ObjectSchema](./generative-ai.objectschema.md) &gt; [required](./generative-ai.objectschema.required.md)

## ObjectSchema.required property

A list of keys declared in the properties object. Required properties will always be present in the generated object.

**Signature:**

```typescript
required?: string[];
```

---

### Reference Server Generative Ai.Objectschema.Type (`docs/reference/server/generative-ai.objectschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ObjectSchema](./generative-ai.objectschema.md) &gt; [type](./generative-ai.objectschema.type.md)

## ObjectSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.OBJECT;
```

---

### Reference Server Generative Ai.Outcome (`docs/reference/server/generative-ai.outcome.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Outcome](./generative-ai.outcome.md)

## Outcome enum

Possible outcomes of code execution.

**Signature:**

```typescript
export declare enum Outcome 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  OUTCOME\_DEADLINE\_EXCEEDED | <code>&quot;outcome_deadline_exceeded&quot;</code> | Code execution ran for too long, and was cancelled. There may or may not be a partial output present. |
|  OUTCOME\_FAILED | <code>&quot;outcome_failed&quot;</code> | Code execution finished but with a failure. <code>stderr</code> should contain the reason. |
|  OUTCOME\_OK | <code>&quot;outcome_ok&quot;</code> | Code execution completed successfully. |
|  OUTCOME\_UNSPECIFIED | <code>&quot;outcome_unspecified&quot;</code> | Unspecified status. This value should not be used. |

---

### Reference Server Generative Ai.Part (`docs/reference/server/generative-ai.part.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Part](./generative-ai.part.md)

## Part type

Content part - includes text or image part types.

**Signature:**

```typescript
export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart | ExecutableCodePart | CodeExecutionResultPart;
```
**References:** [TextPart](./generative-ai.textpart.md), [InlineDataPart](./generative-ai.inlinedatapart.md), [FunctionCallPart](./generative-ai.functioncallpart.md), [FunctionResponsePart](./generative-ai.functionresponsepart.md), [FileDataPart](./generative-ai.filedatapart.md), [ExecutableCodePart](./generative-ai.executablecodepart.md), [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md)

---

### Reference Server Generative Ai.Requestoptions.Apiclient (`docs/reference/server/generative-ai.requestoptions.apiclient.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [apiClient](./generative-ai.requestoptions.apiclient.md)

## RequestOptions.apiClient property

Additional attribution information to include in the x-goog-api-client header. Used by wrapper SDKs.

**Signature:**

```typescript
apiClient?: string;
```

---

### Reference Server Generative Ai.Requestoptions.Apiversion (`docs/reference/server/generative-ai.requestoptions.apiversion.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [apiVersion](./generative-ai.requestoptions.apiversion.md)

## RequestOptions.apiVersion property

Version of API endpoint to call (e.g. "v1" or "v1beta"). If not specified, defaults to latest stable version.

**Signature:**

```typescript
apiVersion?: string;
```

---

### Reference Server Generative Ai.Requestoptions.Baseurl (`docs/reference/server/generative-ai.requestoptions.baseurl.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [baseUrl](./generative-ai.requestoptions.baseurl.md)

## RequestOptions.baseUrl property

Base endpoint url. Defaults to "https://generativelanguage.googleapis.com"

**Signature:**

```typescript
baseUrl?: string;
```

---

### Reference Server Generative Ai.Requestoptions.Customheaders (`docs/reference/server/generative-ai.requestoptions.customheaders.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [customHeaders](./generative-ai.requestoptions.customheaders.md)

## RequestOptions.customHeaders property

Custom HTTP request headers.

**Signature:**

```typescript
customHeaders?: Headers | Record<string, string>;
```

---

### Reference Server Generative Ai.Requestoptions (`docs/reference/server/generative-ai.requestoptions.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md)

## RequestOptions interface

Params passed to getGenerativeModel() or GoogleAIFileManager().

**Signature:**

```typescript
export interface RequestOptions 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [apiClient?](./generative-ai.requestoptions.apiclient.md) |  | string | _(Optional)_ Additional attribution information to include in the x-goog-api-client header. Used by wrapper SDKs. |
|  [apiVersion?](./generative-ai.requestoptions.apiversion.md) |  | string | _(Optional)_ Version of API endpoint to call (e.g. "v1" or "v1beta"). If not specified, defaults to latest stable version. |
|  [baseUrl?](./generative-ai.requestoptions.baseurl.md) |  | string | _(Optional)_ Base endpoint url. Defaults to "https://generativelanguage.googleapis.com" |
|  [customHeaders?](./generative-ai.requestoptions.customheaders.md) |  | Headers \| Record&lt;string, string&gt; | _(Optional)_ Custom HTTP request headers. |
|  [timeout?](./generative-ai.requestoptions.timeout.md) |  | number | _(Optional)_ Request timeout in milliseconds. |

---

### Reference Server Generative Ai.Requestoptions.Timeout (`docs/reference/server/generative-ai.requestoptions.timeout.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [timeout](./generative-ai.requestoptions.timeout.md)

## RequestOptions.timeout property

Request timeout in milliseconds.

**Signature:**

```typescript
timeout?: number;
```

---

### Reference Server Generative Ai.Responseschema (`docs/reference/server/generative-ai.responseschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ResponseSchema](./generative-ai.responseschema.md)

## ResponseSchema type

Schema passed to `GenerationConfig.responseSchema`

**Signature:**

```typescript
export type ResponseSchema = Schema;
```
**References:** [Schema](./generative-ai.schema.md)

---

### Reference Server Generative Ai.Rpcstatus.Code (`docs/reference/server/generative-ai.rpcstatus.code.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RpcStatus](./generative-ai.rpcstatus.md) &gt; [code](./generative-ai.rpcstatus.code.md)

## RpcStatus.code property

Error status code

**Signature:**

```typescript
code: number;
```

---

### Reference Server Generative Ai.Rpcstatus.Details (`docs/reference/server/generative-ai.rpcstatus.details.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RpcStatus](./generative-ai.rpcstatus.md) &gt; [details](./generative-ai.rpcstatus.details.md)

## RpcStatus.details property

A list of messages that carry the error details.

**Signature:**

```typescript
details?: ErrorDetails[];
```

---

### Reference Server Generative Ai.Rpcstatus (`docs/reference/server/generative-ai.rpcstatus.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RpcStatus](./generative-ai.rpcstatus.md)

## RpcStatus interface

Standard RPC error status object.

**Signature:**

```typescript
export interface RpcStatus 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [code](./generative-ai.rpcstatus.code.md) |  | number | Error status code |
|  [details?](./generative-ai.rpcstatus.details.md) |  | [ErrorDetails](./generative-ai.errordetails.md)\[\] | _(Optional)_ A list of messages that carry the error details. |
|  [message](./generative-ai.rpcstatus.message.md) |  | string | A developer-facing error message. |

---

### Reference Server Generative Ai.Rpcstatus.Message (`docs/reference/server/generative-ai.rpcstatus.message.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RpcStatus](./generative-ai.rpcstatus.md) &gt; [message](./generative-ai.rpcstatus.message.md)

## RpcStatus.message property

A developer-facing error message.

**Signature:**

```typescript
message: string;
```

---

### Reference Server Generative Ai.Schema (`docs/reference/server/generative-ai.schema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Schema](./generative-ai.schema.md)

## Schema type

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 type Schema = StringSchema | NumberSchema | IntegerSchema | BooleanSchema | ArraySchema | ObjectSchema;
```
**References:** [StringSchema](./generative-ai.stringschema.md), [NumberSchema](./generative-ai.numberschema.md), [IntegerSchema](./generative-ai.integerschema.md), [BooleanSchema](./generative-ai.booleanschema.md), [ArraySchema](./generative-ai.arrayschema.md), [ObjectSchema](./generative-ai.objectschema.md)

---

### Reference Server Generative Ai.Schematype (`docs/reference/server/generative-ai.schematype.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SchemaType](./generative-ai.schematype.md)

## SchemaType enum

Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/

**Signature:**

```typescript
export declare enum SchemaType 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  ARRAY | <code>&quot;array&quot;</code> | Array type. |
|  BOOLEAN | <code>&quot;boolean&quot;</code> | Boolean type. |
|  INTEGER | <code>&quot;integer&quot;</code> | Integer type. |
|  NUMBER | <code>&quot;number&quot;</code> | Number type. |
|  OBJECT | <code>&quot;object&quot;</code> | Object type. |
|  STRING | <code>&quot;string&quot;</code> | String type. |

---

### Reference Server Generative Ai.Simplestringschema.Enum (`docs/reference/server/generative-ai.simplestringschema.enum.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SimpleStringSchema](./generative-ai.simplestringschema.md) &gt; [enum](./generative-ai.simplestringschema.enum.md)

## SimpleStringSchema.enum property

**Signature:**

```typescript
enum?: never;
```

---

### Reference Server Generative Ai.Simplestringschema.Format (`docs/reference/server/generative-ai.simplestringschema.format.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SimpleStringSchema](./generative-ai.simplestringschema.md) &gt; [format](./generative-ai.simplestringschema.format.md)

## SimpleStringSchema.format property

**Signature:**

```typescript
format?: "date-time" | undefined;
```

---

### Reference Server Generative Ai.Simplestringschema (`docs/reference/server/generative-ai.simplestringschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SimpleStringSchema](./generative-ai.simplestringschema.md)

## SimpleStringSchema interface

Describes a simple string schema, with or without format

**Signature:**

```typescript
export interface SimpleStringSchema extends BaseSchema 
```
**Extends:** BaseSchema

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [enum?](./generative-ai.simplestringschema.enum.md) |  | never | _(Optional)_ |
|  [format?](./generative-ai.simplestringschema.format.md) |  | "date-time" \| undefined | _(Optional)_ |
|  [type](./generative-ai.simplestringschema.type.md) |  | typeof [SchemaType.STRING](./generative-ai.schematype.md) |  |

---

### Reference Server Generative Ai.Simplestringschema.Type (`docs/reference/server/generative-ai.simplestringschema.type.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SimpleStringSchema](./generative-ai.simplestringschema.md) &gt; [type](./generative-ai.simplestringschema.type.md)

## SimpleStringSchema.type property

**Signature:**

```typescript
type: typeof SchemaType.STRING;
```

---

### Reference Server Generative Ai.Singlerequestoptions (`docs/reference/server/generative-ai.singlerequestoptions.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SingleRequestOptions](./generative-ai.singlerequestoptions.md)

## SingleRequestOptions interface

Params passed to atomic asynchronous operations.

**Signature:**

```typescript
export interface SingleRequestOptions extends RequestOptions 
```
**Extends:** [RequestOptions](./generative-ai.requestoptions.md)

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [signal?](./generative-ai.singlerequestoptions.signal.md) |  | AbortSignal | <p>_(Optional)_ An object that may be used to abort asynchronous requests. The request may also be aborted due to the expiration of the timeout value, if provided.</p><p>NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations.</p> |

---

### Reference Server Generative Ai.Singlerequestoptions.Signal (`docs/reference/server/generative-ai.singlerequestoptions.signal.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [SingleRequestOptions](./generative-ai.singlerequestoptions.md) &gt; [signal](./generative-ai.singlerequestoptions.signal.md)

## SingleRequestOptions.signal property

An object that may be used to abort asynchronous requests. The request may also be aborted due to the expiration of the timeout value, if provided.

NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations.

**Signature:**

```typescript
signal?: AbortSignal;
```

---

### Reference Server Generative Ai.Stringschema (`docs/reference/server/generative-ai.stringschema.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [StringSchema](./generative-ai.stringschema.md)

## StringSchema type

Describes a string.

**Signature:**

```typescript
export type StringSchema = SimpleStringSchema | EnumStringSchema;
```
**References:** [SimpleStringSchema](./generative-ai.simplestringschema.md), [EnumStringSchema](./generative-ai.enumstringschema.md)

---

### Reference Server Generative Ai.Textpart.Codeexecutionresult (`docs/reference/server/generative-ai.textpart.codeexecutionresult.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [codeExecutionResult](./generative-ai.textpart.codeexecutionresult.md)

## TextPart.codeExecutionResult property

**Signature:**

```typescript
codeExecutionResult?: never;
```

---

### Reference Server Generative Ai.Textpart.Executablecode (`docs/reference/server/generative-ai.textpart.executablecode.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [executableCode](./generative-ai.textpart.executablecode.md)

## TextPart.executableCode property

**Signature:**

```typescript
executableCode?: never;
```

---

### Reference Server Generative Ai.Textpart.Filedata (`docs/reference/server/generative-ai.textpart.filedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [fileData](./generative-ai.textpart.filedata.md)

## TextPart.fileData property

**Signature:**

```typescript
fileData?: never;
```

---

### Reference Server Generative Ai.Textpart.Functioncall (`docs/reference/server/generative-ai.textpart.functioncall.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [functionCall](./generative-ai.textpart.functioncall.md)

## TextPart.functionCall property

**Signature:**

```typescript
functionCall?: never;
```

---

### Reference Server Generative Ai.Textpart.Functionresponse (`docs/reference/server/generative-ai.textpart.functionresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [functionResponse](./generative-ai.textpart.functionresponse.md)

## TextPart.functionResponse property

**Signature:**

```typescript
functionResponse?: never;
```

---

### Reference Server Generative Ai.Textpart.Inlinedata (`docs/reference/server/generative-ai.textpart.inlinedata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [inlineData](./generative-ai.textpart.inlinedata.md)

## TextPart.inlineData property

**Signature:**

```typescript
inlineData?: never;
```

---

### Reference Server Generative Ai.Textpart (`docs/reference/server/generative-ai.textpart.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md)

## TextPart interface

Content part interface if the part represents a text string.

**Signature:**

```typescript
export interface TextPart 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [codeExecutionResult?](./generative-ai.textpart.codeexecutionresult.md) |  | never | _(Optional)_ |
|  [executableCode?](./generative-ai.textpart.executablecode.md) |  | never | _(Optional)_ |
|  [fileData?](./generative-ai.textpart.filedata.md) |  | never | _(Optional)_ |
|  [functionCall?](./generative-ai.textpart.functioncall.md) |  | never | _(Optional)_ |
|  [functionResponse?](./generative-ai.textpart.functionresponse.md) |  | never | _(Optional)_ |
|  [inlineData?](./generative-ai.textpart.inlinedata.md) |  | never | _(Optional)_ |
|  [text](./generative-ai.textpart.text.md) |  | string |  |

---

### Reference Server Generative Ai.Textpart.Text (`docs/reference/server/generative-ai.textpart.text.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [TextPart](./generative-ai.textpart.md) &gt; [text](./generative-ai.textpart.text.md)

## TextPart.text property

**Signature:**

```typescript
text: string;
```

---

### Reference Server Generative Ai.Tool (`docs/reference/server/generative-ai.tool.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [Tool](./generative-ai.tool.md)

## Tool type

Defines a tool that model can call to access external knowledge.

**Signature:**

```typescript
export declare type Tool = FunctionDeclarationsTool | CodeExecutionTool | GoogleSearchRetrievalTool;
```
**References:** [FunctionDeclarationsTool](./generative-ai.functiondeclarationstool.md), [CodeExecutionTool](./generative-ai.codeexecutiontool.md)

---

### Reference Server Generative Ai.Toolconfig.Functioncallingconfig (`docs/reference/server/generative-ai.toolconfig.functioncallingconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ToolConfig](./generative-ai.toolconfig.md) &gt; [functionCallingConfig](./generative-ai.toolconfig.functioncallingconfig.md)

## ToolConfig.functionCallingConfig property

**Signature:**

```typescript
functionCallingConfig: FunctionCallingConfig;
```

---

### Reference Server Generative Ai.Toolconfig (`docs/reference/server/generative-ai.toolconfig.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [ToolConfig](./generative-ai.toolconfig.md)

## ToolConfig interface

Tool config. This config is shared for all tools provided in the request.

**Signature:**

```typescript
export interface ToolConfig 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [functionCallingConfig](./generative-ai.toolconfig.functioncallingconfig.md) |  | [FunctionCallingConfig](./generative-ai.functioncallingconfig.md) |  |

---

### Reference Server Generative Ai.Uploadfileresponse.File (`docs/reference/server/generative-ai.uploadfileresponse.file.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [UploadFileResponse](./generative-ai.uploadfileresponse.md) &gt; [file](./generative-ai.uploadfileresponse.file.md)

## UploadFileResponse.file property

**Signature:**

```typescript
file: FileMetadataResponse;
```

---

### Reference Server Generative Ai.Uploadfileresponse (`docs/reference/server/generative-ai.uploadfileresponse.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [UploadFileResponse](./generative-ai.uploadfileresponse.md)

## UploadFileResponse interface

Response from calling [GoogleAIFileManager.uploadFile()](./generative-ai.googleaifilemanager.uploadfile.md)

**Signature:**

```typescript
export interface UploadFileResponse 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [file](./generative-ai.uploadfileresponse.file.md) |  | [FileMetadataResponse](./generative-ai.filemetadataresponse.md) |  |

---

### Reference Server Generative Ai.Videometadata (`docs/reference/server/generative-ai.videometadata.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [VideoMetadata](./generative-ai.videometadata.md)

## VideoMetadata interface

Metadata populated when video has been processed.

**Signature:**

```typescript
export interface VideoMetadata 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [videoDuration](./generative-ai.videometadata.videoduration.md) |  | string | The video duration in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. |

---

### Reference Server Generative Ai.Videometadata.Videoduration (`docs/reference/server/generative-ai.videometadata.videoduration.md`)

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [VideoMetadata](./generative-ai.videometadata.md) &gt; [videoDuration](./generative-ai.videometadata.videoduration.md)

## VideoMetadata.videoDuration property

The video duration in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format.

**Signature:**

```typescript
videoDuration: string;
```

---

--- METRICS ---
- Files Extracted: 618
- Estimated Token Budget: ~106565 tokens
- Canonical Reference: https://codewiki.google/github.com/google-gemini/generative-ai-js
