Class TranscriptionRequest
Task for converting speech audio into text (speech-to-text).
public class TranscriptionRequest : TranscriptionRequestBase<TranscriptionRequest, Transcript, ITranscriptionEvent>, IGenerativeRequest, ISequentialRequest
- Inheritance
-
objectTranscriptionRequest
- Implements
- Inherited Members
- Extension Methods
Constructors
TranscriptionRequest(Prompt<AudioClip>)
public TranscriptionRequest(Prompt<AudioClip> prompt)
Parameters
promptPrompt<AudioClip>
Properties
MicrosoftTranscriptionApiType
public MicrosoftTypes.TranscriptionApi? MicrosoftTranscriptionApiType { get; set; }
Property Value
SpokenLanguage
public SystemLanguage SpokenLanguage { get; set; }
Property Value
- SystemLanguage
SpokenLanguages
public List<SystemLanguage> SpokenLanguages { get; set; }
Property Value
- List<SystemLanguage>
Temperature
public Temperature Temperature { get; set; }
Property Value
TimestampGranularities
The timestamp granularities to populate for this transcription. response_format must be set verbose_json to use timestamp granularities. Either or both of these options are supported: word, or segment.
public string[] TimestampGranularities { get; set; }
Property Value
- string[]
Remarks
Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
Type
public override FluentApiRequestType Type { get; }
Property Value
Methods
CreateStreamAsyncInternal()
protected override UniTask<IRESTStream<ITranscriptionEvent>> CreateStreamAsyncInternal()
Returns
- UniTask<IRESTStream<ITranscriptionEvent>>
ExecuteAsyncInternal()
Sets the temperature for transcription. Higher values (e.g., 0.7) make the output more random, while lower values (e.g., 0.2) make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
protected override UniTask<Transcript> ExecuteAsyncInternal()
Returns
- UniTask<Transcript>
SetMicrosoftTranscriptionApi(TranscriptionApi)
public TranscriptionRequest SetMicrosoftTranscriptionApi(MicrosoftTypes.TranscriptionApi apiType)
Parameters
apiTypeMicrosoftTypes.TranscriptionApi
Returns
SetSpokenLanguage(SystemLanguage)
Optionally sets the language hint to improve transcription accuracy.
public TranscriptionRequest SetSpokenLanguage(SystemLanguage language)
Parameters
languageSystemLanguage
Returns
SetSpokenLanguages(params SystemLanguage[])
public TranscriptionRequest SetSpokenLanguages(params SystemLanguage[] languages)
Parameters
languagesSystemLanguage[]
Returns
SetTimestampGranularities(params string[])
public TranscriptionRequest SetTimestampGranularities(params string[] granularities)
Parameters
granularitiesstring[]