diff --git a/examples/customer_service/main.py b/examples/customer_service/main.py index bd802e228..8ed218536 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