diff --git a/fishjam/agent/agent.py b/fishjam/agent/agent.py index f752568..80031e1 100644 --- a/fishjam/agent/agent.py +++ b/fishjam/agent/agent.py @@ -151,6 +151,13 @@ async def add_track(self, options: OutgoingAudioTrackOptions): async def _send(self, message: AgentRequest): await self._ws.send(bytes(message), text=False) + async def disconnect(self): + """ + Ends the agent session by closing the websocket connection. + Useful when you don't use the context manager to obtain the session. + """ + await self._ws.close() + class Agent: """