docs-devsite/ai.generationconfig.md
Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
Config options for content-related requests
<b>Signature:</b>
export interface GenerationConfig
| Property | Type | Description |
|---|---|---|
| candidateCount | number | |
| frequencyPenalty | number | |
| maxOutputTokens | number | |
| presencePenalty | number | |
| responseJsonSchema | { [key: string]: unknown; } | Output schema of the generated response. This is an alternative to <code>responseSchema</code> that accepts [JSON Schema](https://json-schema.org/).<!-- -->If set, <code>responseSchema</code> must be omitted, but <code>responseMimeType</code> is required and must be set to <code>application/json</code>. |
| responseMimeType | string | Output response MIME type of the generated candidate text. Supported MIME types are <code>text/plain</code> (default, text output), <code>application/json</code> (JSON response in the candidates), and <code>text/x.enum</code>. |
| responseModalities | ResponseModality<!-- -->[] | <b><i>(Public Preview)</i></b> Generation modalities to be returned in generation responses. |
| responseSchema | TypedSchema | SchemaRequest | Output response schema of the generated candidate text. This value can be a class generated with a Schema static method like <code>Schema.string()</code> or <code>Schema.object()</code> or it can be a plain JS object matching the SchemaRequest interface. |
| Note: This only applies when the specified <code>responseMimeType</code> supports a schema; currently this is limited to <code>application/json</code> and <code>text/x.enum</code>. | ||
| stopSequences | string[] | |
| temperature | number | |
| thinkingConfig | ThinkingConfig | Configuration for "thinking" behavior of compatible Gemini models. |
| topK | number | |
| topP | number |
<b>Signature:</b>
candidateCount?: number;
<b>Signature:</b>
frequencyPenalty?: number;
<b>Signature:</b>
maxOutputTokens?: number;
<b>Signature:</b>
presencePenalty?: number;
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<!-- -->.
<b>Signature:</b>
responseJsonSchema?: {
[key: string]: unknown;
};
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<!-- -->.
<b>Signature:</b>
responseMimeType?: string;
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.
ResponseModality.IMAGE<!-- -->) is supported.<b>Signature:</b>
responseModalities?: ResponseModality[];
Output response schema of the generated candidate text. This value can be a class generated with a Schema static method like Schema.string() or Schema.object() or it can be a plain JS object matching the SchemaRequest interface.
Note: This only applies when the specified responseMimeType supports a schema; currently this is limited to application/json and text/x.enum<!-- -->.
<b>Signature:</b>
responseSchema?: TypedSchema | SchemaRequest;
<b>Signature:</b>
stopSequences?: string[];
<b>Signature:</b>
temperature?: number;
Configuration for "thinking" behavior of compatible Gemini models.
<b>Signature:</b>
thinkingConfig?: ThinkingConfig;
<b>Signature:</b>
topK?: number;
<b>Signature:</b>
topP?: number;