Hi there - how can I send text to my participants?...
# agents
a
Hi there - how can I send text to my participants? I believe we could use:
Copy code
self.session.room_io.room.local_participant.send_text("my payload",
                                                       topic="my topic")
Within the Agent but I can't test this via
uv run agent.py console
as it gives me a Runtime error that says
Copy code
RuntimeError: Cannot access room_io: the AgentSession was not started with a room.
which makes sense but then how do I test this locally? Also is accessing room_io the best way to do this?
l
You can run
uv run agent.py dev
to have your agent connect to a room. You can then test it locally with a front end using the same LiveKit API key for both agent and front end. The room object is available from
ctx.room
a
alright will try that out - I want to access the
ctx.room
within the
llm_node
-> so how do I get the room object?
l
I'm not sure about the best way, but I see examples getting the room with get_job_context() which has a room attribute