is there a way to test livekit agent python in tex...
# ask-ai
c
is there a way to test livekit agent python in text only mode by using livekit-client?
t
Thanks for reaching out, Vahid. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To help you test a LiveKit agent in text-only mode using
livekit-client
, here’s a simple step-by-step guide: 1. Set Up the Text-Only Agent: Start by configuring the agent with
RoomInputOptions(text_enabled=True, audio_enabled=False)
and
RoomOutputOptions(transcription_enabled=True, audio_enabled=False)
. This setup makes sure the agent receives text input from the
lk.chat
topic and sends its responses through the
lk.transcription
topic. 2. Send Text Input: From your LiveKit client, use the
TextStream
on the
lk.chat
topic to send text messages to the agent. 3. Receive Agent Response: Make sure your client application listens for responses on the
lk.transcription
topic. For example, you can use the
on_text_received
event in
livekit-client
to catch incoming replies. 4. Test Using Terminal Mode: For a quick and easy local test without needing external servers, run the agent in terminal mode using
python myagent.py console
. This approach lets you fully interact with and test your LiveKit agent through text. If you have any questions or want me to walk you through any part, just let me know — I’m here to help! Sources: tests/__init__.py | Testing and evaluation | LiveKit Docs