@@ -39,21 +39,22 @@ class AirlineAgentContext(BaseModel):
3939 name_override = "faq_lookup_tool" , description_override = "Lookup frequently asked questions."
4040)
4141async def faq_lookup_tool (question : str ) -> str :
42- if "bag" in question or "baggage" in question :
42+ question_lower = question .lower ()
43+ if any (keyword in question_lower for keyword in ["bag" , "baggage" , "luggage" , "carry-on" , "hand luggage" , "hand carry" ]):
4344 return (
4445 "You are allowed to bring one bag on the plane. "
4546 "It must be under 50 pounds and 22 inches x 14 inches x 9 inches."
4647 )
47- elif "seats" in question or "plane" in question :
48+ elif any ( keyword in question_lower for keyword in [ "seat" , "seats" , "seating" , "plane" ]) :
4849 return (
4950 "There are 120 seats on the plane. "
5051 "There are 22 business class seats and 98 economy seats. "
5152 "Exit rows are rows 4 and 16. "
5253 "Rows 5-8 are Economy Plus, with extra legroom. "
5354 )
54- elif "wifi" in question :
55+ elif any ( keyword in question_lower for keyword in [ "wifi" , "internet" , "wireless" , "connectivity" , "network" , "online" ]) :
5556 return "We have free wifi on the plane, join Airline-Wifi"
56- return "I'm sorry, I don't know the answer to that question."
57+ return "I'm sorry, I don't know the answer to that question."
5758
5859
5960@function_tool
0 commit comments