-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Hotel Receptionist Scenario Expansion #6186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+5,191
−1,077
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b913c02
Port hotel receptionist scenarios + supporting flows onto PR branch
ShayneP cbdc1ea
Add scenarios
ShayneP 4caaf69
Scenarios up to 100
ShayneP 9f921d1
Fix Devin feedback
ShayneP d10882d
More fixes from Devin
ShayneP f4dea99
Add VAD
ShayneP 5b28e2e
Fix error type
ShayneP f744660
Ruff fixes
ShayneP a5ab976
Merge branch 'main' into ShayneP/hotel-scenarios-2
tinalenguyen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import os | ||
| import sys | ||
| from dataclasses import dataclass, field | ||
|
|
||
| sys.path.append(os.path.dirname(os.path.abspath(__file__))) | ||
|
|
||
| from hotel_db import HotelDB, RoomBooking | ||
|
|
||
| from livekit.agents import llm | ||
|
|
||
|
|
||
| @dataclass | ||
| class Userdata: | ||
| db: HotelDB | ||
| # Departments already transferred to this call - guards against a duplicate transfer | ||
| # row when the agent re-calls transfer_call after the caller's reaction. | ||
| transferred_to: set[str] = field(default_factory=set) | ||
| # The refund outcome from the last room cancellation, and the caller-turn count when it | ||
| # happened - so a re-invoked cancel (no caller input since) re-surfaces that answer | ||
| # instead of re-verifying into a confusing "already cancelled" dead end. | ||
| last_cancel_message: str = "" | ||
| caller_turns_at_last_cancel: 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 | ||
|
|
||
|
|
||
| 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()) | ||
|
|
||
|
|
||
| def _count_caller_turns(chat_ctx: llm.ChatContext) -> int: | ||
| """How many times the caller has spoken so far - the signal for whether a | ||
| booking flow was actually driven by the caller or silently re-run by the model.""" | ||
| return sum(1 for it in chat_ctx.items if it.type == "message" and it.role == "user") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.