Hotel receptionist polish#6299
Conversation
- Let the TTS parse codes and currency itself instead of pre-spelling (speak_usd returns "$220"/"$100.10"; _speak_code returns the raw code) - Add PHONE_READBACK_INSTRUCTIONS for the phone-collection dialogs - Make the Inworld voice configurable via HOTEL_TTS_VOICE (defaults to the provider voice when unset) - Set explicit agent_name for dispatch; add .dockerignore; ignore livekit.toml Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| def _speak_code(code: str) -> str: | ||
| # Spell character by character, with "-" spoken as the single word "dash" - | ||
| # NOT spelled D, A, S, H (that reads as four more code characters). | ||
| return ", ".join("dash" if c == "-" else c for c in code.upper()) | ||
| # Hand the raw code to the TTS - its own parser reads alphanumeric codes | ||
| # correctly; we don't pre-spell it character by character. | ||
| return code.upper() |
There was a problem hiding this comment.
π© TTS-dependent behavior change in _speak_code removes explicit character spelling
The old _speak_code spelled codes character by character with dashes spoken as "dash" (e.g., "H, T, L, dash, X, Q, 7, Z"). The new version just returns code.upper() and relies entirely on the TTS engine's built-in parser to read alphanumeric codes correctly. This is used in ~20 places (tools_rooms.py, tools_services.py, tools_restaurant.py) for confirmation codes, case numbers, and reference codes. If the TTS engine doesn't handle mixed alphanumeric codes well (e.g., reads "HTL-XQ7Z" as a word rather than spelling it), callers won't be able to note down their codes. The persona instructions at examples/hotel_receptionist/persona.py:27 now explicitly say the TTS handles this, so this is intentional - but it's a significant behavioral dependency on the TTS provider.
Was this helpful? React with π or π to provide feedback.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Polish hotel receptionist example: TTS-native formatting, configurable voice, suggested replies
Also preps the hotel receptionist example for the hosted demo at livekit.com/agents/hotel-receptionist.
TTS-native formatting
Inworld TTS parses money, dates, codes, and phone numbers correctly on its own, so we stop pre-spelling them for it:
speak_usdnow emits plain currency strings ($1,240.50) instead of spelled-out words ("twelve hundred forty dollars and fifty cents")._speak_codehands the raw confirmation code to the TTS instead of spelling it character by character.PHONE_READBACK_INSTRUCTIONS(used by both booking tasks' phone dialogs) so numbers are read back in standard 415-555-0170 format rather than as separated digit groups.Configurable voice
The TTS voice can now be overridden via the
HOTEL_TTS_VOICEenv var (falls back to the provider default when unset).Suggested replies (suggested_replies.py, new)
A self-contained sidecar for the demo frontend: after each receptionist turn, a small LLM proposes 1β3 short replies the caller could speak next, published on the agent participant as the lk.agent.suggestions attribute so the web UI can render clickable nudge chips.
SuggestedReplies(session, ctx.room, llm=...).attach()Deployment prep
agent_name="hotel_receptionist"for explicit dispatch..dockerignorefor the example.livekit.toml