CookbooksMYLO Cookbooks
Build a Multilingual Support Agent
Serve Nepali and English callers in one MYLO session with auto language detection.
- Start sessions in
ne-NPanden-USwith the same agent logic - Auto detect caller language and reply in kind
- Look up orders live with a function tool schema Time to complete: ~20 minutes
Prerequisites
SAGEA_API_KEYexported in your shell asBearerauth- Python 3.10+ with
requestsandwebsocket-clientinstalled - A mock order database or API for the lookup tool
- Complete Send your first API request
- Read the MYLO overview import from '@/components/Tabs';
Step 1: Create a Nepali-first session
Create the agent in ne-NP with English fallback so greetings feel native.
Audio streams as 16kHz PCM in and speech out with ~200ms first byte.
Step 2: Add order lookup tool
Attach fetch_order_status so the agent resolves order questions in either language.
Return status, ETA, and location from the tool so voice replies stay short.
Step 3: Test both languages and review transcript
Open en-US and ne-NP sessions, speak one turn each, then compare.
Confirm the agent mirrors the caller language within the first two turns.
Verify
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | Missing or invalid API key | Export valid SAGEA_API_KEY and retry |
404 session_not_found | Session ID mixed across languages | Track NP and EN IDs separately |
429 rate_limit_exceeded | Parallel language tests throttled | Serialize tests, add retry with backoff |
422 voice_not_found | Voice unavailable for language | Use nova or atlas, verify pairing |
