VoiceConversationBuilderExtensions
AgentPrism.Core.dllExtensions that enable the real-time voice conversation layer.
public static class VoiceConversationBuilderExtensionsInheritance
Section titled “Inheritance”object ← VoiceConversationBuilderExtensions
Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”This call changes the hosting model. A voice connection stays open for minutes and binds to one server instance; a multi-instance deployment requires sticky sessions, and the reverse proxy must allow WebSocket passthrough. For this reason the feature is opt-in: if the call is not made, no WebSocket endpoint is opened and behavior does not change.
The layer is provider-agnostic: it uses only the
ISpeechTranscriber and ISpeechSynthesizer
abstractions. This call does not register them — a voice
provider must be enabled separately (e.g. UseVoice(...)).
Methods
Section titled “Methods”UseVoiceConversation(IAgentPrismBuilder, IConfiguration)
Section titled “ UseVoiceConversation(IAgentPrismBuilder, IConfiguration)”Enables the conversation layer, reading its settings from configuration.
public static IAgentPrismBuilder UseVoiceConversation(this IAgentPrismBuilder builder, IConfiguration configurationSection)Parameters
Section titled “Parameters”builder IAgentPrismBuilder
The AgentPrism chain.
configurationSection IConfiguration
The AgentPrism:Voice:Conversation section.
Returns
Section titled “Returns”The continuation of the chain.
Remarks
Section titled “Remarks”A speech provider is registered separately; this call only opens the conversation layer over it.
builder.AddAgentPrism() .UseVoice(builder.Configuration.GetSection("AgentPrism:Voice")) .UseVoiceConversation(builder.Configuration.GetSection("AgentPrism:Voice:Conversation"));Exceptions
Section titled “Exceptions”One of the dependencies is null.
UseVoiceConversation(IAgentPrismBuilder)
Section titled “ UseVoiceConversation(IAgentPrismBuilder)”Enables the conversation layer with default settings.
public static IAgentPrismBuilder UseVoiceConversation(this IAgentPrismBuilder builder)Parameters
Section titled “Parameters”builder IAgentPrismBuilder
The AgentPrism chain.
Returns
Section titled “Returns”The continuation of the chain.
Remarks
Section titled “Remarks”Registrations are made with TryAdd*: if the consumer registered
its own IVoiceSessionStore implementation before this
call, theirs is preserved.
The transcription and synthesis providers are resolved optionally with ``ServiceProviderServiceExtensions.GetService```. Requesting a nullable dependency through constructor injection is not enough: the built-in DI container can treat an unregistered type as required even when a C# default value exists. This is why a factory is used.
Exceptions
Section titled “Exceptions”builder is null.
UseVoiceConversation(IAgentPrismBuilder, Action<VoiceConversationOptions>)
Section titled “ UseVoiceConversation(IAgentPrismBuilder, Action<VoiceConversationOptions>)”Enables the conversation layer with settings given in code.
public static IAgentPrismBuilder UseVoiceConversation(this IAgentPrismBuilder builder, Action<VoiceConversationOptions> configure)Parameters
Section titled “Parameters”builder IAgentPrismBuilder
The AgentPrism chain.
configure Action<VoiceConversationOptions>
The settings.
Returns
Section titled “Returns”The continuation of the chain.
Exceptions
Section titled “Exceptions”One of the parameters is null.