#we want to allow users to switch between voice chatting and text messaging for our agent sessions.
1 messages · Page 1 of 1 (latest)
Short answer: yes, users can switch between speaking and typing mid‑session without restarting—provided the session isn’t forced into “chat‑only” mode.
Details:
- Widget/SDK sessions in “Voice + text” allow users to alternate between microphone input and typed messages during the same ongoing conversation. No restart is required. (elevenlabs.io)
- In the JS SDK you can:
- send typed messages at any time with conversation.sendUserMessage(...)
- temporarily “go text‑only” by muting the mic via conversation.setMicMuted(true)
These work during an active session. (elevenlabs.io)
- If you need to enforce true Chat Mode (text‑only) for concurrency/behavior reasons, set conversation_config_override.conversation.text_only = true when starting the session. Switching this setting isn’t documented mid‑session; use a new session to change it. (elevenlabs.io)
So: enable “Voice + text” to let users switch on the fly; start a new session only when toggling into or out of enforced Chat Mode. (elevenlabs.io)
Sources:
Widget customization | ElevenLabs Documentation
JavaScript SDK | ElevenLabs Documentation
Chat Mode | ElevenLabs Documentation
Widget customization | ElevenLabs Documentation
what about in react native
Short answer: In React Native you can type during an active voice session without restarting; but if you want a true text‑only “chat mode” (no audio I/O), the docs only show enabling that at conversation start, so you should end the current session and start a new one configured for chat mode.
What’s supported in the React Native SDK
- Send text mid‑session: call useConversation().sendUserMessage(...) while a voice session is connected; no restart required. (elevenlabs.io)
- Temporarily switch to typing: mute the mic with conversation.setMicMuted(true), send text messages; unmute with setMicMuted(false) to return to voice—all without restarting. (elevenlabs.io)
When you must restart
- Chat‑only mode (no audio) is configured at conversation initiation either by:
- setting the agent to text‑only in its config, or
- passing a text_only override when starting the conversation.
The documentation does not describe toggling text_only during an active session, so switching between voice and true chat‑only requires ending the session and starting a new one with the desired configuration. (elevenlabs.io)
React Native specifics
- The RN SDK uses WebRTC (via LiveKit). It requires a development build (not Expo Go) and microphone permissions; follow the SDK setup notes.
can we have the agent reply via text if the user is chatting via text, and the agent reply with voice if the user is talking with voice, and switch between the two without starting a new session on the react native SDK?