Skip to content

Commit 01fa8d7

Browse files
add support for stream-message
1 parent 905dc28 commit 01fa8d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

realtime_agent/agent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ def log_exception(t: asyncio.Task[Any]) -> None:
149149
exc_info=t.exception(),
150150
)
151151

152+
def on_stream_message(agora_local_user, user_id, stream_id, data, length) -> None:
153+
logger.info(f"Received stream message with length: {length}")
154+
155+
self.channel.on("stream_message", on_stream_message)
156+
152157
logger.info("Waiting for remote user to join")
153158
self.subscribe_user = await wait_for_remote_user(self.channel)
154159
logger.info(f"Subscribing to user {self.subscribe_user}")

0 commit comments

Comments
 (0)