.NET API
VoiceBuilderExtensions
Tracon.Voice.dllAdds the voice tools to the Tracon chain.
public static class VoiceBuilderExtensions- Inheritance
- object ← VoiceBuilderExtensions
- Inherited Members
- object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Methods
Section titled “Methods”UseVoice(ITraconBuilder, IConfiguration, Action<VoiceOptions>?)
Section titled “ UseVoice(ITraconBuilder, IConfiguration, Action<VoiceOptions>?)”Registers the voice tools, reading settings from configuration.
public static ITraconBuilder UseVoice(this ITraconBuilder builder, IConfiguration configurationSection, Action<VoiceOptions>? configure = null)Parameters
Section titled “Parameters”builder ITraconBuilder
The Tracon chain.
configurationSection IConfiguration
The Tracon:Voice section.
configure Action<VoiceOptions>?
Changes to apply after configuration binding.
Returns
Section titled “Returns”The continuation of the chain.
Remarks
Section titled “Remarks”Registers the speech tools an agent can call. The real-time
conversation layer is a separate, opt-in call
(UseVoiceConversation).
builder.AddTracon() .UseVoice(builder.Configuration.GetSection("Tracon:Voice"));Exceptions
Section titled “Exceptions”When a dependency is null.
UseVoice(ITraconBuilder, Action<VoiceOptions>)
Section titled “ UseVoice(ITraconBuilder, Action<VoiceOptions>)”Registers the voice tools.
public static ITraconBuilder UseVoice(this ITraconBuilder builder, Action<VoiceOptions> configure)Parameters
Section titled “Parameters”builder ITraconBuilder
The Tracon chain.
configure Action<VoiceOptions>
The settings.
Returns
Section titled “Returns”The continuation of the chain.
Remarks
Section titled “Remarks”Registration uses TryAdd*: when the consumer registered its own
ISpeechSynthesizer or ISpeechTranscriber
implementation BEFORE this call, theirs is preserved. When both are the
consumer’s, the ElevenLabs settings (provider name, API key, address) are
not required.
The settings are validated when the application starts; an invalid value stops the host before the first request.
Three tools are registered: speak, transcribe, list_voices.
tools are defined IN CODE; the UI only selects them.
The built-in client also voices a dialogue (several speakers in one request). No ISpeechDialogueSynthesizer is registered: code takes the capability from ISpeechProviderResolver.GetDialogueSynthesizerAsync, which reads it from the bound synthesizer and applies the tenant’s checks. A synthesizer of your own that implements the interface is used instead; one that does not is reported, not replaced by the built-in client.
Exceptions
Section titled “Exceptions”When a dependency is null.