GoogleSpeechModel
Namespace: Vercel.AI.Google
public sealed class GoogleSpeechModel : ISpeechModelGemini text-to-speech. Posts to generateContent with an audio response modality.
Inheritance: object
Implements: ISpeechModel
Constructors
Section titled “Constructors”GoogleSpeechModel(GoogleProvider, string)
Section titled “GoogleSpeechModel(GoogleProvider, string)”public GoogleSpeechModel(GoogleProvider provider, string modelId)Creates a speech model.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
GoogleProvider | |
modelId |
string |
Properties
Section titled “Properties”ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id.
Value: string
Warnings
Section titled “Warnings”public IReadOnlyList<GoogleWarning> Warnings { get; }Warnings from the last call.
Value: IReadOnlyList<GoogleWarning>
Methods
Section titled “Methods”DoGenerateAsync(SpeechCallOptions, CancellationToken)
Section titled “DoGenerateAsync(SpeechCallOptions, CancellationToken)”public Task<SpeechResult> DoGenerateAsync(SpeechCallOptions options, CancellationToken cancellationToken)Synthesizes speech.
Parameters
| Name | Type | Description |
|---|---|---|
options |
SpeechCallOptions | |
cancellationToken |
CancellationToken |
Returns: Task<SpeechResult>
GenerateAsync(GoogleSpeechCall, CancellationToken)
Section titled “GenerateAsync(GoogleSpeechCall, CancellationToken)”public Task<SpeechResult> GenerateAsync(GoogleSpeechCall call, CancellationToken cancellationToken)Synthesizes speech with Gemini-specific options.
Parameters
| Name | Type | Description |
|---|---|---|
call |
GoogleSpeechCall | |
cancellationToken |
CancellationToken |
Returns: Task<SpeechResult>
Prepare(string, string, GoogleSpeechCall)
Section titled “Prepare(string, string, GoogleSpeechCall)”public static GoogleSpeechPreparation Prepare(string modelId, string provider, GoogleSpeechCall call)Builds the speech request body and warnings.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string | |
provider |
string | |
call |
GoogleSpeechCall |
Returns: GoogleSpeechPreparation
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product