@@ -39,21 +39,22 @@ class AirlineAgentContext(BaseModel):
39
39
name_override = "faq_lookup_tool" , description_override = "Lookup frequently asked questions."
40
40
)
41
41
async 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" ]):
43
44
return (
44
45
"You are allowed to bring one bag on the plane. "
45
46
"It must be under 50 pounds and 22 inches x 14 inches x 9 inches."
46
47
)
47
- elif "seats" in question or "plane" in question :
48
+ elif any ( keyword in question_lower for keyword in [ "seat" , "seats" , "seating" , "plane" ]) :
48
49
return (
49
50
"There are 120 seats on the plane. "
50
51
"There are 22 business class seats and 98 economy seats. "
51
52
"Exit rows are rows 4 and 16. "
52
53
"Rows 5-8 are Economy Plus, with extra legroom. "
53
54
)
54
- elif "wifi" in question :
55
+ elif any ( keyword in question_lower for keyword in [ "wifi" , "internet" , "wireless" , "connectivity" , "network" , "online" ]) :
55
56
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."
57
58
58
59
59
60
@function_tool
0 commit comments