Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions examples/hotel_receptionist/tools_restaurant.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ async def lookup_restaurant_reservation(
) -> str:
"""Read-only lookup of a confirmed restaurant reservation. Use this when the caller wants
to check or recall their reservation details (date, time, party size, notes) without
changing or cancelling it.
changing or cancelling it - and before a modification that keeps some details "the
same", so you know the current values being kept.

Args:
last_name: caller's last name.
Expand Down Expand Up @@ -126,14 +127,15 @@ async def modify_restaurant_reservation(
"""Move an existing confirmed restaurant reservation to a new date/time (and
optionally a new party size), keeping the same confirmation code. Restaurants
verify with last name + confirmation code (no card, no email). Read the new
details back to the caller before calling this.
details back to the caller before calling this, and relay the party size from
this tool's return when confirming - it's how a wrong count gets caught.

Args:
last_name: caller's last name.
confirmation_code: confirmation code like 'RES-X9Y2'.
new_date: the new date, in ISO YYYY-MM-DD format (e.g. "2026-01-20").
new_time: the new time, in 24-hour HH:MM format (e.g. "18:00").
new_party_size: new number of guests; omit to keep the current party size.
new_party_size: new number of guests, ONLY when the caller states the new number. "Keep it the same" means OMIT this parameter - the reservation keeps its current size when omitted. Never fill it with a number the caller didn't say.
"""
if new_date < TODAY:
raise ToolError("the new date can't be in the past")
Expand Down Expand Up @@ -163,5 +165,7 @@ async def modify_restaurant_reservation(
f"Done - your reservation is now {speak_time(updated.time)} on "
f"{updated.date.strftime('%A, %B %-d')} for "
f"{updated.party_size} guest{'s' if updated.party_size != 1 else ''}, "
f"under confirmation code {_speak_code(updated.code)}."
f"under confirmation code {_speak_code(updated.code)}. "
"| confirm the new date, time, AND the party size above to the caller - if the "
"party size isn't what they expect, this is their chance to catch it."
)