Skip to content

Hotel receptionist polish#6299

Open
ShayneP wants to merge 3 commits into
mainfrom
hotel-receptionist-polish
Open

Hotel receptionist polish#6299
ShayneP wants to merge 3 commits into
mainfrom
hotel-receptionist-polish

Conversation

@ShayneP

@ShayneP ShayneP commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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_usd now emits plain currency strings ($1,240.50) instead of spelled-out words ("twelve hundred forty dollars and fifty cents").
  • _speak_code hands the raw confirmation code to the TTS instead of spelling it character by character.
  • Persona instructions updated to match: write money in figures with a dollar sign, don't spell numbers out as words, don't read codes character by character.
  • New 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_VOICE env 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.

  • Attached in one line in the entrypoint: SuggestedReplies(session, ctx.room, llm=...).attach()
  • Newest turn wins: an in-flight generation is cancelled when the receptionist speaks again, and chips are cleared at the start of each turn, so stale suggestions are never shown.
  • Defensive JSON parsing (salvages objects wrapped in prose/fences); on any failure it publishes an empty list rather than stale chips.
  • The prompt only invents guest-side details (obviously-fake demo values: example.com email, 555 number, 4242 test card) and never facts the hotel controls (prices, availability, confirmation codes).

Deployment prep

  • Set agent_name="hotel_receptionist" for explicit dispatch.
  • Added a .dockerignore for the example.
  • Gitignore livekit.toml

ShayneP and others added 2 commits July 1, 2026 11:25
- 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>
@ShayneP ShayneP requested a review from a team as a code owner July 2, 2026 19:15

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines 33 to +36
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()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 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.

Open in Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant