Overview
EdgeTransport is the core abstraction for connecting agents to real-time communication sessions. It provides a vendor-agnostic interface for WebRTC-based calls, allowing you to integrate with different providers (like GetStream) while maintaining consistent agent behavior.
Implementation
EdgeTransport is an abstract base class. Vision Agents provides theStreamEdge implementation for GetStream.io:
Properties
Event manager for subscribing to transport events. All EdgeTransport implementations automatically register these required events:
AudioReceivedEvent: Audio data received from participantsTrackAddedEvent: Media track added to the callTrackRemovedEvent: Media track removed from the callCallEndedEvent: Call session ended
Methods
authenticate()
Authenticate an agent user with the transport.User object containing:
id: Unique identifier for the agentname: Display name for the agentimage: Optional avatar URL
create_call()
Create a new call or retrieve an existing one.Unique identifier for the call session
Transport-specific configuration options. For
StreamEdge:call_type(str): GetStream call type (default: “default”)
join()
Join a call and establish a connection.The Agent instance joining the call
Call object from
create_call()Transport-specific join options
create_audio_track()
Create an audio stream track for sending audio to the call.AudioStreamTrack for streaming PCM audio data
publish_tracks()
Publish audio and/or video tracks to the active call.Audio track to publish (from
create_audio_track())Video track to publish (optional)
send_custom_event()
Send a custom event to all participants in the call.JSON-serializable event payload (max 5KB for GetStream)
close()
Close the transport and clean up all resources.Event Subscription
Subscribe to transport events using theevents manager:
StreamEdge Implementation
TheStreamEdge class implements EdgeTransport using GetStream.io’s infrastructure:
StreamEdge-Specific Methods
Open a browser demo interface for testing:
Create a chat conversation channel linked to the call:
See Also
- Connection - Managing active call sessions
- Call - Call protocol interface
- TrackType - Media track types