Skip to content

GoogleVertexSpeechTranscriptionModel

Namespace: Vercel.AI.Google

public sealed class GoogleVertexSpeechTranscriptionModel : ITranscriptionModel

Cloud Speech-to-Text recognize.

Inheritance: object

Implements: ITranscriptionModel

View source

GoogleVertexSpeechTranscriptionModel(GoogleVertexProvider, string)

Section titled “GoogleVertexSpeechTranscriptionModel(GoogleVertexProvider, string)”
public GoogleVertexSpeechTranscriptionModel(GoogleVertexProvider provider, string modelId)

Creates a transcription model.

Parameters

Name Type Description
provider GoogleVertexProvider
modelId string

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id.

Value: string

View source

DoTranscribeAsync(AudioInput, CancellationToken)

Section titled “DoTranscribeAsync(AudioInput, CancellationToken)”
public Task<TranscriptionResult> DoTranscribeAsync(AudioInput audio, CancellationToken cancellationToken)

Transcribes audio.

Parameters

Name Type Description
audio AudioInput
cancellationToken CancellationToken

Returns: Task<TranscriptionResult>

View source

public static double? ParseDuration(string? value)

Parses a duration such as 1.200s.

Parameters

Name Type Description
value string

Returns: double?

View source

public static JsonObject Request(string modelId, byte[] audio, string[]? languageCodes)

Builds the recognize body. Audio bytes are base64-encoded.

Parameters

Name Type Description
modelId string
audio byte[]
languageCodes string[]

Returns: JsonObject

View source

public static string? ToIso6391(string? tag)

Maps a BCP-47 tag onto a two-letter ISO-639-1 code.

Parameters

Name Type Description
tag string

Returns: string

View source

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