Skip to content

VoiceBuilderExtensions

Namespace AgentPrism · Assembly AgentPrism.Voice.dll

Adds the voice tools to the AgentPrism 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(IAgentPrismBuilder, IConfiguration, Action<VoiceOptions>?)

Section titled “ UseVoice(IAgentPrismBuilder, IConfiguration, Action<VoiceOptions>?)”

Registers the voice tools, reading settings from configuration.

public static IAgentPrismBuilder UseVoice(this IAgentPrismBuilder builder, IConfiguration configurationSection, Action<VoiceOptions>? configure = null)

builder IAgentPrismBuilder

The AgentPrism chain.

configurationSection IConfiguration

The AgentPrism:Voice section.

configure Action<VoiceOptions>?

Changes to apply after configuration binding.

IAgentPrismBuilder

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.AddAgentPrism()
.UseVoice(builder.Configuration.GetSection("AgentPrism:Voice"));

ArgumentNullException

When a dependency is null.

UseVoice(IAgentPrismBuilder, Action<VoiceOptions>)

Section titled “ UseVoice(IAgentPrismBuilder, Action<VoiceOptions>)”

Registers the voice tools.

public static IAgentPrismBuilder UseVoice(this IAgentPrismBuilder builder, Action<VoiceOptions> configure)

builder IAgentPrismBuilder

The AgentPrism chain.

configure Action<VoiceOptions>

The settings.

IAgentPrismBuilder

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.