Chat Mode
Configure your agent for text-only conversations with chat mode
Chat mode allows your agents to act as chat agents, ie to have text-only conversations without audio input/output. This is useful for building chat interfaces, testing agents, or when audio is not required.
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
You can configure an agent for text-only mode when creating it via the API. This sets the default behavior for all conversations with that agent.
Python
JavaScript
For complete API reference and all available configuration options, see the text only field in Create Agent API documentation.
JavaScript SDK
Text-Only Configuration
To use the JavaScript SDK in chat mode with text-only conversations, add the textOnly
override to your conversation configuration:
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
Python SDK
Text-Only Configuration
For the Python SDK, configure the conversation for text-only mode:
Important Notes
Critical: When using chat mode, you must ensure the agent_response
event/callback is
activated and properly configured. Without this, the agent’s text responses will not be sent or
displayed to the user.
Security Overrides: When using runtime overrides (not agent-level configuration), you must enable the conversation overrides in your agent’s security settings. Navigate to your agent’s Security tab and enable the appropriate overrides. For more details, see the Overrides documentation.
Key Requirements
-
Agent Response Event: Always configure the
agent_response
callback 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
JavaScript
Python
Sending Text Messages
In chat mode, you’ll need to send user messages programmatically instead of through audio:
JavaScript
Python
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
Agent Not Responding
If the agent’s responses are not appearing:
- Verify the
agent_response
callback is properly configured - Check that the agent is configured for chat mode or the
textOnly
override is set - Ensure the WebSocket connection is established successfully
Next Steps
- Learn about customizing agent behavior
- Explore client events for advanced interactions
- See authentication setup for secure conversations