* feat(ai): implementmulti-speaker speech config; includes tests * add changeset, fix typo * fix: yarn format * fix changeset * fix changeset typo * remove unnecessary tests; fix interface description to match proposal * Generate documentation * fix: yarn format & lint fix * add more descriptive changeset * Adds tests for speech config to check if its correctly passed through to the API requests for both generateContent and generateContentStream methods * yarn format * yarn format * Refine changeset file description * Fix typo * format fix * update description BaseSpeechConfig * update descriptions * format doc * yarn format * fix @ typo over MultiSpeakerSpeechConfig * fix: adjusted description wording for the interfaces; fix: public tags to beta * fix: formatting using @remarks * fix: typo * yarn format * run yarn docgen:all * update SpeechConfig to beta * update speech config to beta * upd SingleSpeakerSpeechConfig description * doc generation
6.7 KiB
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 %}
GenerationConfig interface
Config options for content-related requests
Signature:
export interface GenerationConfig
Properties
| Property | Type | Description |
|---|---|---|
| candidateCount | number | |
| frequencyPenalty | number | |
| imageConfig | ImageConfig | Configuration options for generating images with Gemini models. |
| maxOutputTokens | number | |
| presencePenalty | number | |
| responseJsonSchema | { [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 | 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 | ResponseModality[] | (Public Preview) 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 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. |
| speechConfig | SpeechConfig | (Public Preview) Configuration for speech synthesis for text-to-speech (TTS) models. |
| stopSequences | string[] | |
| temperature | number | |
| thinkingConfig | ThinkingConfig | Configuration for "thinking" behavior of compatible Gemini models. |
| topK | number | |
| topP | number |
GenerationConfig.candidateCount
Signature:
candidateCount?: number;
GenerationConfig.frequencyPenalty
Signature:
frequencyPenalty?: number;
GenerationConfig.imageConfig
Configuration options for generating images with Gemini models.
Signature:
imageConfig?: ImageConfig;
GenerationConfig.maxOutputTokens
Signature:
maxOutputTokens?: number;
GenerationConfig.presencePenalty
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. - 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 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.
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
Signature:
temperature?: number;
GenerationConfig.thinkingConfig
Configuration for "thinking" behavior of compatible Gemini models.
Signature:
thinkingConfig?: ThinkingConfig;
GenerationConfig.topK
Signature:
topK?: number;
GenerationConfig.topP
Signature:
topP?: number;