chilly-crowd-70471
03/27/2025, 7:23 AMsend
method from useChat
. On the server side, I added a listener like this:
async def async_handle_text_stream(reader, participant_identity):
info = <http://reader.info|reader.info>
<http://logger.info|logger.info>(
f'Text stream received from {participant_identity}\n'
f' Topic: {info.topic}\n'
f' Timestamp: {info.timestamp}\n'
f' ID: {info.stream_id}'
)
text = await reader.read_all()
<http://logger.info|logger.info>(f"Received text: {text}")
def handle_text_stream(reader, participant_identity):
task = asyncio.create_task(async_handle_text_stream(reader, participant_identity))
_active_tasks.add(task)
task.add_done_callback(lambda t: _active_tasks.remove(t))
def run_multimodal_agent(ctx: JobContext, participant: rtc.RemoteParticipant):
<http://logger.info|logger.info>("starting multimodal agent")
ctx.room.register_text_stream_handler("chat-bubbles", handle_text_stream)
I don't seem to receive any messages on the server. I can't find anything in the documentation clearly stating anything else to do. Am I found anything wrong? I thought maybe I was listening to the wrong topic, but I can't specify a topic in the send method from useChat
.tall-airline-16756
03/27/2025, 7:23 AMtall-airline-16756
03/27/2025, 7:23 AMchilly-crowd-70471
03/27/2025, 7:23 AM