.NET API
OpenAISpeechOptions
Tracon.OpenAI.dllSettings of OpenAISpeechBuilderExtensions.UseOpenAISpeech.
public sealed class OpenAISpeechOptions- Inheritance
- object ← OpenAISpeechOptions
- Inherited Members
- object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”At least one of OpenAISpeechOptions.SynthesisModel and OpenAISpeechOptions.TranscriptionModel must be set.
Constructors
Section titled “Constructors”OpenAISpeechOptions()
Section titled “ OpenAISpeechOptions()”public OpenAISpeechOptions()Properties
Section titled “Properties”MaxCharactersPerRequest
Section titled “ MaxCharactersPerRequest”Gets or sets the most characters one synthesis call accepts. Default 4096, the limit
the OpenAI documentation states for the speech endpoint.
public int MaxCharactersPerRequest { get; set; }Property Value
Section titled “Property Value”SynthesisModel
Section titled “ SynthesisModel”Gets or sets the text-to-speech model, for example gpt-4o-mini-tts. A synthesizer is
registered when this is set.
public string? SynthesisModel { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The registration is bound to this model. A request that names another model is refused: the OpenAI audio client ignores a per-request model. To use a second model, register a second name with another call.
SynthesizerName
Section titled “ SynthesizerName”Gets or sets the registration name of the synthesizer. A caller selects it with
"provider": "openai" on POST /api/voice/speak. Default openai.
public string SynthesizerName { get; set; }Property Value
Section titled “Property Value”TranscriberName
Section titled “ TranscriberName”Gets or sets the registration name of the transcriber. Transcriber names are separate from
synthesizer names. Default openai.
public string TranscriberName { get; set; }Property Value
Section titled “Property Value”TranscriptionModel
Section titled “ TranscriptionModel”Gets or sets the speech-to-text model, for example gpt-4o-mini-transcribe. A transcriber is
registered when this is set.
public string? TranscriptionModel { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The same rule as OpenAISpeechOptions.SynthesisModel: the registration is bound to this model.
UseAsDefault
Section titled “ UseAsDefault”Gets or sets whether the registered synthesizer and transcriber are also the unnamed default ones. Default false.
public bool UseAsDefault { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The unnamed default serves the speak and transcribe tools and the live
conversation. It is registered with TryAdd: a default that is already there stays,
so call UseOpenAISpeech before UseVoice to make OpenAI the default.
The speak and transcribe tools send Tracon:Voice:SynthesisModelId and
TranscriptionModelId to the default engine, and a registration is bound to one model.
Leave both empty, or set them to the OpenAI models named here, or the tool call fails with a
message that names both models.
Voices
Section titled “ Voices”Gets the voices GET /api/voice/voices lists for the synthesizer. Empty by default.
public IList<VoiceDescriptor> Voices { get; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”A static declaration: the speech endpoint has no voice list. The service refuses a request
without a voice, so a call that names none is spoken in alloy.