Skip to content
Tracon

VoiceBuilderExtensions

Namespace Tracon · Assembly Tracon.Voice.dll

Adds 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()

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)

builder ITraconBuilder

The Tracon chain.

configurationSection IConfiguration

The Tracon:Voice section.

configure Action<VoiceOptions>?

Changes to apply after configuration binding.

ITraconBuilder

The continuation of the chain.

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"));

ArgumentNullException

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)

builder ITraconBuilder

The Tracon chain.

configure Action<VoiceOptions>

The settings.

ITraconBuilder

The continuation of the chain.

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.

ArgumentNullException

When a dependency is null.