Skip to content

TranslationStreamCall

Namespace: Vercel.AI.Operations

public sealed class TranslationStreamCall

Arguments for a speech-translation stream.

Inheritance: object

View source

TranslationStreamCall(AudioChunkStream, string, string, string?, string?, JsonElement, IReadOnlyDictionary<string, string>, bool?, CancellationToken)

Section titled “TranslationStreamCall(AudioChunkStream, string, string, string?, string?, JsonElement, IReadOnlyDictionary<string, string>, bool?, CancellationToken)”
public TranslationStreamCall(AudioChunkStream audio, string inputAudioFormat, string targetLanguage, string? sourceLanguage, string? outputAudioFormat, JsonElement providerOptions, IReadOnlyDictionary<string, string> headers, bool? includeRawChunks, CancellationToken cancellationToken)

Creates a translation call.

Parameters

Name Type Description
audio AudioChunkStream
inputAudioFormat string
targetLanguage string
sourceLanguage string
outputAudioFormat string
providerOptions JsonElement
headers IReadOnlyDictionary<string, string>
includeRawChunks bool?
cancellationToken CancellationToken

View source

public AudioChunkStream Audio { get; }

Audio stream.

Value: AudioChunkStream

View source

public CancellationToken CancellationToken { get; }

Cancellation token shared with fullStream cancellation.

Value: CancellationToken

View source

public IReadOnlyDictionary<string, string> Headers { get; }

Headers including the user-agent suffix.

Value: IReadOnlyDictionary<string, string>

View source

public bool? IncludeRawChunks { get; }

When true, raw parts are requested.

Value: bool?

View source

public string InputAudioFormat { get; }

Input audio format.

Value: string

View source

public string? OutputAudioFormat { get; }

Requested output audio format.

Value: string

View source

public JsonElement ProviderOptions { get; }

Provider options.

Value: JsonElement

View source

public string? SourceLanguage { get; }

Source language. Null asks the provider to detect it.

Value: string

View source

public string TargetLanguage { get; }

Target language.

Value: string

View source

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