Config options for content-related requests

**Signature:**

    export interface GenerationConfig 

## Properties

| Property | Type | Description |
|---|---|---|
| [candidateCount](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigcandidatecount) | number |   |
| [frequencyPenalty](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigfrequencypenalty) | number |   |
| [imageConfig](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigimageconfig) | [ImageConfig](https://firebase.google.com/docs/reference/js/ai.imageconfig#imageconfig_interface) | Configuration options for generating images with Gemini models. |
| [maxOutputTokens](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigmaxoutputtokens) | number |   |
| [presencePenalty](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigpresencepenalty) | number |   |
| [responseJsonSchema](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigresponsejsonschema) | { \[key: string\]: unknown; } | Output schema of the generated response. This is an alternative to `responseSchema` that accepts \[JSON Schema\](https://json-schema.org/).If set, `responseSchema` must be omitted, but `responseMimeType` is required and must be set to `application/json`. |
| [responseMimeType](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigresponsemimetype) | string | Output response MIME type of the generated candidate text. Supported MIME types are `text/plain` (default, text output), `application/json` (JSON response in the candidates), and `text/x.enum`. |
| [responseModalities](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigresponsemodalities) | [ResponseModality](https://firebase.google.com/docs/reference/js/ai#responsemodality)\[\] | ***(Public Preview)*** Generation modalities to be returned in generation responses. |
| [responseSchema](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigresponseschema) | [TypedSchema](https://firebase.google.com/docs/reference/js/ai#typedschema) \| [SchemaRequest](https://firebase.google.com/docs/reference/js/ai.schemarequest#schemarequest_interface) | Output response schema of the generated candidate text. This value can be a class generated with a [Schema](https://firebase.google.com/docs/reference/js/ai.schema#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](https://firebase.google.com/docs/reference/js/ai.schemarequest#schemarequest_interface) interface. Note: This only applies when the specified `responseMimeType` supports a schema; currently this is limited to `application/json` and `text/x.enum`. |
| [speechConfig](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigspeechconfig) | [SpeechConfig](https://firebase.google.com/docs/reference/js/ai#speechconfig) | ***(Public Preview)*** Configuration for speech synthesis for text-to-speech (TTS) models. |
| [stopSequences](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigstopsequences) | string\[\] |   |
| [temperature](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigtemperature) | number |   |
| [thinkingConfig](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigthinkingconfig) | [ThinkingConfig](https://firebase.google.com/docs/reference/js/ai.thinkingconfig#thinkingconfig_interface) | Configuration for "thinking" behavior of compatible Gemini models. |
| [topK](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigtopk) | number |   |
| [topP](https://firebase.google.com/docs/reference/js/ai.generationconfig#generationconfigtopp) | number |   |

## GenerationConfig.candidateCount

> > [!WARNING]
> > **Warning:** This API is now obsolete.
>
> Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Make parallel requests instead.

**Signature:**

    candidateCount?: number;

## GenerationConfig.frequencyPenalty

> > [!WARNING]
> > **Warning:** This API is now obsolete.
>
> Not supported in Gemini 3.x and later models. Requests that include this parameter will fail with a 400 error. Omit this parameter.

**Signature:**

    frequencyPenalty?: number;

## GenerationConfig.imageConfig

Configuration options for generating images with Gemini models.

**Signature:**

    imageConfig?: ImageConfig;

## GenerationConfig.maxOutputTokens

**Signature:**

    maxOutputTokens?: number;

## GenerationConfig.presencePenalty

> > [!WARNING]
> > **Warning:** This API is now obsolete.
>
> Not supported in Gemini 3.x and later models. Requests that include this parameter will fail with a 400 error. Omit this parameter.

**Signature:**

    presencePenalty?: number;

## GenerationConfig.responseJsonSchema

Output schema of the generated response. This is an alternative to `responseSchema` that accepts \[JSON Schema\](https://json-schema.org/).

If set, `responseSchema` must be omitted, but `responseMimeType` is required and must be set to `application/json`.

**Signature:**

    responseJsonSchema?: {
            [key: string]: unknown;
        };

## GenerationConfig.responseMimeType

Output response MIME type of the generated candidate text. Supported MIME types are `text/plain` (default, text output), `application/json` (JSON response in the candidates), and `text/x.enum`.

**Signature:**

    responseMimeType?: string;

## GenerationConfig.responseModalities

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Generation modalities to be returned in generation responses.

- Multimodal response generation is only supported by some Gemini models and versions; see [model versions](https://firebase.google.com/docs/ai-logic/models). - Only image generation (`ResponseModality.IMAGE`) is supported.

**Signature:**

    responseModalities?: ResponseModality[];

## GenerationConfig.responseSchema

Output response schema of the generated candidate text. This value can be a class generated with a [Schema](https://firebase.google.com/docs/reference/js/ai.schema#schema_class) static method like `Schema.string()` or `Schema.object()` or it can be a plain JS object matching the [SchemaRequest](https://firebase.google.com/docs/reference/js/ai.schemarequest#schemarequest_interface) interface.   
Note: This only applies when the specified `responseMimeType` supports a schema; currently this is limited to `application/json` and `text/x.enum`.

**Signature:**

    responseSchema?: TypedSchema | SchemaRequest;

## GenerationConfig.speechConfig

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Configuration for speech synthesis for text-to-speech (TTS) models.

**Signature:**

    speechConfig?: SpeechConfig;

## GenerationConfig.stopSequences

**Signature:**

    stopSequences?: string[];

## GenerationConfig.temperature

> > [!WARNING]
> > **Warning:** This API is now obsolete.
>
> Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically.

**Signature:**

    temperature?: number;

## GenerationConfig.thinkingConfig

Configuration for "thinking" behavior of compatible Gemini models.

**Signature:**

    thinkingConfig?: ThinkingConfig;

## GenerationConfig.topK

> > [!WARNING]
> > **Warning:** This API is now obsolete.
>
> Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically.

**Signature:**

    topK?: number;

## GenerationConfig.topP

> > [!WARNING]
> > **Warning:** This API is now obsolete.
>
> Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically.

**Signature:**

    topP?: number;