Chat Mode
Overview
Section titled “Overview”There are two main ways to enable chat mode:
- Agent Configuration: Configure your agent for text-only mode when creating it via the API
- Runtime Overrides: Use SDK overrides to enforce text-only conversations programmatically
This guide covers both approaches and how to implement chat mode across different SDKs.
Creating Text-Only Agents
Section titled “Creating Text-Only Agents”Configure an agent for text-only mode to make it the default for every conversation with that agent.
Update via the dashboard
Section titled “Update via the dashboard”Open your agent in the dashboard, navigate to the Advanced tab, and enable the Text only toggle. Save your changes.
Update via the CLI
Section titled “Update via the CLI”Pull the agent configuration
Section titled “Pull the agent configuration”elevenlabs agents pull --agent "<agent-name>"Edit `agent_configs/<agent-name>.json`
Section titled “Edit `agent_configs/<agent-name>.json`”Set conversation_config.conversation.text_only:
{
"conversation_config": {
"conversation": {
"text_only": true
}
}
}Push your changes
Section titled “Push your changes”elevenlabs agents push --agent "<agent-name>"Update via the API
Section titled “Update via the API”from elevenlabs import ElevenLabs
elevenlabs = ElevenLabs()
elevenlabs.conversational_ai.agents.update(
agent_id="agent_7101k5zvyjhmfg983brhmhkd98n6",
conversation_config={
"conversation": {"text_only": True},
},
)import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
const elevenlabs = new ElevenLabsClient();
await elevenlabs.conversationalAi.agents.update("agent_7101k5zvyjhmfg983brhmhkd98n6", {
conversationConfig: {
conversation: { textOnly: true },
},
});Runtime Overrides for Text-Only Mode
Section titled “Runtime Overrides for Text-Only Mode”To enable chat mode at runtime using overrides (rather than configuring at the agent level), you can use the textOnly override in your conversation configuration:
from elevenlabs.client import ElevenLabs
from elevenlabs.conversational_ai.conversation import Conversation, ConversationInitiationData
# Configure for text-only mode with proper structure
conversation_override = {
"conversation": {
"text_only": True
}
}
config = ConversationInitiationData(
conversation_config_override=conversation_override
)
conversation = Conversation(
elevenlabs,
agent_id,
requires_auth=bool(api_key),
config=config,
# Important: Ensure agent_response callback is set
callback_agent_response=lambda response: print(f"Agent: {response}"),
callback_user_transcript=lambda transcript: print(f"User: {transcript}"),
)
conversation.start_session()const conversation = await Conversation.startSession({
agentId: "<your-agent-id>",
overrides: {
conversation: {
textOnly: true,
},
},
});This configuration ensures that:
- No audio input/output is used
- All communication happens through text messages
- The conversation operates in a chat-like interface mode
Important Notes
Section titled “Important Notes”Key Requirements
Section titled “Key Requirements”-
Agent Response Event: Always configure the
agent_responsecallback or event handler to receive and display the agent's text messages. -
Agent Configuration: If your agent is specifically set to chat mode in the agent settings, it will automatically use text-only conversations without requiring the override.
-
No Audio Interface: When using text-only mode, you don't need to configure audio interfaces or request microphone permissions.
Example: Handling Agent Responses
Section titled “Example: Handling Agent Responses”def handle_agent_response(response):
"""Critical handler for displaying agent messages"""
print(f"Agent: {response}") # Update your UI with the response
update_chat_ui(response)
config = ConversationInitiationData(
conversation_config_override={"conversation": {"text_only": True}}
)
conversation = Conversation(
elevenlabs,
agent_id,
config=config,
callback_agent_response=handle_agent_response,
)
conversation.start_session()const conversation = await Conversation.startSession({
agentId: "<your-agent-id>",
overrides: {
conversation: {
textOnly: true,
},
},
// Critical: Handle agent responses
onMessage: (message) => {
if (message.type === "agent_response") {
console.log("Agent:", message.text);
// Display in your UI
displayAgentMessage(message.text);
}
},
});Sending Text Messages
Section titled “Sending Text Messages”In chat mode, you'll need to send user messages programmatically instead of through audio:
# Send a text message to the agent
conversation.send_user_message("Hello, how can you help me today?")// Send a text message to the agent
conversation.sendUserMessage({
text: "Hello, how can you help me today?",
});Concurrency Benefits
Section titled “Concurrency Benefits”Chat mode provides significant concurrency advantages over voice conversations:
- Higher Limits: Chat-only conversations have 25x higher concurrency limits than voice conversations
- Separate Pool: Text conversations use a dedicated concurrency pool, independent of voice conversation limits
- Scalability: Ideal for high-throughput applications like customer support, chatbots, or automated testing
| Plan | Voice Concurrency | Chat-only Concurrency |
|---|---|---|
| Free | 4 | 100 |
| Starter | 6 | 150 |
| Creator | 10 | 250 |
| Pro | 20 | 500 |
| Scale | 30 | 750 |
| Business | 30 | 750 |
| Enterprise | Elevated | Elevated (25x) |
Use Cases
Section titled “Use Cases”Chat mode is ideal for:
- Chat Interfaces: Building traditional chat UIs without voice
- Testing: Testing agent logic without audio dependencies
- Accessibility: Providing text-based alternatives for users
- Silent Environments: When audio input/output is not appropriate
- Integration Testing: Automated testing of agent conversations
Troubleshooting
Section titled “Troubleshooting”Agent Not Responding
Section titled “Agent Not Responding”If the agent's responses are not appearing:
- Verify the
agent_responsecallback is properly configured - Check that the agent is configured for chat mode or the
textOnlyoverride is set - Ensure the WebSocket connection is established successfully
Next Steps
Section titled “Next Steps”- Learn about customizing agent behavior
- Explore client events for advanced interactions
- See authentication setup for secure conversations