Question: Testing voice agent with text-only synth...
# agents
f
Question: Testing voice agent with text-only synthetic users I have a voice agent built with
AgentSession
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?
f
implement the input_cb in
Copy code
await 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