From 365421446fcdfe45061651bdc2b8861ea972b5bb Mon Sep 17 00:00:00 2001 From: Hasnain Ali Date: Fri, 11 Jul 2025 18:40:26 +0500 Subject: [PATCH 1/2] Enhanced FAQ lookup tool in main.py Added additional keywords and implemented case insensitivity to improve the tool's ability to handle a wider range of user questions. --- examples/customer_service/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/customer_service/main.py b/examples/customer_service/main.py index bd802e228..fb4349b2b 100644 --- a/examples/customer_service/main.py +++ b/examples/customer_service/main.py @@ -39,21 +39,22 @@ class AirlineAgentContext(BaseModel): name_override="faq_lookup_tool", description_override="Lookup frequently asked questions." ) async def faq_lookup_tool(question: str) -> str: - if "bag" in question or "baggage" in question: + question_lower = question.lower() + if any(keyword in question_lower for keyword in ["bag", "baggage", "luggage", "carry-on","hand luggage","hand carry"]): return ( "You are allowed to bring one bag on the plane. " "It must be under 50 pounds and 22 inches x 14 inches x 9 inches." ) - elif "seats" in question or "plane" in question: + elif any(keyword in question_lower for keyword in ["seat", "seats", "seating", "plane"]): return ( "There are 120 seats on the plane. " "There are 22 business class seats and 98 economy seats. " "Exit rows are rows 4 and 16. " "Rows 5-8 are Economy Plus, with extra legroom. " ) - elif "wifi" in question: + elif any(keyword in question_lower for keyword in ["wifi", "internet", "wireless", "connectivity", "network", "online"]): return "We have free wifi on the plane, join Airline-Wifi" - return "I'm sorry, I don't know the answer to that question." + return "I'm sorry, I don't know the answer to that question." @function_tool From a3f42031f402dbd32e6ba6b4b0bc3158a2800843 Mon Sep 17 00:00:00 2001 From: Hasnain Ali Date: Sat, 12 Jul 2025 11:46:50 +0500 Subject: [PATCH 2/2] Update examples/customer_service/main.py Co-authored-by: Kazuhiro Sera --- examples/customer_service/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/customer_service/main.py b/examples/customer_service/main.py index fb4349b2b..8ed218536 100644 --- a/examples/customer_service/main.py +++ b/examples/customer_service/main.py @@ -40,7 +40,7 @@ class AirlineAgentContext(BaseModel): ) async def faq_lookup_tool(question: str) -> str: question_lower = question.lower() - if any(keyword in question_lower for keyword in ["bag", "baggage", "luggage", "carry-on","hand luggage","hand carry"]): + if any(keyword in question_lower for keyword in ["bag", "baggage", "luggage", "carry-on", "hand luggage", "hand carry"]): return ( "You are allowed to bring one bag on the plane. " "It must be under 50 pounds and 22 inches x 14 inches x 9 inches."