Skip to content

VoiceConversationProtocol

Namespace AgentPrism · Assembly AgentPrism.Core.dll

The frame names and the audio formats of the conversation WebSocket.

public static class VoiceConversationProtocol

objectVoiceConversationProtocol

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The names stay aligned with the existing SSE contract; the user interface does not carry two different mental models. These are a stable contract: to change them breaks clients.

Text frames are JSON and binary frames are raw audio. The direction follows from the name of the frame, not from its type.

Interruption (barge-in): stop the generation.

public const string ClientCancel = "cancel"

string

Speech ended; answer now.

public const string ClientCommit = "commit"

string

Starts the conversation.

public const string ClientStart = "start"

string

Closes the connection.

public const string ClientStop = "stop"

string

The audio chunks ended.

public const string ServerAudioEnd = "audioEnd"

string

The binary frames that follow are audio chunks.

public const string ServerAudioStart = "audioStart"

string

The turn ended.

public const string ServerDone = "done"

string

An error.

public const string ServerError = "error"

string

The server is ready for the conversation.

public const string ServerReady = "ready"

string

The run started; the frame carries its identifier.

public const string ServerRunStarted = "runStarted"

string

A text response (caption).

public const string ServerText = "text"

string

The transcribed speech text.

public const string ServerTranscript = "transcript"

string

The name of the WebSocket sub-protocol. The handshake echoes it back.

public const string SubProtocol = "agentprism.voice.v1"

string

The sub-protocol prefix that carries the bearer token.

public const string TokenSubProtocolPrefix = "agentprism.token."

string

The token is not put in the query string: the address is written to server logs, to reverse proxy logs and to the browser history. A browser cannot add a custom header to a WebSocket handshake; the standard way out is the Sec-WebSocket-Protocol header.