Test Mode
Test mode lets you interact with your agent in the terminal using pure text — no phone calls, no STT/TTS, no external services required. It simulates a phone conversation for rapid development.Quick Start
Commands
| Command | Description |
|---|---|
/quit | End the test session. |
/hangup | Simulate hanging up the call. |
/transfer <number> | Simulate a call transfer. |
/history | Print the full conversation history. |
Using with onMessage
Test mode works with custom message handlers, exactly as they would work in production:
onMessage handler receives a single data object with text, call_id, caller, and history fields.
Using with Built-in LLM Loop
When noonMessage handler is provided and OPENAI_API_KEY is available (either from new OpenAIRealtime({ apiKey }) or the env var), test mode uses the built-in LLM loop with streaming responses:
Event Callbacks
Test mode fires the same lifecycle callbacks asserve():
Test mode is designed for development only. It does not use any external APIs (except OpenAI for the LLM loop when no
onMessage is provided).
