Skip to content

Commit

Permalink
add support for stream-message
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasliu-agora committed Oct 29, 2024
1 parent 905dc28 commit 01fa8d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions realtime_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ def log_exception(t: asyncio.Task[Any]) -> None:
exc_info=t.exception(),
)

def on_stream_message(agora_local_user, user_id, stream_id, data, length) -> None:
logger.info(f"Received stream message with length: {length}")

self.channel.on("stream_message", on_stream_message)

logger.info("Waiting for remote user to join")
self.subscribe_user = await wait_for_remote_user(self.channel)
logger.info(f"Subscribing to user {self.subscribe_user}")
Expand Down

0 comments on commit 01fa8d7

Please sign in to comment.