Skip to content

OpenAISpeechTranslationModel

Namespace: Vercel.AI.OpenAI

public sealed class OpenAISpeechTranslationModel : ISpeechTranslationModel

OpenAI speech translation model. REST calls use /audio/translations.

Inheritance: object

Implements: ISpeechTranslationModel

View source

OpenAISpeechTranslationModel(OpenAIProvider, string)

Section titled “OpenAISpeechTranslationModel(OpenAIProvider, string)”
public OpenAISpeechTranslationModel(OpenAIProvider provider, string modelId)

Creates a speech translation model.

Parameters

Name Type Description
provider OpenAIProvider
modelId string

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id.

Value: string

View source

DoTranslateAsync(AudioInput, CancellationToken)

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

Translates speech into text.

Parameters

Name Type Description
audio AudioInput
cancellationToken CancellationToken

Returns: Task<TranscriptionResult>

View source

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