I would like to create and chat with a text only a...
# ask-ai
c
I would like to create and chat with a text only agent. I tried following the documentation and setting
audio_enabled
to
False
in
RoomInputOptions
and `RoomOutputOptions`:
Copy code
await session.start(
    agent=client_agent,
    room=ctx.room,
    room_input_options=RoomInputOptions(
        text_enabled=True,
        audio_enabled=False,
    ),
    room_output_options=RoomOutputOptions(
        audio_enabled=False,
    ),
)
But when I connected to this agent in the Agent Playground, it would not create or respond to any messages in the chat. Am I doing something wrong here?
t
Thanks for reaching out, Orion. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To create a text-only agent, ensure the following configuration:
Copy code
session = AgentSession(
    llm=openai.LLM(model="gpt-4o-mini"),
    # note that no TTS or STT are needed here
)
await session.start(
    agent=MyAgent(),
    room=ctx.room,
    room_input_options=RoomInputOptions(text_enabled=True, audio_enabled=False),
    room_output_options=RoomOutputOptions(transcription_enabled=True, audio_enabled=False),
)
Key points: • Set
audio_enabled=False
in both
RoomInputOptions
and
RoomOutputOptions
. • Set
text_enabled=True
in
RoomInputOptions
to receive text messages. • Set
transcription_enabled=True
in
RoomOutputOptions
to send text responses. When configured correctly, the agent will receive text input from the
lk.chat
text stream topic and send text output to the
lk.transcription
text stream topic without a
lk.transcribed_track_id
attribute. If the agent is still not responding, double-check the configuration to ensure all options are set as described. Sources: Text and transcriptions | LiveKit Docs | GitHub::livekit::agents | livekit-agents/livekit/agents/voice/agent_session...
c
Thats already what I did but it isn't working, it works fine if audio_enabled=True for both, so it isn't a problem with the agent.
t
Hey there! I totally understand the transcription confusion you're experiencing. It sounds like there might be a tricky little issue with how transcriptions get published when audio_enabled=False. Some apps actually depend on the audio track being created to trigger those legacy transcription events, even if you're just using the text stream. Here's a couple of friendly ways we can tackle this: 1. Keep
audio_enabled=True
but just mute the audio on your client side - super simple fix! 2. Make sure your frontend is set up to grab text directly from the text stream (
lk.transcription
) instead of waiting on those older transcription events. Want to chat more about getting this sorted? I'm here to help! Just let me know if you need any extra guidance with these tweaks. Sources: Text and transcriptions | LiveKit Docs | GitHub::livekit::agents | examples/other/transcription/translator.py
c
The frontend I am using is the Agent Playground, is it configured like that?
t
Hey there! šŸ‘‹ Let me break down how the Agent Playground works with text-only agents in a super friendly way. • Input: Your agent will receive text through the
lk.chat
text stream topic – think of it like getting a message from a friend. • Output: Your agent sends responses via the
lk.transcription
text stream topic, and it won't need that extra
lk.transcribed_track_id
attribute. If you're finding that the Agent Playground isn't responding to your text-only agent, don't worry! It might just be a small hiccup with how the lk.transcription text stream is being handled. Could be a configuration quirk or a current limitation. I'd be more than happy to help you troubleshoot and get things running smoothly. Just let me know what's going on, and we'll figure it out together! 😊 Sources: Text and transcriptions | LiveKit Docs | GitHub::livekit::agents | examples/other/chat-stream-receiver.py