Skip to content

GoogleSpeechModel

Namespace: Vercel.AI.Google

public sealed class GoogleSpeechModel : ISpeechModel

Gemini text-to-speech. Posts to generateContent with an audio response modality.

Inheritance: object

Implements: ISpeechModel

View source

public GoogleSpeechModel(GoogleProvider provider, string modelId)

Creates a speech model.

Parameters

Name Type Description
provider GoogleProvider
modelId string

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id.

Value: string

View source

public IReadOnlyList<GoogleWarning> Warnings { get; }

Warnings from the last call.

Value: IReadOnlyList<GoogleWarning>

View source

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>

View source

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>

View source

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

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product