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
When your agent is configured for chat mode or when you want to enforce text-only conversations programmatically, you can use the SDKs with specific configuration options. This guide covers how to implement chat mode across different SDKs.
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.
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