WebrtcConnection

class pipecat.transports.network.webrtc_connection.TrackStatusMessage(*, type, receiver_index, enabled)[source]

Bases: BaseModel

Parameters:
  • type (Literal['trackStatus'])

  • receiver_index (int)

  • enabled (bool)

type: Literal['trackStatus']
receiver_index: int
enabled: bool
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pipecat.transports.network.webrtc_connection.RenegotiateMessage(*, type='renegotiate')[source]

Bases: BaseModel

Parameters:

type (Literal['renegotiate'])

type: Literal['renegotiate']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pipecat.transports.network.webrtc_connection.PeerLeftMessage(*, type='peerLeft')[source]

Bases: BaseModel

Parameters:

type (Literal['peerLeft'])

type: Literal['peerLeft']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pipecat.transports.network.webrtc_connection.SignallingMessage[source]

Bases: object

Inbound

alias of TrackStatusMessage

outbound

alias of RenegotiateMessage

class pipecat.transports.network.webrtc_connection.SmallWebRTCTrack(track)[source]

Bases: object

Parameters:

track (aiortc.MediaStreamTrack)

set_enabled(enabled)[source]
Parameters:

enabled (bool)

Return type:

None

is_enabled()[source]
Return type:

bool

async discard_old_frames()[source]
async recv()[source]
Return type:

av.frame.Frame | None

class pipecat.transports.network.webrtc_connection.SmallWebRTCConnection(ice_servers=None)[source]

Bases: BaseObject

Parameters:

ice_servers (List[str] | List[aiortc.RTCIceServer] | None)

property pc: aiortc.RTCPeerConnection
property pc_id: str
async initialize(sdp, type)[source]
Parameters:
  • sdp (str)

  • type (str)

async connect()[source]
async renegotiate(sdp, type, restart_pc=False)[source]
Parameters:
  • sdp (str)

  • type (str)

  • restart_pc (bool)

force_transceivers_to_send_recv()[source]
replace_audio_track(track)[source]
replace_video_track(track)[source]
async disconnect()[source]
get_answer()[source]
is_connected()[source]
audio_input_track()[source]
video_input_track()[source]
send_app_message(message)[source]
Parameters:

message (Any)

ask_to_renegotiate()[source]