Skip to content
Tracon

VoiceBuilderExtensions

Namespace Tracon · Assembly Tracon.Voice.dll

Adds the voice tools to the Tracon chain.

public static class VoiceBuilderExtensions

objectVoiceBuilderExtensions

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.

Three tools are registered: speak, transcribe, list_voices. tools are defined IN CODE; the UI only selects them.

ArgumentNullException

When a dependency is null.