Skip to content
Open
10 changes: 10 additions & 0 deletions examples/hotel_receptionist/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,22 @@ class Userdata:
# instead of re-verifying into a confusing "already cancelled" dead end.
last_cancel_message: str = ""
caller_turns_at_last_cancel: int = -1
# The last completed booking modification's outcome, and the caller-turn count when
# it finished - so a re-invoked modification (no caller input since) relays that
# outcome instead of re-opening the flow on a booking that was just updated.
last_modification_message: str = ""
caller_turns_at_last_modification: int = -1
verified_booking: RoomBooking | None = None
# The most recent completed room booking, and the caller-turn count at the moment
# it completed - together they catch a model that re-runs the booking flow with no
# caller input since, which would silently double-book the guest.
last_room_booking: RoomBooking | None = None
caller_turns_at_last_booking: int = 0
# Whether a room-booking flow is currently awaiting its inline BookRoomTask.
# Parallel inline AgentTasks are unsupported (the second activation orphans the
# first call's future and wedges the session), so a second start_room_booking
# while one is in flight must bounce with a ToolError instead of running.
room_booking_in_flight: bool = False


def _speak_code(code: str) -> str:
Expand Down
Loading
Loading