Skip to content
Tracon

ILiveVoiceProvider

Namespace Tracon · Assembly Tracon.Abstractions.dll

Creates and supervises a provider-hosted live voice session.

public interface ILiveVoiceProvider

A live session is not the conversation layer behind UseVoiceConversation. There, Tracon receives the audio, transcribes it, runs the agent and synthesizes the answer. Here the provider hosts the whole conversation and carries the media directly to the media peer; Tracon stands in two places only: it creates the session, so tenancy, role and concurrency gates apply and the raw API key never reaches the browser, and it attaches a server-side control connection, so the work the model delegates becomes an ordinary Tracon run.

Lifetime: registered singleton. One instance serves every session in the process, so an implementation must be thread-safe and must hold no per-session state of its own — ILiveVoiceSideband is where a session’s state lives.

Tenant: tenant-independent, like ISpeechSynthesizer. The caller has already resolved and gated the tenant before a session is created; the provider neither reads nor enforces one, and must not key any cache or credential by tenant.

Delivery: best-effort. Creating a session and attaching to it are ordinary network calls with no retry and no idempotency key: a failure is surfaced to the caller, never retried silently, because a retried create is a second billed session.

Gets the largest number of characters a single ILiveVoiceSideband.AppendAsync may carry.

int MaxAppendCharacters { get; }

int

The ceiling is in characters, not tokens: Tracon ships no tokenizer and must not take one on (AOT, and no new package). An implementation whose provider states the limit in tokens converts it once, conservatively, and documents the ratio in a single place.

Gets the model identifier written to the session record.

string ModelId { get; }

string

Gets the provider name written to the session record, e.g. openai.

string ProviderName { get; }

string

Opens a server-side control connection to an existing session.

ValueTask<ILiveVoiceSideband> AttachAsync(string providerSessionId, CancellationToken cancellationToken = default)

providerSessionId string

The identifier returned by ILiveVoiceProvider.CreateSessionAsync.

cancellationToken CancellationToken

The cancellation token.

ValueTask<ILiveVoiceSideband>

The sideband connection.

The connection carries no primary audio: WebRTC or SIP carries that. Both connections share one session.

CreateSessionAsync(LiveVoiceCreateRequest, CancellationToken)

Section titled “ CreateSessionAsync(LiveVoiceCreateRequest, CancellationToken)”

Relays the media peer’s SDP offer and creates the session.

ValueTask<LiveVoiceSessionHandle> CreateSessionAsync(LiveVoiceCreateRequest request, CancellationToken cancellationToken = default)

request LiveVoiceCreateRequest

The offer and the session settings.

cancellationToken CancellationToken

The cancellation token.

ValueTask<LiveVoiceSessionHandle>

The provider’s session identifier and its SDP answer.