faint-secretary-9636
01/01/2026, 12:24 PMAgentSession using STT/TTS (audio in/out). I want to test it with synthetic users that send/receive text instead of audio. Current setup:
• FrontDesk: AgentSession with STT (Deepgram) + TTS (Deepgram) + LLM
• Synthetic User: Plain rtc.Room participant listening to data_received events and sending text via local_participant.send_text()
Problem: The voice agent processes audio, not text messages. The synthetic user can't "hear" what the agent says (audio) and the agent can't "hear" text messages. Goal: Make the voice agent's speech visible to text-based participants and make text messages visible to the voice agent's chat context. Is there a way to:
1. Publish the agent's STT transcriptions as text data packets?
2. Inject text messages into the agent's chat context as if they were transcribed speech?
Or should I use a different approach for testing?few-analyst-46
01/01/2026, 11:31 PMawait session.start(
agent=agent,
room=ctx.room,
room_options=RoomOptions(
video_input=metadata.room.video_input,
audio_input=metadata.room.audio_input,
audio_output=metadata.room.audio_output,
text_input=TextInputOptions(
text_input_cb=text_input_cb,
),
text_output=TextOutputOptions(
# must enable it here so we could toggle it later
# TODO(Deo): toggle it base on user's last input
sync_transcription=True
),
),
)
you could follow the default text_input_cb to make necessary changes