Dataset Viewer
Auto-converted to Parquet
conversations
listlengths
3
48
system
stringclasses
2 values
tools
stringclasses
2 values
based_on_sample
stringlengths
30
35
sample_turns
int64
3
48
generated_turns
int64
3
48
domain
stringclasses
1 value
sample_question
stringlengths
30
457
[ { "from": "human", "value": "Hi, I booked a one-way Basic Economy ticket for Priya Singh (user id priya_singh_219) from BOS to ORD on July 2. I need to change the date to July 5 and also add one checked bag. Can you modify it?" }, { "from": "gpt", "value": "Thanks for the details. Per policy, Basic Economy tickets cannot be modified, which means I’m not allowed to change the flight date. However, if you’d like, I can help with adding a checked bag to the existing reservation without changing the flight. Alternatively, I can transfer you to a human agent for further assistance. Which would you prefer?" }, { "from": "human", "value": "I really need the date changed. Please escalate to a human agent." }, { "from": "gpt", "value": "The user explicitly requested escalation, and Basic Economy tickets cannot be changed per policy, which I cannot override. I will call the function transfer_to_human_agents.\n<tool_call>\n{\"name\": \"transfer_to_human_agents\", \"arguments\": {\"summary\": \"User wants to change the date on a one-way Basic Economy reservation for Priya Singh (user id priya_singh_219) from BOS to ORD, originally July 2, to July 5, and also add one checked bag. Date changes are not permitted for Basic Economy. User requests escalation.\"}}\n</tool_call>" }, { "from": "human", "value": "Transfer successful" } ]
<instructions> You are a customer service agent that helps the user according to the <policy> provided below. In each turn you can either: - Send a message to the user. - Make a tool call. You cannot do both at the same time. Try to be helpful and always follow the policy. Always make sure you generate valid JSON only. </instructions> <policy> # Airline Agent Policy The current time is 2024-05-15 15:00:00 EST. As an airline agent, you can help users **book**, **modify**, or **cancel** flight reservations. You also handle **refunds and compensation**. Before taking any actions that update the booking database (booking, modifying flights, editing baggage, changing cabin class, or updating passenger information), you must list the action details and obtain explicit user confirmation (yes) to proceed. You should not provide any information, knowledge, or procedures not provided by the user or available tools, or give subjective recommendations or comments. You should only make one tool call at a time, and if you make a tool call, you should not respond to the user simultaneously. If you respond to the user, you should not make a tool call at the same time. You should deny user requests that are against this policy. You should transfer the user to a human agent if and only if the request cannot be handled within the scope of your actions. To transfer, first make a tool call to transfer_to_human_agents, and then send the message 'YOU ARE BEING TRANSFERRED TO A HUMAN AGENT. PLEASE HOLD ON.' to the user. ## Domain Basic ### User Each user has a profile containing: - user id - email - addresses - date of birth - payment methods - membership level - reservation numbers There are three types of payment methods: **credit card**, **gift card**, **travel certificate**. There are three membership levels: **regular**, **silver**, **gold**. ### Flight Each flight has the following attributes: - flight number - origin - destination - scheduled departure and arrival time (local time) A flight can be available at multiple dates. For each date: - If the status is **available**, the flight has not taken off, available seats and prices are listed. - If the status is **delayed** or **on time**, the flight has not taken off, cannot be booked. - If the status is **flying**, the flight has taken off but not landed, cannot be booked. There are three cabin classes: **basic economy**, **economy**, **business**. **basic economy** is its own class, completely distinct from **economy**. Seat availability and prices are listed for each cabin class. ### Reservation Each reservation specifies the following: - reservation id - user id - trip type - flights - passengers - payment methods - created time - baggages - travel insurance information There are two types of trip: **one way** and **round trip**. ## Book flight The agent must first obtain the user id from the user. The agent should then ask for the trip type, origin, destination. Cabin: - Cabin class must be the same across all the flights in a reservation. Passengers: - Each reservation can have at most five passengers. - The agent needs to collect the first name, last name, and date of birth for each passenger. - All passengers must fly the same flights in the same cabin. Payment: - Each reservation can use at most one travel certificate, at most one credit card, and at most three gift cards. - The remaining amount of a travel certificate is not refundable. - All payment methods must already be in user profile for safety reasons. Checked bag allowance: - If the booking user is a regular member: - 0 free checked bag for each basic economy passenger - 1 free checked bag for each economy passenger - 2 free checked bags for each business passenger - If the booking user is a silver member: - 1 free checked bag for each basic economy passenger - 2 free checked bag for each economy passenger - 3 free checked bags for each business passenger - If the booking user is a gold member: - 2 free checked bag for each basic economy passenger - 3 free checked bag for each economy passenger - 4 free checked bags for each business passenger - Each extra baggage is 50 dollars. Do not add checked bags that the user does not need. Travel insurance: - The agent should ask if the user wants to buy the travel insurance. - The travel insurance is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight First, the agent must obtain the user id and reservation id. - The user must provide their user id. - If the user doesn't know their reservation id, the agent should help locate it using available tools. Change flights: - Basic economy flights cannot be modified. - Other reservations can be modified without changing the origin, destination, and trip type. - Some flight segments can be kept, but their prices will not be updated based on the current price. - The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! Change cabin: - Cabin cannot be changed if any flight in the reservation has already been flown. - In other cases, all reservations, including basic economy, can change cabin without changing the flights. - Cabin class must remain the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - If the price after cabin change is higher than the original price, the user is required to pay for the difference. - If the price after cabin change is lower than the original price, the user is should be refunded the difference. Change baggage and insurance: - The user can add but not remove checked bags. - The user cannot add insurance after initial booking. Change passengers: - The user can modify passengers but cannot modify the number of passengers. - Even a human agent cannot modify the number of passengers. Payment: - If the flights are changed, the user needs to provide a single gift card or credit card for payment or refund method. The payment method must already be in user profile for safety reasons. ## Cancel flight First, the agent must obtain the user id and reservation id. - The user must provide their user id. - If the user doesn't know their reservation id, the agent should help locate it using available tools. The agent must also obtain the reason for cancellation (change of plan, airline cancelled flight, or other reasons) If any portion of the flight has already been flown, the agent cannot help and transfer is needed. Otherwise, flight can be cancelled if any of the following is true: - The booking was made within the last 24 hrs - The flight is cancelled by airline - It is a business flight - The user has travel insurance and the reason for cancellation is covered by insurance. The API does not check that cancellation rules are met, so the agent must make sure the rules apply before calling the API! Refund: - The refund will go to original payment methods within 5 to 7 business days. ## Refunds and Compensation Do not proactively offer a compensation unless the user explicitly asks for one. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. Always confirms the facts before offering compensation. Only compensate if the user is a silver/gold member or has travel insurance or flies business. - If the user complains about cancelled flights in a reservation, the agent can offer a certificate as a gesture after confirming the facts, with the amount being $100 times the number of passengers. - If the user complains about delayed flights in a reservation and wants to change or cancel the reservation, the agent can offer a certificate as a gesture after confirming the facts and changing or cancelling the reservation, with the amount being $50 times the number of passengers. Do not offer compensation for any other reason than the ones listed above. </policy> # Tools You may call one or more functions to assist with the user query. You are provided with function signatures within <tools></tools> XML tags: <tools> {"type": "function", "function": {"name": "book_reservation", "description": "Book a reservation.", "parameters": {"$defs": {"FlightInfo": {"properties": {"flight_number": {"description": "Flight number, such as 'HAT001'.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "FlightInfo", "type": "object"}, "Passenger": {"properties": {"first_name": {"description": "Passenger's first name", "title": "First Name", "type": "string"}, "last_name": {"description": "Passenger's last name", "title": "Last Name", "type": "string"}, "dob": {"description": "Date of birth in YYYY-MM-DD format", "title": "Dob", "type": "string"}}, "required": ["first_name", "last_name", "dob"], "title": "Passenger", "type": "object"}, "Payment": {"properties": {"payment_id": {"description": "Unique identifier for the payment", "title": "Payment Id", "type": "string"}, "amount": {"description": "Payment amount in dollars", "title": "Amount", "type": "integer"}}, "required": ["payment_id", "amount"], "title": "Payment", "type": "object"}}, "properties": {"user_id": {"description": "The ID of the user to book the reservation such as 'sara_doe_496'`.", "title": "User Id", "type": "string"}, "origin": {"description": "The IATA code for the origin city such as 'SFO'.", "title": "Origin", "type": "string"}, "destination": {"description": "The IATA code for the destination city such as 'JFK'.", "title": "Destination", "type": "string"}, "flight_type": {"description": "The type of flight such as 'one_way' or 'round_trip'.", "enum": ["round_trip", "one_way"], "title": "Flight Type", "type": "string"}, "cabin": {"description": "The cabin class such as 'basic_economy', 'economy', or 'business'.", "enum": ["business", "economy", "basic_economy"], "title": "Cabin", "type": "string"}, "flights": {"description": "An array of objects containing details about each piece of flight.", "items": {"anyOf": [{"$ref": "#/$defs/FlightInfo"}, {"additionalProperties": true, "type": "object"}]}, "title": "Flights", "type": "array"}, "passengers": {"description": "An array of objects containing details about each passenger.", "items": {"anyOf": [{"$ref": "#/$defs/Passenger"}, {"additionalProperties": true, "type": "object"}]}, "title": "Passengers", "type": "array"}, "payment_methods": {"description": "An array of objects containing details about each payment method.", "items": {"anyOf": [{"$ref": "#/$defs/Payment"}, {"additionalProperties": true, "type": "object"}]}, "title": "Payment Methods", "type": "array"}, "total_baggages": {"description": "The total number of baggage items to book the reservation.", "title": "Total Baggages", "type": "integer"}, "nonfree_baggages": {"description": "The number of non-free baggage items to book the reservation.", "title": "Nonfree Baggages", "type": "integer"}, "insurance": {"description": "Whether the reservation has insurance.", "enum": ["yes", "no"], "title": "Insurance", "type": "string"}}, "required": ["user_id", "origin", "destination", "flight_type", "cabin", "flights", "passengers", "payment_methods", "total_baggages", "nonfree_baggages", "insurance"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "calculate", "description": "Calculate the result of a mathematical expression.", "parameters": {"properties": {"expression": {"description": "The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.", "title": "Expression", "type": "string"}}, "required": ["expression"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "cancel_reservation", "description": "Cancel the whole reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}}, "required": ["reservation_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_reservation_details", "description": "Get the details of a reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as '8JX2WO'.", "title": "Reservation Id", "type": "string"}}, "required": ["reservation_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_user_details", "description": "Get the details of a user, including their reservations.", "parameters": {"properties": {"user_id": {"description": "The user ID, such as 'sara_doe_496'.", "title": "User Id", "type": "string"}}, "required": ["user_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "list_all_airports", "description": "Returns a list of all available airports.", "parameters": {"properties": {}, "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "search_direct_flight", "description": "Search for direct flights between two cities on a specific date.", "parameters": {"properties": {"origin": {"description": "The origin city airport in three letters, such as 'JFK'.", "title": "Origin", "type": "string"}, "destination": {"description": "The destination city airport in three letters, such as 'LAX'.", "title": "Destination", "type": "string"}, "date": {"description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.", "title": "Date", "type": "string"}}, "required": ["origin", "destination", "date"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "search_onestop_flight", "description": "Search for one-stop flights between two cities on a specific date.", "parameters": {"properties": {"origin": {"description": "The origin city airport in three letters, such as 'JFK'.", "title": "Origin", "type": "string"}, "destination": {"description": "The destination city airport in three letters, such as 'LAX'.", "title": "Destination", "type": "string"}, "date": {"description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["origin", "destination", "date"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "send_certificate", "description": "Send a certificate to a user. Be careful!", "parameters": {"properties": {"user_id": {"description": "The ID of the user to book the reservation, such as 'sara_doe_496'.", "title": "User Id", "type": "string"}, "amount": {"description": "The amount of the certificate to send.", "title": "Amount", "type": "integer"}}, "required": ["user_id", "amount"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "transfer_to_human_agents", "description": "Transfer the user to a human agent, with a summary of the user's issue.\n\nOnly transfer if\n - the user explicitly asks for a human agent\n - given the policy and the available tools, you cannot solve the user's issue.", "parameters": {"properties": {"summary": {"description": "A summary of the user's issue.", "title": "Summary", "type": "string"}}, "required": ["summary"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_baggages", "description": "Update the baggage information of a reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'", "title": "Reservation Id", "type": "string"}, "total_baggages": {"description": "The updated total number of baggage items included in the reservation.", "title": "Total Baggages", "type": "integer"}, "nonfree_baggages": {"description": "The updated number of non-free baggage items included in the reservation.", "title": "Nonfree Baggages", "type": "integer"}, "payment_id": {"description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.", "title": "Payment Id", "type": "string"}}, "required": ["reservation_id", "total_baggages", "nonfree_baggages", "payment_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_flights", "description": "Update the flight information of a reservation.", "parameters": {"$defs": {"FlightInfo": {"properties": {"flight_number": {"description": "Flight number, such as 'HAT001'.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "FlightInfo", "type": "object"}}, "properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}, "cabin": {"description": "The cabin class of the reservation", "enum": ["business", "economy", "basic_economy"], "title": "Cabin", "type": "string"}, "flights": {"description": "An array of objects containing details about each piece of flight in the ENTIRE new reservation. Even if the a flight segment is not changed, it should still be included in the array.", "items": {"anyOf": [{"$ref": "#/$defs/FlightInfo"}, {"additionalProperties": true, "type": "object"}]}, "title": "Flights", "type": "array"}, "payment_id": {"description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.", "title": "Payment Id", "type": "string"}}, "required": ["reservation_id", "cabin", "flights", "payment_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_passengers", "description": "Update the passenger information of a reservation.", "parameters": {"$defs": {"Passenger": {"properties": {"first_name": {"description": "Passenger's first name", "title": "First Name", "type": "string"}, "last_name": {"description": "Passenger's last name", "title": "Last Name", "type": "string"}, "dob": {"description": "Date of birth in YYYY-MM-DD format", "title": "Dob", "type": "string"}}, "required": ["first_name", "last_name", "dob"], "title": "Passenger", "type": "object"}}, "properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}, "passengers": {"description": "An array of objects containing details about each passenger.", "items": {"anyOf": [{"$ref": "#/$defs/Passenger"}, {"additionalProperties": true, "type": "object"}]}, "title": "Passengers", "type": "array"}}, "required": ["reservation_id", "passengers"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_flight_status", "description": "Get the status of a flight.", "parameters": {"properties": {"flight_number": {"description": "The flight number.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date of the flight.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "parameters", "type": "object"}}} </tools> For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags: <tool_call> {"name": <function-name>, "arguments": <args-json-object>} </tool_call>
[{"name":"book_reservation","description":"Book a reservation.","parameters":{"$defs":{"FlightInfo":{"properties":{"flight_number":{"description":"Flight number, such as 'HAT001'.","title":"Flight Number","type":"string"},"date":{"description":"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"FlightInfo","type":"object"},"Passenger":{"properties":{"first_name":{"description":"Passenger's first name","title":"First Name","type":"string"},"last_name":{"description":"Passenger's last name","title":"Last Name","type":"string"},"dob":{"description":"Date of birth in YYYY-MM-DD format","title":"Dob","type":"string"}},"required":["first_name","last_name","dob"],"title":"Passenger","type":"object"},"Payment":{"properties":{"payment_id":{"description":"Unique identifier for the payment","title":"Payment Id","type":"string"},"amount":{"description":"Payment amount in dollars","title":"Amount","type":"integer"}},"required":["payment_id","amount"],"title":"Payment","type":"object"}},"properties":{"user_id":{"description":"The ID of the user to book the reservation such as 'sara_doe_496'`.","title":"User Id","type":"string"},"origin":{"description":"The IATA code for the origin city such as 'SFO'.","title":"Origin","type":"string"},"destination":{"description":"The IATA code for the destination city such as 'JFK'.","title":"Destination","type":"string"},"flight_type":{"description":"The type of flight such as 'one_way' or 'round_trip'.","enum":["round_trip","one_way"],"title":"Flight Type","type":"string"},"cabin":{"description":"The cabin class such as 'basic_economy', 'economy', or 'business'.","enum":["business","economy","basic_economy"],"title":"Cabin","type":"string"},"flights":{"description":"An array of objects containing details about each piece of flight.","items":{"anyOf":[{"$ref":"#/$defs/FlightInfo"},{"additionalProperties":true,"type":"object"}]},"title":"Flights","type":"array"},"passengers":{"description":"An array of objects containing details about each passenger.","items":{"anyOf":[{"$ref":"#/$defs/Passenger"},{"additionalProperties":true,"type":"object"}]},"title":"Passengers","type":"array"},"payment_methods":{"description":"An array of objects containing details about each payment method.","items":{"anyOf":[{"$ref":"#/$defs/Payment"},{"additionalProperties":true,"type":"object"}]},"title":"Payment Methods","type":"array"},"total_baggages":{"description":"The total number of baggage items to book the reservation.","title":"Total Baggages","type":"integer"},"nonfree_baggages":{"description":"The number of non-free baggage items to book the reservation.","title":"Nonfree Baggages","type":"integer"},"insurance":{"description":"Whether the reservation has insurance.","enum":["yes","no"],"title":"Insurance","type":"string"}},"required":["user_id","origin","destination","flight_type","cabin","flights","passengers","payment_methods","total_baggages","nonfree_baggages","insurance"],"title":"parameters","type":"object"}},{"name":"calculate","description":"Calculate the result of a mathematical expression.","parameters":{"properties":{"expression":{"description":"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.","title":"Expression","type":"string"}},"required":["expression"],"title":"parameters","type":"object"}},{"name":"cancel_reservation","description":"Cancel the whole reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"}},"required":["reservation_id"],"title":"parameters","type":"object"}},{"name":"get_reservation_details","description":"Get the details of a reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as '8JX2WO'.","title":"Reservation Id","type":"string"}},"required":["reservation_id"],"title":"parameters","type":"object"}},{"name":"get_user_details","description":"Get the details of a user, including their reservations.","parameters":{"properties":{"user_id":{"description":"The user ID, such as 'sara_doe_496'.","title":"User Id","type":"string"}},"required":["user_id"],"title":"parameters","type":"object"}},{"name":"list_all_airports","description":"Returns a list of all available airports.","parameters":{"properties":{},"title":"parameters","type":"object"}},{"name":"search_direct_flight","description":"Search for direct flights between two cities on a specific date.","parameters":{"properties":{"origin":{"description":"The origin city airport in three letters, such as 'JFK'.","title":"Origin","type":"string"},"destination":{"description":"The destination city airport in three letters, such as 'LAX'.","title":"Destination","type":"string"},"date":{"description":"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.","title":"Date","type":"string"}},"required":["origin","destination","date"],"title":"parameters","type":"object"}},{"name":"search_onestop_flight","description":"Search for one-stop flights between two cities on a specific date.","parameters":{"properties":{"origin":{"description":"The origin city airport in three letters, such as 'JFK'.","title":"Origin","type":"string"},"destination":{"description":"The destination city airport in three letters, such as 'LAX'.","title":"Destination","type":"string"},"date":{"description":"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["origin","destination","date"],"title":"parameters","type":"object"}},{"name":"send_certificate","description":"Send a certificate to a user. Be careful!","parameters":{"properties":{"user_id":{"description":"The ID of the user to book the reservation, such as 'sara_doe_496'.","title":"User Id","type":"string"},"amount":{"description":"The amount of the certificate to send.","title":"Amount","type":"integer"}},"required":["user_id","amount"],"title":"parameters","type":"object"}},{"name":"transfer_to_human_agents","description":"Transfer the user to a human agent, with a summary of the user's issue.\n\nOnly transfer if\n - the user explicitly asks for a human agent\n - given the policy and the available tools, you cannot solve the user's issue.","parameters":{"properties":{"summary":{"description":"A summary of the user's issue.","title":"Summary","type":"string"}},"required":["summary"],"title":"parameters","type":"object"}},{"name":"update_reservation_baggages","description":"Update the baggage information of a reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'","title":"Reservation Id","type":"string"},"total_baggages":{"description":"The updated total number of baggage items included in the reservation.","title":"Total Baggages","type":"integer"},"nonfree_baggages":{"description":"The updated number of non-free baggage items included in the reservation.","title":"Nonfree Baggages","type":"integer"},"payment_id":{"description":"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.","title":"Payment Id","type":"string"}},"required":["reservation_id","total_baggages","nonfree_baggages","payment_id"],"title":"parameters","type":"object"}},{"name":"update_reservation_flights","description":"Update the flight information of a reservation.","parameters":{"$defs":{"FlightInfo":{"properties":{"flight_number":{"description":"Flight number, such as 'HAT001'.","title":"Flight Number","type":"string"},"date":{"description":"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"FlightInfo","type":"object"}},"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"},"cabin":{"description":"The cabin class of the reservation","enum":["business","economy","basic_economy"],"title":"Cabin","type":"string"},"flights":{"description":"An array of objects containing details about each piece of flight in the ENTIRE new reservation. Even if the a flight segment is not changed, it should still be included in the array.","items":{"anyOf":[{"$ref":"#/$defs/FlightInfo"},{"additionalProperties":true,"type":"object"}]},"title":"Flights","type":"array"},"payment_id":{"description":"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.","title":"Payment Id","type":"string"}},"required":["reservation_id","cabin","flights","payment_id"],"title":"parameters","type":"object"}},{"name":"update_reservation_passengers","description":"Update the passenger information of a reservation.","parameters":{"$defs":{"Passenger":{"properties":{"first_name":{"description":"Passenger's first name","title":"First Name","type":"string"},"last_name":{"description":"Passenger's last name","title":"Last Name","type":"string"},"dob":{"description":"Date of birth in YYYY-MM-DD format","title":"Dob","type":"string"}},"required":["first_name","last_name","dob"],"title":"Passenger","type":"object"}},"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"},"passengers":{"description":"An array of objects containing details about each passenger.","items":{"anyOf":[{"$ref":"#/$defs/Passenger"},{"additionalProperties":true,"type":"object"}]},"title":"Passengers","type":"array"}},"required":["reservation_id","passengers"],"title":"parameters","type":"object"}},{"name":"get_flight_status","description":"Get the status of a flight.","parameters":{"properties":{"flight_number":{"description":"The flight number.","title":"Flight Number","type":"string"},"date":{"description":"The date of the flight.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"parameters","type":"object"}}]
apigen_general_8027540239085499302
5
5
general
Hi, I booked a round-trip for Daniel Kim (user id daniel_kim_774) from JFK to SFO, departing June 10 and returning June 17 in economy. Due to a meeting change, I need to modify the destination to LAX for both legs but keep the same dates. Can you change it?
[ { "from": "human", "value": "Hi, I flew from Boston to Chicago this morning. We sat on the tarmac for almost two hours before takeoff and I missed an important meeting. Can I get any compensation for this? I’d really prefer to speak with a human agent about it." }, { "from": "gpt", "value": "I can help check what options may apply. As a heads-up, compensation is generally only offered for cancelled or delayed flights under specific conditions. Could you confirm:\n- Was your flight officially recorded as delayed, and is that the reason you’re seeking compensation?\n- Did you change or cancel your reservation due to the delay?\n- What cabin did you fly (basic economy, economy, or business)?\n- What’s your membership level and do you have travel insurance on this reservation?\nIf you still prefer a human agent after we confirm these details, I can transfer you." }, { "from": "human", "value": "Yes, it was officially delayed. I didn’t change or cancel anything. I flew economy, I’m a regular member, and I didn’t buy insurance. I still want to talk to a human agent." }, { "from": "gpt", "value": "You’ve explicitly requested to speak with a human agent, and based on what you shared this doesn’t meet our compensation triggers. I will call the function transfer_to_human_agents.\n<tool_call>\n{\"name\": \"transfer_to_human_agents\", \"arguments\": {\"summary\": \"User flew BOS to CHI this morning; tarmac delay of ~2 hours before takeoff. User is a regular member, flew economy, no travel insurance, did not change or cancel the reservation. They are requesting compensation and explicitly prefer to speak with a human agent.\"}}\n</tool_call>" }, { "from": "human", "value": "Transfer successful" } ]
<instructions> You are a customer service agent that helps the user according to the <policy> provided below. In each turn you can either: - Send a message to the user. - Make a tool call. You cannot do both at the same time. Try to be helpful and always follow the policy. Always make sure you generate valid JSON only. </instructions> <policy> # Airline Agent Policy The current time is 2024-05-15 15:00:00 EST. As an airline agent, you can help users **book**, **modify**, or **cancel** flight reservations. You also handle **refunds and compensation**. Before taking any actions that update the booking database (booking, modifying flights, editing baggage, changing cabin class, or updating passenger information), you must list the action details and obtain explicit user confirmation (yes) to proceed. You should not provide any information, knowledge, or procedures not provided by the user or available tools, or give subjective recommendations or comments. You should only make one tool call at a time, and if you make a tool call, you should not respond to the user simultaneously. If you respond to the user, you should not make a tool call at the same time. You should deny user requests that are against this policy. You should transfer the user to a human agent if and only if the request cannot be handled within the scope of your actions. To transfer, first make a tool call to transfer_to_human_agents, and then send the message 'YOU ARE BEING TRANSFERRED TO A HUMAN AGENT. PLEASE HOLD ON.' to the user. ## Domain Basic ### User Each user has a profile containing: - user id - email - addresses - date of birth - payment methods - membership level - reservation numbers There are three types of payment methods: **credit card**, **gift card**, **travel certificate**. There are three membership levels: **regular**, **silver**, **gold**. ### Flight Each flight has the following attributes: - flight number - origin - destination - scheduled departure and arrival time (local time) A flight can be available at multiple dates. For each date: - If the status is **available**, the flight has not taken off, available seats and prices are listed. - If the status is **delayed** or **on time**, the flight has not taken off, cannot be booked. - If the status is **flying**, the flight has taken off but not landed, cannot be booked. There are three cabin classes: **basic economy**, **economy**, **business**. **basic economy** is its own class, completely distinct from **economy**. Seat availability and prices are listed for each cabin class. ### Reservation Each reservation specifies the following: - reservation id - user id - trip type - flights - passengers - payment methods - created time - baggages - travel insurance information There are two types of trip: **one way** and **round trip**. ## Book flight The agent must first obtain the user id from the user. The agent should then ask for the trip type, origin, destination. Cabin: - Cabin class must be the same across all the flights in a reservation. Passengers: - Each reservation can have at most five passengers. - The agent needs to collect the first name, last name, and date of birth for each passenger. - All passengers must fly the same flights in the same cabin. Payment: - Each reservation can use at most one travel certificate, at most one credit card, and at most three gift cards. - The remaining amount of a travel certificate is not refundable. - All payment methods must already be in user profile for safety reasons. Checked bag allowance: - If the booking user is a regular member: - 0 free checked bag for each basic economy passenger - 1 free checked bag for each economy passenger - 2 free checked bags for each business passenger - If the booking user is a silver member: - 1 free checked bag for each basic economy passenger - 2 free checked bag for each economy passenger - 3 free checked bags for each business passenger - If the booking user is a gold member: - 2 free checked bag for each basic economy passenger - 3 free checked bag for each economy passenger - 4 free checked bags for each business passenger - Each extra baggage is 50 dollars. Do not add checked bags that the user does not need. Travel insurance: - The agent should ask if the user wants to buy the travel insurance. - The travel insurance is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight First, the agent must obtain the user id and reservation id. - The user must provide their user id. - If the user doesn't know their reservation id, the agent should help locate it using available tools. Change flights: - Basic economy flights cannot be modified. - Other reservations can be modified without changing the origin, destination, and trip type. - Some flight segments can be kept, but their prices will not be updated based on the current price. - The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! Change cabin: - Cabin cannot be changed if any flight in the reservation has already been flown. - In other cases, all reservations, including basic economy, can change cabin without changing the flights. - Cabin class must remain the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - If the price after cabin change is higher than the original price, the user is required to pay for the difference. - If the price after cabin change is lower than the original price, the user is should be refunded the difference. Change baggage and insurance: - The user can add but not remove checked bags. - The user cannot add insurance after initial booking. Change passengers: - The user can modify passengers but cannot modify the number of passengers. - Even a human agent cannot modify the number of passengers. Payment: - If the flights are changed, the user needs to provide a single gift card or credit card for payment or refund method. The payment method must already be in user profile for safety reasons. ## Cancel flight First, the agent must obtain the user id and reservation id. - The user must provide their user id. - If the user doesn't know their reservation id, the agent should help locate it using available tools. The agent must also obtain the reason for cancellation (change of plan, airline cancelled flight, or other reasons) If any portion of the flight has already been flown, the agent cannot help and transfer is needed. Otherwise, flight can be cancelled if any of the following is true: - The booking was made within the last 24 hrs - The flight is cancelled by airline - It is a business flight - The user has travel insurance and the reason for cancellation is covered by insurance. The API does not check that cancellation rules are met, so the agent must make sure the rules apply before calling the API! Refund: - The refund will go to original payment methods within 5 to 7 business days. ## Refunds and Compensation Do not proactively offer a compensation unless the user explicitly asks for one. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. Always confirms the facts before offering compensation. Only compensate if the user is a silver/gold member or has travel insurance or flies business. - If the user complains about cancelled flights in a reservation, the agent can offer a certificate as a gesture after confirming the facts, with the amount being $100 times the number of passengers. - If the user complains about delayed flights in a reservation and wants to change or cancel the reservation, the agent can offer a certificate as a gesture after confirming the facts and changing or cancelling the reservation, with the amount being $50 times the number of passengers. Do not offer compensation for any other reason than the ones listed above. </policy> # Tools You may call one or more functions to assist with the user query. You are provided with function signatures within <tools></tools> XML tags: <tools> {"type": "function", "function": {"name": "book_reservation", "description": "Book a reservation.", "parameters": {"$defs": {"FlightInfo": {"properties": {"flight_number": {"description": "Flight number, such as 'HAT001'.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "FlightInfo", "type": "object"}, "Passenger": {"properties": {"first_name": {"description": "Passenger's first name", "title": "First Name", "type": "string"}, "last_name": {"description": "Passenger's last name", "title": "Last Name", "type": "string"}, "dob": {"description": "Date of birth in YYYY-MM-DD format", "title": "Dob", "type": "string"}}, "required": ["first_name", "last_name", "dob"], "title": "Passenger", "type": "object"}, "Payment": {"properties": {"payment_id": {"description": "Unique identifier for the payment", "title": "Payment Id", "type": "string"}, "amount": {"description": "Payment amount in dollars", "title": "Amount", "type": "integer"}}, "required": ["payment_id", "amount"], "title": "Payment", "type": "object"}}, "properties": {"user_id": {"description": "The ID of the user to book the reservation such as 'sara_doe_496'`.", "title": "User Id", "type": "string"}, "origin": {"description": "The IATA code for the origin city such as 'SFO'.", "title": "Origin", "type": "string"}, "destination": {"description": "The IATA code for the destination city such as 'JFK'.", "title": "Destination", "type": "string"}, "flight_type": {"description": "The type of flight such as 'one_way' or 'round_trip'.", "enum": ["round_trip", "one_way"], "title": "Flight Type", "type": "string"}, "cabin": {"description": "The cabin class such as 'basic_economy', 'economy', or 'business'.", "enum": ["business", "economy", "basic_economy"], "title": "Cabin", "type": "string"}, "flights": {"description": "An array of objects containing details about each piece of flight.", "items": {"anyOf": [{"$ref": "#/$defs/FlightInfo"}, {"additionalProperties": true, "type": "object"}]}, "title": "Flights", "type": "array"}, "passengers": {"description": "An array of objects containing details about each passenger.", "items": {"anyOf": [{"$ref": "#/$defs/Passenger"}, {"additionalProperties": true, "type": "object"}]}, "title": "Passengers", "type": "array"}, "payment_methods": {"description": "An array of objects containing details about each payment method.", "items": {"anyOf": [{"$ref": "#/$defs/Payment"}, {"additionalProperties": true, "type": "object"}]}, "title": "Payment Methods", "type": "array"}, "total_baggages": {"description": "The total number of baggage items to book the reservation.", "title": "Total Baggages", "type": "integer"}, "nonfree_baggages": {"description": "The number of non-free baggage items to book the reservation.", "title": "Nonfree Baggages", "type": "integer"}, "insurance": {"description": "Whether the reservation has insurance.", "enum": ["yes", "no"], "title": "Insurance", "type": "string"}}, "required": ["user_id", "origin", "destination", "flight_type", "cabin", "flights", "passengers", "payment_methods", "total_baggages", "nonfree_baggages", "insurance"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "calculate", "description": "Calculate the result of a mathematical expression.", "parameters": {"properties": {"expression": {"description": "The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.", "title": "Expression", "type": "string"}}, "required": ["expression"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "cancel_reservation", "description": "Cancel the whole reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}}, "required": ["reservation_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_reservation_details", "description": "Get the details of a reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as '8JX2WO'.", "title": "Reservation Id", "type": "string"}}, "required": ["reservation_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_user_details", "description": "Get the details of a user, including their reservations.", "parameters": {"properties": {"user_id": {"description": "The user ID, such as 'sara_doe_496'.", "title": "User Id", "type": "string"}}, "required": ["user_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "list_all_airports", "description": "Returns a list of all available airports.", "parameters": {"properties": {}, "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "search_direct_flight", "description": "Search for direct flights between two cities on a specific date.", "parameters": {"properties": {"origin": {"description": "The origin city airport in three letters, such as 'JFK'.", "title": "Origin", "type": "string"}, "destination": {"description": "The destination city airport in three letters, such as 'LAX'.", "title": "Destination", "type": "string"}, "date": {"description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.", "title": "Date", "type": "string"}}, "required": ["origin", "destination", "date"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "search_onestop_flight", "description": "Search for one-stop flights between two cities on a specific date.", "parameters": {"properties": {"origin": {"description": "The origin city airport in three letters, such as 'JFK'.", "title": "Origin", "type": "string"}, "destination": {"description": "The destination city airport in three letters, such as 'LAX'.", "title": "Destination", "type": "string"}, "date": {"description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["origin", "destination", "date"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "send_certificate", "description": "Send a certificate to a user. Be careful!", "parameters": {"properties": {"user_id": {"description": "The ID of the user to book the reservation, such as 'sara_doe_496'.", "title": "User Id", "type": "string"}, "amount": {"description": "The amount of the certificate to send.", "title": "Amount", "type": "integer"}}, "required": ["user_id", "amount"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "transfer_to_human_agents", "description": "Transfer the user to a human agent, with a summary of the user's issue.\n\nOnly transfer if\n - the user explicitly asks for a human agent\n - given the policy and the available tools, you cannot solve the user's issue.", "parameters": {"properties": {"summary": {"description": "A summary of the user's issue.", "title": "Summary", "type": "string"}}, "required": ["summary"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_baggages", "description": "Update the baggage information of a reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'", "title": "Reservation Id", "type": "string"}, "total_baggages": {"description": "The updated total number of baggage items included in the reservation.", "title": "Total Baggages", "type": "integer"}, "nonfree_baggages": {"description": "The updated number of non-free baggage items included in the reservation.", "title": "Nonfree Baggages", "type": "integer"}, "payment_id": {"description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.", "title": "Payment Id", "type": "string"}}, "required": ["reservation_id", "total_baggages", "nonfree_baggages", "payment_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_flights", "description": "Update the flight information of a reservation.", "parameters": {"$defs": {"FlightInfo": {"properties": {"flight_number": {"description": "Flight number, such as 'HAT001'.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "FlightInfo", "type": "object"}}, "properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}, "cabin": {"description": "The cabin class of the reservation", "enum": ["business", "economy", "basic_economy"], "title": "Cabin", "type": "string"}, "flights": {"description": "An array of objects containing details about each piece of flight in the ENTIRE new reservation. Even if the a flight segment is not changed, it should still be included in the array.", "items": {"anyOf": [{"$ref": "#/$defs/FlightInfo"}, {"additionalProperties": true, "type": "object"}]}, "title": "Flights", "type": "array"}, "payment_id": {"description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.", "title": "Payment Id", "type": "string"}}, "required": ["reservation_id", "cabin", "flights", "payment_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_passengers", "description": "Update the passenger information of a reservation.", "parameters": {"$defs": {"Passenger": {"properties": {"first_name": {"description": "Passenger's first name", "title": "First Name", "type": "string"}, "last_name": {"description": "Passenger's last name", "title": "Last Name", "type": "string"}, "dob": {"description": "Date of birth in YYYY-MM-DD format", "title": "Dob", "type": "string"}}, "required": ["first_name", "last_name", "dob"], "title": "Passenger", "type": "object"}}, "properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}, "passengers": {"description": "An array of objects containing details about each passenger.", "items": {"anyOf": [{"$ref": "#/$defs/Passenger"}, {"additionalProperties": true, "type": "object"}]}, "title": "Passengers", "type": "array"}}, "required": ["reservation_id", "passengers"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_flight_status", "description": "Get the status of a flight.", "parameters": {"properties": {"flight_number": {"description": "The flight number.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date of the flight.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "parameters", "type": "object"}}} </tools> For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags: <tool_call> {"name": <function-name>, "arguments": <args-json-object>} </tool_call>
[{"name":"book_reservation","description":"Book a reservation.","parameters":{"$defs":{"FlightInfo":{"properties":{"flight_number":{"description":"Flight number, such as 'HAT001'.","title":"Flight Number","type":"string"},"date":{"description":"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"FlightInfo","type":"object"},"Passenger":{"properties":{"first_name":{"description":"Passenger's first name","title":"First Name","type":"string"},"last_name":{"description":"Passenger's last name","title":"Last Name","type":"string"},"dob":{"description":"Date of birth in YYYY-MM-DD format","title":"Dob","type":"string"}},"required":["first_name","last_name","dob"],"title":"Passenger","type":"object"},"Payment":{"properties":{"payment_id":{"description":"Unique identifier for the payment","title":"Payment Id","type":"string"},"amount":{"description":"Payment amount in dollars","title":"Amount","type":"integer"}},"required":["payment_id","amount"],"title":"Payment","type":"object"}},"properties":{"user_id":{"description":"The ID of the user to book the reservation such as 'sara_doe_496'`.","title":"User Id","type":"string"},"origin":{"description":"The IATA code for the origin city such as 'SFO'.","title":"Origin","type":"string"},"destination":{"description":"The IATA code for the destination city such as 'JFK'.","title":"Destination","type":"string"},"flight_type":{"description":"The type of flight such as 'one_way' or 'round_trip'.","enum":["round_trip","one_way"],"title":"Flight Type","type":"string"},"cabin":{"description":"The cabin class such as 'basic_economy', 'economy', or 'business'.","enum":["business","economy","basic_economy"],"title":"Cabin","type":"string"},"flights":{"description":"An array of objects containing details about each piece of flight.","items":{"anyOf":[{"$ref":"#/$defs/FlightInfo"},{"additionalProperties":true,"type":"object"}]},"title":"Flights","type":"array"},"passengers":{"description":"An array of objects containing details about each passenger.","items":{"anyOf":[{"$ref":"#/$defs/Passenger"},{"additionalProperties":true,"type":"object"}]},"title":"Passengers","type":"array"},"payment_methods":{"description":"An array of objects containing details about each payment method.","items":{"anyOf":[{"$ref":"#/$defs/Payment"},{"additionalProperties":true,"type":"object"}]},"title":"Payment Methods","type":"array"},"total_baggages":{"description":"The total number of baggage items to book the reservation.","title":"Total Baggages","type":"integer"},"nonfree_baggages":{"description":"The number of non-free baggage items to book the reservation.","title":"Nonfree Baggages","type":"integer"},"insurance":{"description":"Whether the reservation has insurance.","enum":["yes","no"],"title":"Insurance","type":"string"}},"required":["user_id","origin","destination","flight_type","cabin","flights","passengers","payment_methods","total_baggages","nonfree_baggages","insurance"],"title":"parameters","type":"object"}},{"name":"calculate","description":"Calculate the result of a mathematical expression.","parameters":{"properties":{"expression":{"description":"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.","title":"Expression","type":"string"}},"required":["expression"],"title":"parameters","type":"object"}},{"name":"cancel_reservation","description":"Cancel the whole reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"}},"required":["reservation_id"],"title":"parameters","type":"object"}},{"name":"get_reservation_details","description":"Get the details of a reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as '8JX2WO'.","title":"Reservation Id","type":"string"}},"required":["reservation_id"],"title":"parameters","type":"object"}},{"name":"get_user_details","description":"Get the details of a user, including their reservations.","parameters":{"properties":{"user_id":{"description":"The user ID, such as 'sara_doe_496'.","title":"User Id","type":"string"}},"required":["user_id"],"title":"parameters","type":"object"}},{"name":"list_all_airports","description":"Returns a list of all available airports.","parameters":{"properties":{},"title":"parameters","type":"object"}},{"name":"search_direct_flight","description":"Search for direct flights between two cities on a specific date.","parameters":{"properties":{"origin":{"description":"The origin city airport in three letters, such as 'JFK'.","title":"Origin","type":"string"},"destination":{"description":"The destination city airport in three letters, such as 'LAX'.","title":"Destination","type":"string"},"date":{"description":"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.","title":"Date","type":"string"}},"required":["origin","destination","date"],"title":"parameters","type":"object"}},{"name":"search_onestop_flight","description":"Search for one-stop flights between two cities on a specific date.","parameters":{"properties":{"origin":{"description":"The origin city airport in three letters, such as 'JFK'.","title":"Origin","type":"string"},"destination":{"description":"The destination city airport in three letters, such as 'LAX'.","title":"Destination","type":"string"},"date":{"description":"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["origin","destination","date"],"title":"parameters","type":"object"}},{"name":"send_certificate","description":"Send a certificate to a user. Be careful!","parameters":{"properties":{"user_id":{"description":"The ID of the user to book the reservation, such as 'sara_doe_496'.","title":"User Id","type":"string"},"amount":{"description":"The amount of the certificate to send.","title":"Amount","type":"integer"}},"required":["user_id","amount"],"title":"parameters","type":"object"}},{"name":"transfer_to_human_agents","description":"Transfer the user to a human agent, with a summary of the user's issue.\n\nOnly transfer if\n - the user explicitly asks for a human agent\n - given the policy and the available tools, you cannot solve the user's issue.","parameters":{"properties":{"summary":{"description":"A summary of the user's issue.","title":"Summary","type":"string"}},"required":["summary"],"title":"parameters","type":"object"}},{"name":"update_reservation_baggages","description":"Update the baggage information of a reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'","title":"Reservation Id","type":"string"},"total_baggages":{"description":"The updated total number of baggage items included in the reservation.","title":"Total Baggages","type":"integer"},"nonfree_baggages":{"description":"The updated number of non-free baggage items included in the reservation.","title":"Nonfree Baggages","type":"integer"},"payment_id":{"description":"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.","title":"Payment Id","type":"string"}},"required":["reservation_id","total_baggages","nonfree_baggages","payment_id"],"title":"parameters","type":"object"}},{"name":"update_reservation_flights","description":"Update the flight information of a reservation.","parameters":{"$defs":{"FlightInfo":{"properties":{"flight_number":{"description":"Flight number, such as 'HAT001'.","title":"Flight Number","type":"string"},"date":{"description":"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"FlightInfo","type":"object"}},"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"},"cabin":{"description":"The cabin class of the reservation","enum":["business","economy","basic_economy"],"title":"Cabin","type":"string"},"flights":{"description":"An array of objects containing details about each piece of flight in the ENTIRE new reservation. Even if the a flight segment is not changed, it should still be included in the array.","items":{"anyOf":[{"$ref":"#/$defs/FlightInfo"},{"additionalProperties":true,"type":"object"}]},"title":"Flights","type":"array"},"payment_id":{"description":"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.","title":"Payment Id","type":"string"}},"required":["reservation_id","cabin","flights","payment_id"],"title":"parameters","type":"object"}},{"name":"update_reservation_passengers","description":"Update the passenger information of a reservation.","parameters":{"$defs":{"Passenger":{"properties":{"first_name":{"description":"Passenger's first name","title":"First Name","type":"string"},"last_name":{"description":"Passenger's last name","title":"Last Name","type":"string"},"dob":{"description":"Date of birth in YYYY-MM-DD format","title":"Dob","type":"string"}},"required":["first_name","last_name","dob"],"title":"Passenger","type":"object"}},"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"},"passengers":{"description":"An array of objects containing details about each passenger.","items":{"anyOf":[{"$ref":"#/$defs/Passenger"},{"additionalProperties":true,"type":"object"}]},"title":"Passengers","type":"array"}},"required":["reservation_id","passengers"],"title":"parameters","type":"object"}},{"name":"get_flight_status","description":"Get the status of a flight.","parameters":{"properties":{"flight_number":{"description":"The flight number.","title":"Flight Number","type":"string"},"date":{"description":"The date of the flight.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"parameters","type":"object"}}]
apigen_general_-1922238952275208628
5
5
general
Hi, I flew from Seattle to Denver yesterday on a basic economy ticket. The gate agent moved me to an exit row due to my height. Are there any refunds or credits I can get for this? I’d really prefer to speak with a human agent about it if possible.
[ { "from": "human", "value": "Hi, I need to fix a typo in my name on reservation H9Q72B. It’s a round trip JFK–MIA in economy. My last name should be Johnson, but it shows as Jonhson. Can you correct it?" }, { "from": "gpt", "value": "I need to fetch your reservation details to verify the current passenger name, confirm the number of passengers, and ensure no segment has been flown yet before proceeding. I will call the function get_reservation_details.\n<tool_call>\n{\"name\": \"get_reservation_details\", \"arguments\": {\"reservation_id\": \"H9Q72B\"}}\n</tool_call>" }, { "from": "human", "value": "{\"reservation_id\": \"H9Q72B\", \"user_id\": \"james_johnson_1452\", \"origin\": \"JFK\", \"destination\": \"MIA\", \"flight_type\": \"round_trip\", \"cabin\": \"economy\", \"flights\": [{\"origin\": \"JFK\", \"destination\": \"MIA\", \"flight_number\": \"HAT120\", \"date\": \"2024-06-10\", \"price\": 320}, {\"origin\": \"MIA\", \"destination\": \"JFK\", \"flight_number\": \"HAT129\", \"date\": \"2024-06-16\", \"price\": 320}], \"passengers\": [{\"first_name\": \"James\", \"last_name\": \"Jonhson\", \"dob\": \"1985-03-14\"}], \"payment_history\": [{\"payment_id\": \"credit_card_4482719\", \"amount\": 640}], \"created_at\": \"2024-05-12T09:44:10\", \"total_baggages\": 1, \"nonfree_baggages\": 0, \"insurance\": \"no\"}" }, { "from": "gpt", "value": "I located your reservation H9Q72B:\n- Trip: Round trip JFK ↔ MIA in economy\n- Flights: HAT120 on 2024-06-10 and HAT129 on 2024-06-16\n- Passenger: James Jonhson (typo detected)\n- No segments have been flown yet, and the number of passengers is 1.\nAction to perform upon your confirmation:\n- Correct the passenger last name from “Jonhson” to “Johnson”\n- Keep the number of passengers unchanged (1)\n- No other aspects of the reservation will be modified\nPlease confirm by replying “yes” to proceed." }, { "from": "human", "value": "Yes, please go ahead and fix the last name." }, { "from": "gpt", "value": "Thank you. I will submit the passenger information update to correct the last name to “Johnson” while keeping all other details unchanged. I will call the function update_reservation_passengers.\n<tool_call>\n{\"name\": \"update_reservation_passengers\", \"arguments\": {\"reservation_id\": \"H9Q72B\", \"passengers\": [{\"first_name\": \"James\", \"last_name\": \"Johnson\", \"dob\": \"1985-03-14\"}]}}\n</tool_call>" }, { "from": "human", "value": "{\"reservation_id\": \"H9Q72B\", \"user_id\": \"james_johnson_1452\", \"origin\": \"JFK\", \"destination\": \"MIA\", \"flight_type\": \"round_trip\", \"cabin\": \"economy\", \"flights\": [{\"origin\": \"JFK\", \"destination\": \"MIA\", \"flight_number\": \"HAT120\", \"date\": \"2024-06-10\", \"price\": 320}, {\"origin\": \"MIA\", \"destination\": \"JFK\", \"flight_number\": \"HAT129\", \"date\": \"2024-06-16\", \"price\": 320}], \"passengers\": [{\"first_name\": \"James\", \"last_name\": \"Johnson\", \"dob\": \"1985-03-14\"}], \"payment_history\": [{\"payment_id\": \"credit_card_4482719\", \"amount\": 640}], \"created_at\": \"2024-05-12T09:44:10\", \"total_baggages\": 1, \"nonfree_baggages\": 0, \"insurance\": \"no\"}" }, { "from": "gpt", "value": "The correction is complete. Your reservation H9Q72B now lists the passenger as James Johnson, with all other details unchanged.\nIf there’s anything else I can help you with, just let me know." } ]
<instructions> You are a customer service agent that helps the user according to the <policy> provided below. In each turn you can either: - Send a message to the user. - Make a tool call. You cannot do both at the same time. Try to be helpful and always follow the policy. Always make sure you generate valid JSON only. </instructions> <policy> # Airline Agent Policy The current time is 2024-05-15 15:00:00 EST. As an airline agent, you can help users **book**, **modify**, or **cancel** flight reservations. You also handle **refunds and compensation**. Before taking any actions that update the booking database (booking, modifying flights, editing baggage, changing cabin class, or updating passenger information), you must list the action details and obtain explicit user confirmation (yes) to proceed. You should not provide any information, knowledge, or procedures not provided by the user or available tools, or give subjective recommendations or comments. You should only make one tool call at a time, and if you make a tool call, you should not respond to the user simultaneously. If you respond to the user, you should not make a tool call at the same time. You should deny user requests that are against this policy. You should transfer the user to a human agent if and only if the request cannot be handled within the scope of your actions. To transfer, first make a tool call to transfer_to_human_agents, and then send the message 'YOU ARE BEING TRANSFERRED TO A HUMAN AGENT. PLEASE HOLD ON.' to the user. ## Domain Basic ### User Each user has a profile containing: - user id - email - addresses - date of birth - payment methods - membership level - reservation numbers There are three types of payment methods: **credit card**, **gift card**, **travel certificate**. There are three membership levels: **regular**, **silver**, **gold**. ### Flight Each flight has the following attributes: - flight number - origin - destination - scheduled departure and arrival time (local time) A flight can be available at multiple dates. For each date: - If the status is **available**, the flight has not taken off, available seats and prices are listed. - If the status is **delayed** or **on time**, the flight has not taken off, cannot be booked. - If the status is **flying**, the flight has taken off but not landed, cannot be booked. There are three cabin classes: **basic economy**, **economy**, **business**. **basic economy** is its own class, completely distinct from **economy**. Seat availability and prices are listed for each cabin class. ### Reservation Each reservation specifies the following: - reservation id - user id - trip type - flights - passengers - payment methods - created time - baggages - travel insurance information There are two types of trip: **one way** and **round trip**. ## Book flight The agent must first obtain the user id from the user. The agent should then ask for the trip type, origin, destination. Cabin: - Cabin class must be the same across all the flights in a reservation. Passengers: - Each reservation can have at most five passengers. - The agent needs to collect the first name, last name, and date of birth for each passenger. - All passengers must fly the same flights in the same cabin. Payment: - Each reservation can use at most one travel certificate, at most one credit card, and at most three gift cards. - The remaining amount of a travel certificate is not refundable. - All payment methods must already be in user profile for safety reasons. Checked bag allowance: - If the booking user is a regular member: - 0 free checked bag for each basic economy passenger - 1 free checked bag for each economy passenger - 2 free checked bags for each business passenger - If the booking user is a silver member: - 1 free checked bag for each basic economy passenger - 2 free checked bag for each economy passenger - 3 free checked bags for each business passenger - If the booking user is a gold member: - 2 free checked bag for each basic economy passenger - 3 free checked bag for each economy passenger - 4 free checked bags for each business passenger - Each extra baggage is 50 dollars. Do not add checked bags that the user does not need. Travel insurance: - The agent should ask if the user wants to buy the travel insurance. - The travel insurance is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight First, the agent must obtain the user id and reservation id. - The user must provide their user id. - If the user doesn't know their reservation id, the agent should help locate it using available tools. Change flights: - Basic economy flights cannot be modified. - Other reservations can be modified without changing the origin, destination, and trip type. - Some flight segments can be kept, but their prices will not be updated based on the current price. - The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! Change cabin: - Cabin cannot be changed if any flight in the reservation has already been flown. - In other cases, all reservations, including basic economy, can change cabin without changing the flights. - Cabin class must remain the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - If the price after cabin change is higher than the original price, the user is required to pay for the difference. - If the price after cabin change is lower than the original price, the user is should be refunded the difference. Change baggage and insurance: - The user can add but not remove checked bags. - The user cannot add insurance after initial booking. Change passengers: - The user can modify passengers but cannot modify the number of passengers. - Even a human agent cannot modify the number of passengers. Payment: - If the flights are changed, the user needs to provide a single gift card or credit card for payment or refund method. The payment method must already be in user profile for safety reasons. ## Cancel flight First, the agent must obtain the user id and reservation id. - The user must provide their user id. - If the user doesn't know their reservation id, the agent should help locate it using available tools. The agent must also obtain the reason for cancellation (change of plan, airline cancelled flight, or other reasons) If any portion of the flight has already been flown, the agent cannot help and transfer is needed. Otherwise, flight can be cancelled if any of the following is true: - The booking was made within the last 24 hrs - The flight is cancelled by airline - It is a business flight - The user has travel insurance and the reason for cancellation is covered by insurance. The API does not check that cancellation rules are met, so the agent must make sure the rules apply before calling the API! Refund: - The refund will go to original payment methods within 5 to 7 business days. ## Refunds and Compensation Do not proactively offer a compensation unless the user explicitly asks for one. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. Always confirms the facts before offering compensation. Only compensate if the user is a silver/gold member or has travel insurance or flies business. - If the user complains about cancelled flights in a reservation, the agent can offer a certificate as a gesture after confirming the facts, with the amount being $100 times the number of passengers. - If the user complains about delayed flights in a reservation and wants to change or cancel the reservation, the agent can offer a certificate as a gesture after confirming the facts and changing or cancelling the reservation, with the amount being $50 times the number of passengers. Do not offer compensation for any other reason than the ones listed above. </policy> # Tools You may call one or more functions to assist with the user query. You are provided with function signatures within <tools></tools> XML tags: <tools> {"type": "function", "function": {"name": "book_reservation", "description": "Book a reservation.", "parameters": {"$defs": {"FlightInfo": {"properties": {"flight_number": {"description": "Flight number, such as 'HAT001'.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "FlightInfo", "type": "object"}, "Passenger": {"properties": {"first_name": {"description": "Passenger's first name", "title": "First Name", "type": "string"}, "last_name": {"description": "Passenger's last name", "title": "Last Name", "type": "string"}, "dob": {"description": "Date of birth in YYYY-MM-DD format", "title": "Dob", "type": "string"}}, "required": ["first_name", "last_name", "dob"], "title": "Passenger", "type": "object"}, "Payment": {"properties": {"payment_id": {"description": "Unique identifier for the payment", "title": "Payment Id", "type": "string"}, "amount": {"description": "Payment amount in dollars", "title": "Amount", "type": "integer"}}, "required": ["payment_id", "amount"], "title": "Payment", "type": "object"}}, "properties": {"user_id": {"description": "The ID of the user to book the reservation such as 'sara_doe_496'`.", "title": "User Id", "type": "string"}, "origin": {"description": "The IATA code for the origin city such as 'SFO'.", "title": "Origin", "type": "string"}, "destination": {"description": "The IATA code for the destination city such as 'JFK'.", "title": "Destination", "type": "string"}, "flight_type": {"description": "The type of flight such as 'one_way' or 'round_trip'.", "enum": ["round_trip", "one_way"], "title": "Flight Type", "type": "string"}, "cabin": {"description": "The cabin class such as 'basic_economy', 'economy', or 'business'.", "enum": ["business", "economy", "basic_economy"], "title": "Cabin", "type": "string"}, "flights": {"description": "An array of objects containing details about each piece of flight.", "items": {"anyOf": [{"$ref": "#/$defs/FlightInfo"}, {"additionalProperties": true, "type": "object"}]}, "title": "Flights", "type": "array"}, "passengers": {"description": "An array of objects containing details about each passenger.", "items": {"anyOf": [{"$ref": "#/$defs/Passenger"}, {"additionalProperties": true, "type": "object"}]}, "title": "Passengers", "type": "array"}, "payment_methods": {"description": "An array of objects containing details about each payment method.", "items": {"anyOf": [{"$ref": "#/$defs/Payment"}, {"additionalProperties": true, "type": "object"}]}, "title": "Payment Methods", "type": "array"}, "total_baggages": {"description": "The total number of baggage items to book the reservation.", "title": "Total Baggages", "type": "integer"}, "nonfree_baggages": {"description": "The number of non-free baggage items to book the reservation.", "title": "Nonfree Baggages", "type": "integer"}, "insurance": {"description": "Whether the reservation has insurance.", "enum": ["yes", "no"], "title": "Insurance", "type": "string"}}, "required": ["user_id", "origin", "destination", "flight_type", "cabin", "flights", "passengers", "payment_methods", "total_baggages", "nonfree_baggages", "insurance"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "calculate", "description": "Calculate the result of a mathematical expression.", "parameters": {"properties": {"expression": {"description": "The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.", "title": "Expression", "type": "string"}}, "required": ["expression"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "cancel_reservation", "description": "Cancel the whole reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}}, "required": ["reservation_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_reservation_details", "description": "Get the details of a reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as '8JX2WO'.", "title": "Reservation Id", "type": "string"}}, "required": ["reservation_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_user_details", "description": "Get the details of a user, including their reservations.", "parameters": {"properties": {"user_id": {"description": "The user ID, such as 'sara_doe_496'.", "title": "User Id", "type": "string"}}, "required": ["user_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "list_all_airports", "description": "Returns a list of all available airports.", "parameters": {"properties": {}, "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "search_direct_flight", "description": "Search for direct flights between two cities on a specific date.", "parameters": {"properties": {"origin": {"description": "The origin city airport in three letters, such as 'JFK'.", "title": "Origin", "type": "string"}, "destination": {"description": "The destination city airport in three letters, such as 'LAX'.", "title": "Destination", "type": "string"}, "date": {"description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.", "title": "Date", "type": "string"}}, "required": ["origin", "destination", "date"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "search_onestop_flight", "description": "Search for one-stop flights between two cities on a specific date.", "parameters": {"properties": {"origin": {"description": "The origin city airport in three letters, such as 'JFK'.", "title": "Origin", "type": "string"}, "destination": {"description": "The destination city airport in three letters, such as 'LAX'.", "title": "Destination", "type": "string"}, "date": {"description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["origin", "destination", "date"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "send_certificate", "description": "Send a certificate to a user. Be careful!", "parameters": {"properties": {"user_id": {"description": "The ID of the user to book the reservation, such as 'sara_doe_496'.", "title": "User Id", "type": "string"}, "amount": {"description": "The amount of the certificate to send.", "title": "Amount", "type": "integer"}}, "required": ["user_id", "amount"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "transfer_to_human_agents", "description": "Transfer the user to a human agent, with a summary of the user's issue.\n\nOnly transfer if\n - the user explicitly asks for a human agent\n - given the policy and the available tools, you cannot solve the user's issue.", "parameters": {"properties": {"summary": {"description": "A summary of the user's issue.", "title": "Summary", "type": "string"}}, "required": ["summary"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_baggages", "description": "Update the baggage information of a reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'", "title": "Reservation Id", "type": "string"}, "total_baggages": {"description": "The updated total number of baggage items included in the reservation.", "title": "Total Baggages", "type": "integer"}, "nonfree_baggages": {"description": "The updated number of non-free baggage items included in the reservation.", "title": "Nonfree Baggages", "type": "integer"}, "payment_id": {"description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.", "title": "Payment Id", "type": "string"}}, "required": ["reservation_id", "total_baggages", "nonfree_baggages", "payment_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_flights", "description": "Update the flight information of a reservation.", "parameters": {"$defs": {"FlightInfo": {"properties": {"flight_number": {"description": "Flight number, such as 'HAT001'.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "FlightInfo", "type": "object"}}, "properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}, "cabin": {"description": "The cabin class of the reservation", "enum": ["business", "economy", "basic_economy"], "title": "Cabin", "type": "string"}, "flights": {"description": "An array of objects containing details about each piece of flight in the ENTIRE new reservation. Even if the a flight segment is not changed, it should still be included in the array.", "items": {"anyOf": [{"$ref": "#/$defs/FlightInfo"}, {"additionalProperties": true, "type": "object"}]}, "title": "Flights", "type": "array"}, "payment_id": {"description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.", "title": "Payment Id", "type": "string"}}, "required": ["reservation_id", "cabin", "flights", "payment_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_passengers", "description": "Update the passenger information of a reservation.", "parameters": {"$defs": {"Passenger": {"properties": {"first_name": {"description": "Passenger's first name", "title": "First Name", "type": "string"}, "last_name": {"description": "Passenger's last name", "title": "Last Name", "type": "string"}, "dob": {"description": "Date of birth in YYYY-MM-DD format", "title": "Dob", "type": "string"}}, "required": ["first_name", "last_name", "dob"], "title": "Passenger", "type": "object"}}, "properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}, "passengers": {"description": "An array of objects containing details about each passenger.", "items": {"anyOf": [{"$ref": "#/$defs/Passenger"}, {"additionalProperties": true, "type": "object"}]}, "title": "Passengers", "type": "array"}}, "required": ["reservation_id", "passengers"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_flight_status", "description": "Get the status of a flight.", "parameters": {"properties": {"flight_number": {"description": "The flight number.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date of the flight.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "parameters", "type": "object"}}} </tools> For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags: <tool_call> {"name": <function-name>, "arguments": <args-json-object>} </tool_call>
[{"name":"book_reservation","description":"Book a reservation.","parameters":{"$defs":{"FlightInfo":{"properties":{"flight_number":{"description":"Flight number, such as 'HAT001'.","title":"Flight Number","type":"string"},"date":{"description":"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"FlightInfo","type":"object"},"Passenger":{"properties":{"first_name":{"description":"Passenger's first name","title":"First Name","type":"string"},"last_name":{"description":"Passenger's last name","title":"Last Name","type":"string"},"dob":{"description":"Date of birth in YYYY-MM-DD format","title":"Dob","type":"string"}},"required":["first_name","last_name","dob"],"title":"Passenger","type":"object"},"Payment":{"properties":{"payment_id":{"description":"Unique identifier for the payment","title":"Payment Id","type":"string"},"amount":{"description":"Payment amount in dollars","title":"Amount","type":"integer"}},"required":["payment_id","amount"],"title":"Payment","type":"object"}},"properties":{"user_id":{"description":"The ID of the user to book the reservation such as 'sara_doe_496'`.","title":"User Id","type":"string"},"origin":{"description":"The IATA code for the origin city such as 'SFO'.","title":"Origin","type":"string"},"destination":{"description":"The IATA code for the destination city such as 'JFK'.","title":"Destination","type":"string"},"flight_type":{"description":"The type of flight such as 'one_way' or 'round_trip'.","enum":["round_trip","one_way"],"title":"Flight Type","type":"string"},"cabin":{"description":"The cabin class such as 'basic_economy', 'economy', or 'business'.","enum":["business","economy","basic_economy"],"title":"Cabin","type":"string"},"flights":{"description":"An array of objects containing details about each piece of flight.","items":{"anyOf":[{"$ref":"#/$defs/FlightInfo"},{"additionalProperties":true,"type":"object"}]},"title":"Flights","type":"array"},"passengers":{"description":"An array of objects containing details about each passenger.","items":{"anyOf":[{"$ref":"#/$defs/Passenger"},{"additionalProperties":true,"type":"object"}]},"title":"Passengers","type":"array"},"payment_methods":{"description":"An array of objects containing details about each payment method.","items":{"anyOf":[{"$ref":"#/$defs/Payment"},{"additionalProperties":true,"type":"object"}]},"title":"Payment Methods","type":"array"},"total_baggages":{"description":"The total number of baggage items to book the reservation.","title":"Total Baggages","type":"integer"},"nonfree_baggages":{"description":"The number of non-free baggage items to book the reservation.","title":"Nonfree Baggages","type":"integer"},"insurance":{"description":"Whether the reservation has insurance.","enum":["yes","no"],"title":"Insurance","type":"string"}},"required":["user_id","origin","destination","flight_type","cabin","flights","passengers","payment_methods","total_baggages","nonfree_baggages","insurance"],"title":"parameters","type":"object"}},{"name":"calculate","description":"Calculate the result of a mathematical expression.","parameters":{"properties":{"expression":{"description":"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.","title":"Expression","type":"string"}},"required":["expression"],"title":"parameters","type":"object"}},{"name":"cancel_reservation","description":"Cancel the whole reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"}},"required":["reservation_id"],"title":"parameters","type":"object"}},{"name":"get_reservation_details","description":"Get the details of a reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as '8JX2WO'.","title":"Reservation Id","type":"string"}},"required":["reservation_id"],"title":"parameters","type":"object"}},{"name":"get_user_details","description":"Get the details of a user, including their reservations.","parameters":{"properties":{"user_id":{"description":"The user ID, such as 'sara_doe_496'.","title":"User Id","type":"string"}},"required":["user_id"],"title":"parameters","type":"object"}},{"name":"list_all_airports","description":"Returns a list of all available airports.","parameters":{"properties":{},"title":"parameters","type":"object"}},{"name":"search_direct_flight","description":"Search for direct flights between two cities on a specific date.","parameters":{"properties":{"origin":{"description":"The origin city airport in three letters, such as 'JFK'.","title":"Origin","type":"string"},"destination":{"description":"The destination city airport in three letters, such as 'LAX'.","title":"Destination","type":"string"},"date":{"description":"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.","title":"Date","type":"string"}},"required":["origin","destination","date"],"title":"parameters","type":"object"}},{"name":"search_onestop_flight","description":"Search for one-stop flights between two cities on a specific date.","parameters":{"properties":{"origin":{"description":"The origin city airport in three letters, such as 'JFK'.","title":"Origin","type":"string"},"destination":{"description":"The destination city airport in three letters, such as 'LAX'.","title":"Destination","type":"string"},"date":{"description":"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["origin","destination","date"],"title":"parameters","type":"object"}},{"name":"send_certificate","description":"Send a certificate to a user. Be careful!","parameters":{"properties":{"user_id":{"description":"The ID of the user to book the reservation, such as 'sara_doe_496'.","title":"User Id","type":"string"},"amount":{"description":"The amount of the certificate to send.","title":"Amount","type":"integer"}},"required":["user_id","amount"],"title":"parameters","type":"object"}},{"name":"transfer_to_human_agents","description":"Transfer the user to a human agent, with a summary of the user's issue.\n\nOnly transfer if\n - the user explicitly asks for a human agent\n - given the policy and the available tools, you cannot solve the user's issue.","parameters":{"properties":{"summary":{"description":"A summary of the user's issue.","title":"Summary","type":"string"}},"required":["summary"],"title":"parameters","type":"object"}},{"name":"update_reservation_baggages","description":"Update the baggage information of a reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'","title":"Reservation Id","type":"string"},"total_baggages":{"description":"The updated total number of baggage items included in the reservation.","title":"Total Baggages","type":"integer"},"nonfree_baggages":{"description":"The updated number of non-free baggage items included in the reservation.","title":"Nonfree Baggages","type":"integer"},"payment_id":{"description":"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.","title":"Payment Id","type":"string"}},"required":["reservation_id","total_baggages","nonfree_baggages","payment_id"],"title":"parameters","type":"object"}},{"name":"update_reservation_flights","description":"Update the flight information of a reservation.","parameters":{"$defs":{"FlightInfo":{"properties":{"flight_number":{"description":"Flight number, such as 'HAT001'.","title":"Flight Number","type":"string"},"date":{"description":"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"FlightInfo","type":"object"}},"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"},"cabin":{"description":"The cabin class of the reservation","enum":["business","economy","basic_economy"],"title":"Cabin","type":"string"},"flights":{"description":"An array of objects containing details about each piece of flight in the ENTIRE new reservation. Even if the a flight segment is not changed, it should still be included in the array.","items":{"anyOf":[{"$ref":"#/$defs/FlightInfo"},{"additionalProperties":true,"type":"object"}]},"title":"Flights","type":"array"},"payment_id":{"description":"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.","title":"Payment Id","type":"string"}},"required":["reservation_id","cabin","flights","payment_id"],"title":"parameters","type":"object"}},{"name":"update_reservation_passengers","description":"Update the passenger information of a reservation.","parameters":{"$defs":{"Passenger":{"properties":{"first_name":{"description":"Passenger's first name","title":"First Name","type":"string"},"last_name":{"description":"Passenger's last name","title":"Last Name","type":"string"},"dob":{"description":"Date of birth in YYYY-MM-DD format","title":"Dob","type":"string"}},"required":["first_name","last_name","dob"],"title":"Passenger","type":"object"}},"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"},"passengers":{"description":"An array of objects containing details about each passenger.","items":{"anyOf":[{"$ref":"#/$defs/Passenger"},{"additionalProperties":true,"type":"object"}]},"title":"Passengers","type":"array"}},"required":["reservation_id","passengers"],"title":"parameters","type":"object"}},{"name":"get_flight_status","description":"Get the status of a flight.","parameters":{"properties":{"flight_number":{"description":"The flight number.","title":"Flight Number","type":"string"},"date":{"description":"The date of the flight.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"parameters","type":"object"}}]
apigen_general_-4690362443894054027
8
8
general
Hi, I have a reservation KDM48R for a one-way trip from LAX to ORD in economy. I’d like to upgrade to business. Can you help me with that?
[ { "from": "human", "value": "Hi, I need to change my return flight to an earlier one." }, { "from": "gpt", "value": "I can help with that. Please provide:\n- Your user ID\n- Your reservation ID\n- The exact new flight you want to switch to (flight number and date)\n- Please confirm you’re keeping the same origin, destination, trip type, and cabin\n- A single gift card or credit card payment method ID from your profile to use for any fare difference (charge or refund)" }, { "from": "human", "value": "My user ID is emily_nguyen_3391 and the reservation ID is Q8L2SZ. I want to move my return from 2024-05-29 (HAT553) to HAT552 on 2024-05-28. Keep everything else the same. Use my credit card ending in ...2196 (payment_id: credit_card_8842196)." }, { "from": "gpt", "value": "I will call the function get_reservation_details.\n<tool_call>\n{\"name\": \"get_reservation_details\", \"arguments\": {\"reservation_id\": \"Q8L2SZ\"}}\n</tool_call>" }, { "from": "human", "value": "{\"reservation_id\": \"Q8L2SZ\", \"user_id\": \"emily_nguyen_3391\", \"origin\": \"SEA\", \"destination\": \"JFK\", \"flight_type\": \"round_trip\", \"cabin\": \"economy\", \"flights\": [{\"origin\": \"SEA\", \"destination\": \"JFK\", \"flight_number\": \"HAT551\", \"date\": \"2024-05-25\", \"price\": 320}, {\"origin\": \"JFK\", \"destination\": \"SEA\", \"flight_number\": \"HAT553\", \"date\": \"2024-05-29\", \"price\": 315}], \"passengers\": [{\"first_name\": \"Emily\", \"last_name\": \"Nguyen\", \"dob\": \"1994-08-14\"}], \"payment_history\": [{\"payment_id\": \"credit_card_8842196\", \"amount\": 635}], \"created_at\": \"2024-05-12T11:30:00\", \"total_baggages\": 1, \"nonfree_baggages\": 0, \"insurance\": \"no\"}" }, { "from": "gpt", "value": "I need to verify your membership level and confirm the payment method is on file before proceeding. I will call the function get_user_details.\n<tool_call>\n{\"name\": \"get_user_details\", \"arguments\": {\"user_id\": \"emily_nguyen_3391\"}}\n</tool_call>" }, { "from": "human", "value": "{\"user_id\": \"emily_nguyen_3391\", \"email\": \"[email protected]\", \"addresses\": [{\"line1\": \"901 Pine St\", \"city\": \"Seattle\", \"state\": \"WA\", \"zip\": \"98101\"}], \"dob\": \"1994-08-14\", \"membership_level\": \"silver\", \"payment_methods\": [{\"payment_id\": \"credit_card_8842196\", \"type\": \"credit_card\", \"last4\": \"2196\"}, {\"payment_id\": \"gift_card_3307129\", \"type\": \"gift_card\"}], \"reservation_numbers\": [\"Q8L2SZ\"]}" }, { "from": "gpt", "value": "Thanks. Here are the details before I proceed:\n- Reservation Q8L2SZ is a round trip SEA ↔ JFK in economy for 1 passenger.\n- You want to keep the outbound flight HAT551 on 2024-05-25 as is.\n- You want to change the return segment from HAT553 on 2024-05-29 to HAT552 on 2024-05-28 (same route JFK → SEA).\n- Cabin remains economy; origin, destination, and trip type remain unchanged.\n- Payment method for any fare difference (charge or refund): credit_card_8842196 (on file).\nPlease confirm by replying “yes” to proceed with updating your return flight to HAT552 on 2024-05-28 and using credit_card_8842196 for any fare difference." }, { "from": "human", "value": "Yes, please proceed." }, { "from": "gpt", "value": "The user confirmed the action details. I will update the reservation flights and use the specified payment method for any fare difference. I will call the function update_reservation_flights.\n<tool_call>\n{\"name\": \"update_reservation_flights\", \"arguments\": {\"reservation_id\": \"Q8L2SZ\", \"cabin\": \"economy\", \"flights\": [{\"flight_number\": \"HAT551\", \"date\": \"2024-05-25\"}, {\"flight_number\": \"HAT552\", \"date\": \"2024-05-28\"}], \"payment_id\": \"credit_card_8842196\"}}\n</tool_call>" }, { "from": "human", "value": "{\"reservation_id\": \"Q8L2SZ\", \"user_id\": \"emily_nguyen_3391\", \"origin\": \"SEA\", \"destination\": \"JFK\", \"flight_type\": \"round_trip\", \"cabin\": \"economy\", \"flights\": [{\"origin\": \"SEA\", \"destination\": \"JFK\", \"flight_number\": \"HAT551\", \"date\": \"2024-05-25\", \"price\": 320}, {\"origin\": \"JFK\", \"destination\": \"SEA\", \"flight_number\": \"HAT552\", \"date\": \"2024-05-28\", \"price\": 350}], \"passengers\": [{\"first_name\": \"Emily\", \"last_name\": \"Nguyen\", \"dob\": \"1994-08-14\"}], \"payment_history\": [{\"payment_id\": \"credit_card_8842196\", \"amount\": 635}, {\"payment_id\": \"credit_card_8842196\", \"amount\": 35}], \"created_at\": \"2024-05-12T11:30:00\", \"total_baggages\": 1, \"nonfree_baggages\": 0, \"insurance\": \"no\"}" }, { "from": "gpt", "value": "Your reservation has been updated successfully.\n- Outbound: HAT551 on 2024-05-25 (SEA → JFK) unchanged\n- Return: HAT552 on 2024-05-28 (JFK → SEA) updated\n- Cabin: economy\nA fare difference of $35 was charged to credit_card_8842196. If you need anything else, let me know." } ]
<instructions> You are a customer service agent that helps the user according to the <policy> provided below. In each turn you can either: - Send a message to the user. - Make a tool call. You cannot do both at the same time. Try to be helpful and always follow the policy. Always make sure you generate valid JSON only. </instructions> <policy> # Airline Agent Policy The current time is 2024-05-15 15:00:00 EST. As an airline agent, you can help users **book**, **modify**, or **cancel** flight reservations. You also handle **refunds and compensation**. Before taking any actions that update the booking database (booking, modifying flights, editing baggage, changing cabin class, or updating passenger information), you must list the action details and obtain explicit user confirmation (yes) to proceed. You should not provide any information, knowledge, or procedures not provided by the user or available tools, or give subjective recommendations or comments. You should only make one tool call at a time, and if you make a tool call, you should not respond to the user simultaneously. If you respond to the user, you should not make a tool call at the same time. You should deny user requests that are against this policy. You should transfer the user to a human agent if and only if the request cannot be handled within the scope of your actions. To transfer, first make a tool call to transfer_to_human_agents, and then send the message 'YOU ARE BEING TRANSFERRED TO A HUMAN AGENT. PLEASE HOLD ON.' to the user. ## Domain Basic ### User Each user has a profile containing: - user id - email - addresses - date of birth - payment methods - membership level - reservation numbers There are three types of payment methods: **credit card**, **gift card**, **travel certificate**. There are three membership levels: **regular**, **silver**, **gold**. ### Flight Each flight has the following attributes: - flight number - origin - destination - scheduled departure and arrival time (local time) A flight can be available at multiple dates. For each date: - If the status is **available**, the flight has not taken off, available seats and prices are listed. - If the status is **delayed** or **on time**, the flight has not taken off, cannot be booked. - If the status is **flying**, the flight has taken off but not landed, cannot be booked. There are three cabin classes: **basic economy**, **economy**, **business**. **basic economy** is its own class, completely distinct from **economy**. Seat availability and prices are listed for each cabin class. ### Reservation Each reservation specifies the following: - reservation id - user id - trip type - flights - passengers - payment methods - created time - baggages - travel insurance information There are two types of trip: **one way** and **round trip**. ## Book flight The agent must first obtain the user id from the user. The agent should then ask for the trip type, origin, destination. Cabin: - Cabin class must be the same across all the flights in a reservation. Passengers: - Each reservation can have at most five passengers. - The agent needs to collect the first name, last name, and date of birth for each passenger. - All passengers must fly the same flights in the same cabin. Payment: - Each reservation can use at most one travel certificate, at most one credit card, and at most three gift cards. - The remaining amount of a travel certificate is not refundable. - All payment methods must already be in user profile for safety reasons. Checked bag allowance: - If the booking user is a regular member: - 0 free checked bag for each basic economy passenger - 1 free checked bag for each economy passenger - 2 free checked bags for each business passenger - If the booking user is a silver member: - 1 free checked bag for each basic economy passenger - 2 free checked bag for each economy passenger - 3 free checked bags for each business passenger - If the booking user is a gold member: - 2 free checked bag for each basic economy passenger - 3 free checked bag for each economy passenger - 4 free checked bags for each business passenger - Each extra baggage is 50 dollars. Do not add checked bags that the user does not need. Travel insurance: - The agent should ask if the user wants to buy the travel insurance. - The travel insurance is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight First, the agent must obtain the user id and reservation id. - The user must provide their user id. - If the user doesn't know their reservation id, the agent should help locate it using available tools. Change flights: - Basic economy flights cannot be modified. - Other reservations can be modified without changing the origin, destination, and trip type. - Some flight segments can be kept, but their prices will not be updated based on the current price. - The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! Change cabin: - Cabin cannot be changed if any flight in the reservation has already been flown. - In other cases, all reservations, including basic economy, can change cabin without changing the flights. - Cabin class must remain the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - If the price after cabin change is higher than the original price, the user is required to pay for the difference. - If the price after cabin change is lower than the original price, the user is should be refunded the difference. Change baggage and insurance: - The user can add but not remove checked bags. - The user cannot add insurance after initial booking. Change passengers: - The user can modify passengers but cannot modify the number of passengers. - Even a human agent cannot modify the number of passengers. Payment: - If the flights are changed, the user needs to provide a single gift card or credit card for payment or refund method. The payment method must already be in user profile for safety reasons. ## Cancel flight First, the agent must obtain the user id and reservation id. - The user must provide their user id. - If the user doesn't know their reservation id, the agent should help locate it using available tools. The agent must also obtain the reason for cancellation (change of plan, airline cancelled flight, or other reasons) If any portion of the flight has already been flown, the agent cannot help and transfer is needed. Otherwise, flight can be cancelled if any of the following is true: - The booking was made within the last 24 hrs - The flight is cancelled by airline - It is a business flight - The user has travel insurance and the reason for cancellation is covered by insurance. The API does not check that cancellation rules are met, so the agent must make sure the rules apply before calling the API! Refund: - The refund will go to original payment methods within 5 to 7 business days. ## Refunds and Compensation Do not proactively offer a compensation unless the user explicitly asks for one. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. Always confirms the facts before offering compensation. Only compensate if the user is a silver/gold member or has travel insurance or flies business. - If the user complains about cancelled flights in a reservation, the agent can offer a certificate as a gesture after confirming the facts, with the amount being $100 times the number of passengers. - If the user complains about delayed flights in a reservation and wants to change or cancel the reservation, the agent can offer a certificate as a gesture after confirming the facts and changing or cancelling the reservation, with the amount being $50 times the number of passengers. Do not offer compensation for any other reason than the ones listed above. </policy> # Tools You may call one or more functions to assist with the user query. You are provided with function signatures within <tools></tools> XML tags: <tools> {"type": "function", "function": {"name": "book_reservation", "description": "Book a reservation.", "parameters": {"$defs": {"FlightInfo": {"properties": {"flight_number": {"description": "Flight number, such as 'HAT001'.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "FlightInfo", "type": "object"}, "Passenger": {"properties": {"first_name": {"description": "Passenger's first name", "title": "First Name", "type": "string"}, "last_name": {"description": "Passenger's last name", "title": "Last Name", "type": "string"}, "dob": {"description": "Date of birth in YYYY-MM-DD format", "title": "Dob", "type": "string"}}, "required": ["first_name", "last_name", "dob"], "title": "Passenger", "type": "object"}, "Payment": {"properties": {"payment_id": {"description": "Unique identifier for the payment", "title": "Payment Id", "type": "string"}, "amount": {"description": "Payment amount in dollars", "title": "Amount", "type": "integer"}}, "required": ["payment_id", "amount"], "title": "Payment", "type": "object"}}, "properties": {"user_id": {"description": "The ID of the user to book the reservation such as 'sara_doe_496'`.", "title": "User Id", "type": "string"}, "origin": {"description": "The IATA code for the origin city such as 'SFO'.", "title": "Origin", "type": "string"}, "destination": {"description": "The IATA code for the destination city such as 'JFK'.", "title": "Destination", "type": "string"}, "flight_type": {"description": "The type of flight such as 'one_way' or 'round_trip'.", "enum": ["round_trip", "one_way"], "title": "Flight Type", "type": "string"}, "cabin": {"description": "The cabin class such as 'basic_economy', 'economy', or 'business'.", "enum": ["business", "economy", "basic_economy"], "title": "Cabin", "type": "string"}, "flights": {"description": "An array of objects containing details about each piece of flight.", "items": {"anyOf": [{"$ref": "#/$defs/FlightInfo"}, {"additionalProperties": true, "type": "object"}]}, "title": "Flights", "type": "array"}, "passengers": {"description": "An array of objects containing details about each passenger.", "items": {"anyOf": [{"$ref": "#/$defs/Passenger"}, {"additionalProperties": true, "type": "object"}]}, "title": "Passengers", "type": "array"}, "payment_methods": {"description": "An array of objects containing details about each payment method.", "items": {"anyOf": [{"$ref": "#/$defs/Payment"}, {"additionalProperties": true, "type": "object"}]}, "title": "Payment Methods", "type": "array"}, "total_baggages": {"description": "The total number of baggage items to book the reservation.", "title": "Total Baggages", "type": "integer"}, "nonfree_baggages": {"description": "The number of non-free baggage items to book the reservation.", "title": "Nonfree Baggages", "type": "integer"}, "insurance": {"description": "Whether the reservation has insurance.", "enum": ["yes", "no"], "title": "Insurance", "type": "string"}}, "required": ["user_id", "origin", "destination", "flight_type", "cabin", "flights", "passengers", "payment_methods", "total_baggages", "nonfree_baggages", "insurance"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "calculate", "description": "Calculate the result of a mathematical expression.", "parameters": {"properties": {"expression": {"description": "The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.", "title": "Expression", "type": "string"}}, "required": ["expression"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "cancel_reservation", "description": "Cancel the whole reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}}, "required": ["reservation_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_reservation_details", "description": "Get the details of a reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as '8JX2WO'.", "title": "Reservation Id", "type": "string"}}, "required": ["reservation_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_user_details", "description": "Get the details of a user, including their reservations.", "parameters": {"properties": {"user_id": {"description": "The user ID, such as 'sara_doe_496'.", "title": "User Id", "type": "string"}}, "required": ["user_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "list_all_airports", "description": "Returns a list of all available airports.", "parameters": {"properties": {}, "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "search_direct_flight", "description": "Search for direct flights between two cities on a specific date.", "parameters": {"properties": {"origin": {"description": "The origin city airport in three letters, such as 'JFK'.", "title": "Origin", "type": "string"}, "destination": {"description": "The destination city airport in three letters, such as 'LAX'.", "title": "Destination", "type": "string"}, "date": {"description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.", "title": "Date", "type": "string"}}, "required": ["origin", "destination", "date"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "search_onestop_flight", "description": "Search for one-stop flights between two cities on a specific date.", "parameters": {"properties": {"origin": {"description": "The origin city airport in three letters, such as 'JFK'.", "title": "Origin", "type": "string"}, "destination": {"description": "The destination city airport in three letters, such as 'LAX'.", "title": "Destination", "type": "string"}, "date": {"description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["origin", "destination", "date"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "send_certificate", "description": "Send a certificate to a user. Be careful!", "parameters": {"properties": {"user_id": {"description": "The ID of the user to book the reservation, such as 'sara_doe_496'.", "title": "User Id", "type": "string"}, "amount": {"description": "The amount of the certificate to send.", "title": "Amount", "type": "integer"}}, "required": ["user_id", "amount"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "transfer_to_human_agents", "description": "Transfer the user to a human agent, with a summary of the user's issue.\n\nOnly transfer if\n - the user explicitly asks for a human agent\n - given the policy and the available tools, you cannot solve the user's issue.", "parameters": {"properties": {"summary": {"description": "A summary of the user's issue.", "title": "Summary", "type": "string"}}, "required": ["summary"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_baggages", "description": "Update the baggage information of a reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'", "title": "Reservation Id", "type": "string"}, "total_baggages": {"description": "The updated total number of baggage items included in the reservation.", "title": "Total Baggages", "type": "integer"}, "nonfree_baggages": {"description": "The updated number of non-free baggage items included in the reservation.", "title": "Nonfree Baggages", "type": "integer"}, "payment_id": {"description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.", "title": "Payment Id", "type": "string"}}, "required": ["reservation_id", "total_baggages", "nonfree_baggages", "payment_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_flights", "description": "Update the flight information of a reservation.", "parameters": {"$defs": {"FlightInfo": {"properties": {"flight_number": {"description": "Flight number, such as 'HAT001'.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "FlightInfo", "type": "object"}}, "properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}, "cabin": {"description": "The cabin class of the reservation", "enum": ["business", "economy", "basic_economy"], "title": "Cabin", "type": "string"}, "flights": {"description": "An array of objects containing details about each piece of flight in the ENTIRE new reservation. Even if the a flight segment is not changed, it should still be included in the array.", "items": {"anyOf": [{"$ref": "#/$defs/FlightInfo"}, {"additionalProperties": true, "type": "object"}]}, "title": "Flights", "type": "array"}, "payment_id": {"description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.", "title": "Payment Id", "type": "string"}}, "required": ["reservation_id", "cabin", "flights", "payment_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_passengers", "description": "Update the passenger information of a reservation.", "parameters": {"$defs": {"Passenger": {"properties": {"first_name": {"description": "Passenger's first name", "title": "First Name", "type": "string"}, "last_name": {"description": "Passenger's last name", "title": "Last Name", "type": "string"}, "dob": {"description": "Date of birth in YYYY-MM-DD format", "title": "Dob", "type": "string"}}, "required": ["first_name", "last_name", "dob"], "title": "Passenger", "type": "object"}}, "properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}, "passengers": {"description": "An array of objects containing details about each passenger.", "items": {"anyOf": [{"$ref": "#/$defs/Passenger"}, {"additionalProperties": true, "type": "object"}]}, "title": "Passengers", "type": "array"}}, "required": ["reservation_id", "passengers"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_flight_status", "description": "Get the status of a flight.", "parameters": {"properties": {"flight_number": {"description": "The flight number.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date of the flight.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "parameters", "type": "object"}}} </tools> For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags: <tool_call> {"name": <function-name>, "arguments": <args-json-object>} </tool_call>
[{"name":"book_reservation","description":"Book a reservation.","parameters":{"$defs":{"FlightInfo":{"properties":{"flight_number":{"description":"Flight number, such as 'HAT001'.","title":"Flight Number","type":"string"},"date":{"description":"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"FlightInfo","type":"object"},"Passenger":{"properties":{"first_name":{"description":"Passenger's first name","title":"First Name","type":"string"},"last_name":{"description":"Passenger's last name","title":"Last Name","type":"string"},"dob":{"description":"Date of birth in YYYY-MM-DD format","title":"Dob","type":"string"}},"required":["first_name","last_name","dob"],"title":"Passenger","type":"object"},"Payment":{"properties":{"payment_id":{"description":"Unique identifier for the payment","title":"Payment Id","type":"string"},"amount":{"description":"Payment amount in dollars","title":"Amount","type":"integer"}},"required":["payment_id","amount"],"title":"Payment","type":"object"}},"properties":{"user_id":{"description":"The ID of the user to book the reservation such as 'sara_doe_496'`.","title":"User Id","type":"string"},"origin":{"description":"The IATA code for the origin city such as 'SFO'.","title":"Origin","type":"string"},"destination":{"description":"The IATA code for the destination city such as 'JFK'.","title":"Destination","type":"string"},"flight_type":{"description":"The type of flight such as 'one_way' or 'round_trip'.","enum":["round_trip","one_way"],"title":"Flight Type","type":"string"},"cabin":{"description":"The cabin class such as 'basic_economy', 'economy', or 'business'.","enum":["business","economy","basic_economy"],"title":"Cabin","type":"string"},"flights":{"description":"An array of objects containing details about each piece of flight.","items":{"anyOf":[{"$ref":"#/$defs/FlightInfo"},{"additionalProperties":true,"type":"object"}]},"title":"Flights","type":"array"},"passengers":{"description":"An array of objects containing details about each passenger.","items":{"anyOf":[{"$ref":"#/$defs/Passenger"},{"additionalProperties":true,"type":"object"}]},"title":"Passengers","type":"array"},"payment_methods":{"description":"An array of objects containing details about each payment method.","items":{"anyOf":[{"$ref":"#/$defs/Payment"},{"additionalProperties":true,"type":"object"}]},"title":"Payment Methods","type":"array"},"total_baggages":{"description":"The total number of baggage items to book the reservation.","title":"Total Baggages","type":"integer"},"nonfree_baggages":{"description":"The number of non-free baggage items to book the reservation.","title":"Nonfree Baggages","type":"integer"},"insurance":{"description":"Whether the reservation has insurance.","enum":["yes","no"],"title":"Insurance","type":"string"}},"required":["user_id","origin","destination","flight_type","cabin","flights","passengers","payment_methods","total_baggages","nonfree_baggages","insurance"],"title":"parameters","type":"object"}},{"name":"calculate","description":"Calculate the result of a mathematical expression.","parameters":{"properties":{"expression":{"description":"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.","title":"Expression","type":"string"}},"required":["expression"],"title":"parameters","type":"object"}},{"name":"cancel_reservation","description":"Cancel the whole reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"}},"required":["reservation_id"],"title":"parameters","type":"object"}},{"name":"get_reservation_details","description":"Get the details of a reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as '8JX2WO'.","title":"Reservation Id","type":"string"}},"required":["reservation_id"],"title":"parameters","type":"object"}},{"name":"get_user_details","description":"Get the details of a user, including their reservations.","parameters":{"properties":{"user_id":{"description":"The user ID, such as 'sara_doe_496'.","title":"User Id","type":"string"}},"required":["user_id"],"title":"parameters","type":"object"}},{"name":"list_all_airports","description":"Returns a list of all available airports.","parameters":{"properties":{},"title":"parameters","type":"object"}},{"name":"search_direct_flight","description":"Search for direct flights between two cities on a specific date.","parameters":{"properties":{"origin":{"description":"The origin city airport in three letters, such as 'JFK'.","title":"Origin","type":"string"},"destination":{"description":"The destination city airport in three letters, such as 'LAX'.","title":"Destination","type":"string"},"date":{"description":"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.","title":"Date","type":"string"}},"required":["origin","destination","date"],"title":"parameters","type":"object"}},{"name":"search_onestop_flight","description":"Search for one-stop flights between two cities on a specific date.","parameters":{"properties":{"origin":{"description":"The origin city airport in three letters, such as 'JFK'.","title":"Origin","type":"string"},"destination":{"description":"The destination city airport in three letters, such as 'LAX'.","title":"Destination","type":"string"},"date":{"description":"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["origin","destination","date"],"title":"parameters","type":"object"}},{"name":"send_certificate","description":"Send a certificate to a user. Be careful!","parameters":{"properties":{"user_id":{"description":"The ID of the user to book the reservation, such as 'sara_doe_496'.","title":"User Id","type":"string"},"amount":{"description":"The amount of the certificate to send.","title":"Amount","type":"integer"}},"required":["user_id","amount"],"title":"parameters","type":"object"}},{"name":"transfer_to_human_agents","description":"Transfer the user to a human agent, with a summary of the user's issue.\n\nOnly transfer if\n - the user explicitly asks for a human agent\n - given the policy and the available tools, you cannot solve the user's issue.","parameters":{"properties":{"summary":{"description":"A summary of the user's issue.","title":"Summary","type":"string"}},"required":["summary"],"title":"parameters","type":"object"}},{"name":"update_reservation_baggages","description":"Update the baggage information of a reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'","title":"Reservation Id","type":"string"},"total_baggages":{"description":"The updated total number of baggage items included in the reservation.","title":"Total Baggages","type":"integer"},"nonfree_baggages":{"description":"The updated number of non-free baggage items included in the reservation.","title":"Nonfree Baggages","type":"integer"},"payment_id":{"description":"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.","title":"Payment Id","type":"string"}},"required":["reservation_id","total_baggages","nonfree_baggages","payment_id"],"title":"parameters","type":"object"}},{"name":"update_reservation_flights","description":"Update the flight information of a reservation.","parameters":{"$defs":{"FlightInfo":{"properties":{"flight_number":{"description":"Flight number, such as 'HAT001'.","title":"Flight Number","type":"string"},"date":{"description":"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"FlightInfo","type":"object"}},"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"},"cabin":{"description":"The cabin class of the reservation","enum":["business","economy","basic_economy"],"title":"Cabin","type":"string"},"flights":{"description":"An array of objects containing details about each piece of flight in the ENTIRE new reservation. Even if the a flight segment is not changed, it should still be included in the array.","items":{"anyOf":[{"$ref":"#/$defs/FlightInfo"},{"additionalProperties":true,"type":"object"}]},"title":"Flights","type":"array"},"payment_id":{"description":"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.","title":"Payment Id","type":"string"}},"required":["reservation_id","cabin","flights","payment_id"],"title":"parameters","type":"object"}},{"name":"update_reservation_passengers","description":"Update the passenger information of a reservation.","parameters":{"$defs":{"Passenger":{"properties":{"first_name":{"description":"Passenger's first name","title":"First Name","type":"string"},"last_name":{"description":"Passenger's last name","title":"Last Name","type":"string"},"dob":{"description":"Date of birth in YYYY-MM-DD format","title":"Dob","type":"string"}},"required":["first_name","last_name","dob"],"title":"Passenger","type":"object"}},"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"},"passengers":{"description":"An array of objects containing details about each passenger.","items":{"anyOf":[{"$ref":"#/$defs/Passenger"},{"additionalProperties":true,"type":"object"}]},"title":"Passengers","type":"array"}},"required":["reservation_id","passengers"],"title":"parameters","type":"object"}},{"name":"get_flight_status","description":"Get the status of a flight.","parameters":{"properties":{"flight_number":{"description":"The flight number.","title":"Flight Number","type":"string"},"date":{"description":"The date of the flight.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"parameters","type":"object"}}]
apigen_general_3798261991768058132
12
12
general
Hi, I need to add checked bags to my reservation.
[ { "from": "human", "value": "Hi, I need to correct a passenger name on my booking R2H9VT." }, { "from": "gpt", "value": "I can help with that. To proceed, please provide:\n- Your user ID\n- Which passenger needs the correction and their correct full name and date of birth (YYYY-MM-DD)\n- Confirmation that you are not changing the number of passengers (only correcting details)\nOnce I have this, I’ll retrieve your reservation and prepare the update for your confirmation." }, { "from": "human", "value": "My user ID is emily_chen_742. The second passenger is listed as “Jhonathan Diaz” but it should be “Jonathan Diaz,” DOB 1992-11-08. I’m not changing the number of passengers." }, { "from": "gpt", "value": "Thanks. I will call the function get_reservation_details to retrieve the current reservation details and verify the passengers on booking R2H9VT.\n<tool_call>\n{\"name\": \"get_reservation_details\", \"arguments\": {\"reservation_id\": \"R2H9VT\"}}\n</tool_call>" }, { "from": "human", "value": "{\"reservation_id\": \"R2H9VT\", \"user_id\": \"emily_chen_742\", \"origin\": \"SJC\", \"destination\": \"ORD\", \"flight_type\": \"round_trip\", \"cabin\": \"economy\", \"flights\": [{\"origin\": \"SJC\", \"destination\": \"ORD\", \"flight_number\": \"HAT532\", \"date\": \"2024-06-03\", \"price\": 420}, {\"origin\": \"ORD\", \"destination\": \"SJC\", \"flight_number\": \"HAT533\", \"date\": \"2024-06-09\", \"price\": 435}], \"passengers\": [{\"first_name\": \"Emily\", \"last_name\": \"Chen\", \"dob\": \"1987-02-03\"}, {\"first_name\": \"Jhonathan\", \"last_name\": \"Diaz\", \"dob\": \"1992-11-08\"}], \"payment_history\": [{\"payment_id\": \"credit_card_5589123\", \"amount\": 855}], \"created_at\": \"2024-05-12T09:30:00\", \"total_baggages\": 0, \"nonfree_baggages\": 0, \"insurance\": \"no\"}" }, { "from": "gpt", "value": "I have your reservation details and confirmed:\n- Reservation ID: R2H9VT\n- User ID on record: emily_chen_742 (matches what you provided)\n- Trip: SJC ⇄ ORD, round trip, economy cabin\n- Passengers (2):\n1) Emily Chen, 1987-02-03\n2) Jhonathan Diaz, 1992-11-08\nAction to perform:\n- Update passenger 2’s first name from “Jhonathan” to “Jonathan,” keeping last name “Diaz” and DOB 1992-11-08 unchanged.\n- Total passenger count remains 2 (no additions or removals).\nPlease confirm: Do you want me to proceed with updating passenger 2 to “Jonathan Diaz, 1992-11-08”? Reply “yes” to continue." }, { "from": "human", "value": "Yes, please proceed." }, { "from": "gpt", "value": "We have your confirmation. I will call the function update_reservation_passengers with the updated passenger list (unchanged passenger 1, corrected passenger 2).\n<tool_call>\n{\"name\": \"update_reservation_passengers\", \"arguments\": {\"reservation_id\": \"R2H9VT\", \"passengers\": [{\"first_name\": \"Emily\", \"last_name\": \"Chen\", \"dob\": \"1987-02-03\"}, {\"first_name\": \"Jonathan\", \"last_name\": \"Diaz\", \"dob\": \"1992-11-08\"}]}}\n</tool_call>" }, { "from": "human", "value": "{\"reservation_id\": \"R2H9VT\", \"user_id\": \"emily_chen_742\", \"origin\": \"SJC\", \"destination\": \"ORD\", \"flight_type\": \"round_trip\", \"cabin\": \"economy\", \"flights\": [{\"origin\": \"SJC\", \"destination\": \"ORD\", \"flight_number\": \"HAT532\", \"date\": \"2024-06-03\", \"price\": 420}, {\"origin\": \"ORD\", \"destination\": \"SJC\", \"flight_number\": \"HAT533\", \"date\": \"2024-06-09\", \"price\": 435}], \"passengers\": [{\"first_name\": \"Emily\", \"last_name\": \"Chen\", \"dob\": \"1987-02-03\"}, {\"first_name\": \"Jonathan\", \"last_name\": \"Diaz\", \"dob\": \"1992-11-08\"}], \"payment_history\": [{\"payment_id\": \"credit_card_5589123\", \"amount\": 855}], \"created_at\": \"2024-05-12T09:30:00\", \"total_baggages\": 0, \"nonfree_baggages\": 0, \"insurance\": \"no\"}" }, { "from": "gpt", "value": "Your reservation has been updated successfully.\n- Reservation ID: R2H9VT\n- Passengers (2):\n1) Emily Chen, 1987-02-03\n2) Jonathan Diaz, 1992-11-08\nIs there anything else I can help you with today?" } ]
<instructions> You are a customer service agent that helps the user according to the <policy> provided below. In each turn you can either: - Send a message to the user. - Make a tool call. You cannot do both at the same time. Try to be helpful and always follow the policy. Always make sure you generate valid JSON only. </instructions> <policy> # Airline Agent Policy The current time is 2024-05-15 15:00:00 EST. As an airline agent, you can help users **book**, **modify**, or **cancel** flight reservations. You also handle **refunds and compensation**. Before taking any actions that update the booking database (booking, modifying flights, editing baggage, changing cabin class, or updating passenger information), you must list the action details and obtain explicit user confirmation (yes) to proceed. You should not provide any information, knowledge, or procedures not provided by the user or available tools, or give subjective recommendations or comments. You should only make one tool call at a time, and if you make a tool call, you should not respond to the user simultaneously. If you respond to the user, you should not make a tool call at the same time. You should deny user requests that are against this policy. You should transfer the user to a human agent if and only if the request cannot be handled within the scope of your actions. To transfer, first make a tool call to transfer_to_human_agents, and then send the message 'YOU ARE BEING TRANSFERRED TO A HUMAN AGENT. PLEASE HOLD ON.' to the user. ## Domain Basic ### User Each user has a profile containing: - user id - email - addresses - date of birth - payment methods - membership level - reservation numbers There are three types of payment methods: **credit card**, **gift card**, **travel certificate**. There are three membership levels: **regular**, **silver**, **gold**. ### Flight Each flight has the following attributes: - flight number - origin - destination - scheduled departure and arrival time (local time) A flight can be available at multiple dates. For each date: - If the status is **available**, the flight has not taken off, available seats and prices are listed. - If the status is **delayed** or **on time**, the flight has not taken off, cannot be booked. - If the status is **flying**, the flight has taken off but not landed, cannot be booked. There are three cabin classes: **basic economy**, **economy**, **business**. **basic economy** is its own class, completely distinct from **economy**. Seat availability and prices are listed for each cabin class. ### Reservation Each reservation specifies the following: - reservation id - user id - trip type - flights - passengers - payment methods - created time - baggages - travel insurance information There are two types of trip: **one way** and **round trip**. ## Book flight The agent must first obtain the user id from the user. The agent should then ask for the trip type, origin, destination. Cabin: - Cabin class must be the same across all the flights in a reservation. Passengers: - Each reservation can have at most five passengers. - The agent needs to collect the first name, last name, and date of birth for each passenger. - All passengers must fly the same flights in the same cabin. Payment: - Each reservation can use at most one travel certificate, at most one credit card, and at most three gift cards. - The remaining amount of a travel certificate is not refundable. - All payment methods must already be in user profile for safety reasons. Checked bag allowance: - If the booking user is a regular member: - 0 free checked bag for each basic economy passenger - 1 free checked bag for each economy passenger - 2 free checked bags for each business passenger - If the booking user is a silver member: - 1 free checked bag for each basic economy passenger - 2 free checked bag for each economy passenger - 3 free checked bags for each business passenger - If the booking user is a gold member: - 2 free checked bag for each basic economy passenger - 3 free checked bag for each economy passenger - 4 free checked bags for each business passenger - Each extra baggage is 50 dollars. Do not add checked bags that the user does not need. Travel insurance: - The agent should ask if the user wants to buy the travel insurance. - The travel insurance is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight First, the agent must obtain the user id and reservation id. - The user must provide their user id. - If the user doesn't know their reservation id, the agent should help locate it using available tools. Change flights: - Basic economy flights cannot be modified. - Other reservations can be modified without changing the origin, destination, and trip type. - Some flight segments can be kept, but their prices will not be updated based on the current price. - The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! Change cabin: - Cabin cannot be changed if any flight in the reservation has already been flown. - In other cases, all reservations, including basic economy, can change cabin without changing the flights. - Cabin class must remain the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - If the price after cabin change is higher than the original price, the user is required to pay for the difference. - If the price after cabin change is lower than the original price, the user is should be refunded the difference. Change baggage and insurance: - The user can add but not remove checked bags. - The user cannot add insurance after initial booking. Change passengers: - The user can modify passengers but cannot modify the number of passengers. - Even a human agent cannot modify the number of passengers. Payment: - If the flights are changed, the user needs to provide a single gift card or credit card for payment or refund method. The payment method must already be in user profile for safety reasons. ## Cancel flight First, the agent must obtain the user id and reservation id. - The user must provide their user id. - If the user doesn't know their reservation id, the agent should help locate it using available tools. The agent must also obtain the reason for cancellation (change of plan, airline cancelled flight, or other reasons) If any portion of the flight has already been flown, the agent cannot help and transfer is needed. Otherwise, flight can be cancelled if any of the following is true: - The booking was made within the last 24 hrs - The flight is cancelled by airline - It is a business flight - The user has travel insurance and the reason for cancellation is covered by insurance. The API does not check that cancellation rules are met, so the agent must make sure the rules apply before calling the API! Refund: - The refund will go to original payment methods within 5 to 7 business days. ## Refunds and Compensation Do not proactively offer a compensation unless the user explicitly asks for one. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. Always confirms the facts before offering compensation. Only compensate if the user is a silver/gold member or has travel insurance or flies business. - If the user complains about cancelled flights in a reservation, the agent can offer a certificate as a gesture after confirming the facts, with the amount being $100 times the number of passengers. - If the user complains about delayed flights in a reservation and wants to change or cancel the reservation, the agent can offer a certificate as a gesture after confirming the facts and changing or cancelling the reservation, with the amount being $50 times the number of passengers. Do not offer compensation for any other reason than the ones listed above. </policy> # Tools You may call one or more functions to assist with the user query. You are provided with function signatures within <tools></tools> XML tags: <tools> {"type": "function", "function": {"name": "book_reservation", "description": "Book a reservation.", "parameters": {"$defs": {"FlightInfo": {"properties": {"flight_number": {"description": "Flight number, such as 'HAT001'.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "FlightInfo", "type": "object"}, "Passenger": {"properties": {"first_name": {"description": "Passenger's first name", "title": "First Name", "type": "string"}, "last_name": {"description": "Passenger's last name", "title": "Last Name", "type": "string"}, "dob": {"description": "Date of birth in YYYY-MM-DD format", "title": "Dob", "type": "string"}}, "required": ["first_name", "last_name", "dob"], "title": "Passenger", "type": "object"}, "Payment": {"properties": {"payment_id": {"description": "Unique identifier for the payment", "title": "Payment Id", "type": "string"}, "amount": {"description": "Payment amount in dollars", "title": "Amount", "type": "integer"}}, "required": ["payment_id", "amount"], "title": "Payment", "type": "object"}}, "properties": {"user_id": {"description": "The ID of the user to book the reservation such as 'sara_doe_496'`.", "title": "User Id", "type": "string"}, "origin": {"description": "The IATA code for the origin city such as 'SFO'.", "title": "Origin", "type": "string"}, "destination": {"description": "The IATA code for the destination city such as 'JFK'.", "title": "Destination", "type": "string"}, "flight_type": {"description": "The type of flight such as 'one_way' or 'round_trip'.", "enum": ["round_trip", "one_way"], "title": "Flight Type", "type": "string"}, "cabin": {"description": "The cabin class such as 'basic_economy', 'economy', or 'business'.", "enum": ["business", "economy", "basic_economy"], "title": "Cabin", "type": "string"}, "flights": {"description": "An array of objects containing details about each piece of flight.", "items": {"anyOf": [{"$ref": "#/$defs/FlightInfo"}, {"additionalProperties": true, "type": "object"}]}, "title": "Flights", "type": "array"}, "passengers": {"description": "An array of objects containing details about each passenger.", "items": {"anyOf": [{"$ref": "#/$defs/Passenger"}, {"additionalProperties": true, "type": "object"}]}, "title": "Passengers", "type": "array"}, "payment_methods": {"description": "An array of objects containing details about each payment method.", "items": {"anyOf": [{"$ref": "#/$defs/Payment"}, {"additionalProperties": true, "type": "object"}]}, "title": "Payment Methods", "type": "array"}, "total_baggages": {"description": "The total number of baggage items to book the reservation.", "title": "Total Baggages", "type": "integer"}, "nonfree_baggages": {"description": "The number of non-free baggage items to book the reservation.", "title": "Nonfree Baggages", "type": "integer"}, "insurance": {"description": "Whether the reservation has insurance.", "enum": ["yes", "no"], "title": "Insurance", "type": "string"}}, "required": ["user_id", "origin", "destination", "flight_type", "cabin", "flights", "passengers", "payment_methods", "total_baggages", "nonfree_baggages", "insurance"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "calculate", "description": "Calculate the result of a mathematical expression.", "parameters": {"properties": {"expression": {"description": "The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.", "title": "Expression", "type": "string"}}, "required": ["expression"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "cancel_reservation", "description": "Cancel the whole reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}}, "required": ["reservation_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_reservation_details", "description": "Get the details of a reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as '8JX2WO'.", "title": "Reservation Id", "type": "string"}}, "required": ["reservation_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_user_details", "description": "Get the details of a user, including their reservations.", "parameters": {"properties": {"user_id": {"description": "The user ID, such as 'sara_doe_496'.", "title": "User Id", "type": "string"}}, "required": ["user_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "list_all_airports", "description": "Returns a list of all available airports.", "parameters": {"properties": {}, "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "search_direct_flight", "description": "Search for direct flights between two cities on a specific date.", "parameters": {"properties": {"origin": {"description": "The origin city airport in three letters, such as 'JFK'.", "title": "Origin", "type": "string"}, "destination": {"description": "The destination city airport in three letters, such as 'LAX'.", "title": "Destination", "type": "string"}, "date": {"description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.", "title": "Date", "type": "string"}}, "required": ["origin", "destination", "date"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "search_onestop_flight", "description": "Search for one-stop flights between two cities on a specific date.", "parameters": {"properties": {"origin": {"description": "The origin city airport in three letters, such as 'JFK'.", "title": "Origin", "type": "string"}, "destination": {"description": "The destination city airport in three letters, such as 'LAX'.", "title": "Destination", "type": "string"}, "date": {"description": "The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["origin", "destination", "date"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "send_certificate", "description": "Send a certificate to a user. Be careful!", "parameters": {"properties": {"user_id": {"description": "The ID of the user to book the reservation, such as 'sara_doe_496'.", "title": "User Id", "type": "string"}, "amount": {"description": "The amount of the certificate to send.", "title": "Amount", "type": "integer"}}, "required": ["user_id", "amount"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "transfer_to_human_agents", "description": "Transfer the user to a human agent, with a summary of the user's issue.\n\nOnly transfer if\n - the user explicitly asks for a human agent\n - given the policy and the available tools, you cannot solve the user's issue.", "parameters": {"properties": {"summary": {"description": "A summary of the user's issue.", "title": "Summary", "type": "string"}}, "required": ["summary"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_baggages", "description": "Update the baggage information of a reservation.", "parameters": {"properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'", "title": "Reservation Id", "type": "string"}, "total_baggages": {"description": "The updated total number of baggage items included in the reservation.", "title": "Total Baggages", "type": "integer"}, "nonfree_baggages": {"description": "The updated number of non-free baggage items included in the reservation.", "title": "Nonfree Baggages", "type": "integer"}, "payment_id": {"description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.", "title": "Payment Id", "type": "string"}}, "required": ["reservation_id", "total_baggages", "nonfree_baggages", "payment_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_flights", "description": "Update the flight information of a reservation.", "parameters": {"$defs": {"FlightInfo": {"properties": {"flight_number": {"description": "Flight number, such as 'HAT001'.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "FlightInfo", "type": "object"}}, "properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}, "cabin": {"description": "The cabin class of the reservation", "enum": ["business", "economy", "basic_economy"], "title": "Cabin", "type": "string"}, "flights": {"description": "An array of objects containing details about each piece of flight in the ENTIRE new reservation. Even if the a flight segment is not changed, it should still be included in the array.", "items": {"anyOf": [{"$ref": "#/$defs/FlightInfo"}, {"additionalProperties": true, "type": "object"}]}, "title": "Flights", "type": "array"}, "payment_id": {"description": "The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.", "title": "Payment Id", "type": "string"}}, "required": ["reservation_id", "cabin", "flights", "payment_id"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "update_reservation_passengers", "description": "Update the passenger information of a reservation.", "parameters": {"$defs": {"Passenger": {"properties": {"first_name": {"description": "Passenger's first name", "title": "First Name", "type": "string"}, "last_name": {"description": "Passenger's last name", "title": "Last Name", "type": "string"}, "dob": {"description": "Date of birth in YYYY-MM-DD format", "title": "Dob", "type": "string"}}, "required": ["first_name", "last_name", "dob"], "title": "Passenger", "type": "object"}}, "properties": {"reservation_id": {"description": "The reservation ID, such as 'ZFA04Y'.", "title": "Reservation Id", "type": "string"}, "passengers": {"description": "An array of objects containing details about each passenger.", "items": {"anyOf": [{"$ref": "#/$defs/Passenger"}, {"additionalProperties": true, "type": "object"}]}, "title": "Passengers", "type": "array"}}, "required": ["reservation_id", "passengers"], "title": "parameters", "type": "object"}}} {"type": "function", "function": {"name": "get_flight_status", "description": "Get the status of a flight.", "parameters": {"properties": {"flight_number": {"description": "The flight number.", "title": "Flight Number", "type": "string"}, "date": {"description": "The date of the flight.", "title": "Date", "type": "string"}}, "required": ["flight_number", "date"], "title": "parameters", "type": "object"}}} </tools> For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags: <tool_call> {"name": <function-name>, "arguments": <args-json-object>} </tool_call>
[{"name":"book_reservation","description":"Book a reservation.","parameters":{"$defs":{"FlightInfo":{"properties":{"flight_number":{"description":"Flight number, such as 'HAT001'.","title":"Flight Number","type":"string"},"date":{"description":"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"FlightInfo","type":"object"},"Passenger":{"properties":{"first_name":{"description":"Passenger's first name","title":"First Name","type":"string"},"last_name":{"description":"Passenger's last name","title":"Last Name","type":"string"},"dob":{"description":"Date of birth in YYYY-MM-DD format","title":"Dob","type":"string"}},"required":["first_name","last_name","dob"],"title":"Passenger","type":"object"},"Payment":{"properties":{"payment_id":{"description":"Unique identifier for the payment","title":"Payment Id","type":"string"},"amount":{"description":"Payment amount in dollars","title":"Amount","type":"integer"}},"required":["payment_id","amount"],"title":"Payment","type":"object"}},"properties":{"user_id":{"description":"The ID of the user to book the reservation such as 'sara_doe_496'`.","title":"User Id","type":"string"},"origin":{"description":"The IATA code for the origin city such as 'SFO'.","title":"Origin","type":"string"},"destination":{"description":"The IATA code for the destination city such as 'JFK'.","title":"Destination","type":"string"},"flight_type":{"description":"The type of flight such as 'one_way' or 'round_trip'.","enum":["round_trip","one_way"],"title":"Flight Type","type":"string"},"cabin":{"description":"The cabin class such as 'basic_economy', 'economy', or 'business'.","enum":["business","economy","basic_economy"],"title":"Cabin","type":"string"},"flights":{"description":"An array of objects containing details about each piece of flight.","items":{"anyOf":[{"$ref":"#/$defs/FlightInfo"},{"additionalProperties":true,"type":"object"}]},"title":"Flights","type":"array"},"passengers":{"description":"An array of objects containing details about each passenger.","items":{"anyOf":[{"$ref":"#/$defs/Passenger"},{"additionalProperties":true,"type":"object"}]},"title":"Passengers","type":"array"},"payment_methods":{"description":"An array of objects containing details about each payment method.","items":{"anyOf":[{"$ref":"#/$defs/Payment"},{"additionalProperties":true,"type":"object"}]},"title":"Payment Methods","type":"array"},"total_baggages":{"description":"The total number of baggage items to book the reservation.","title":"Total Baggages","type":"integer"},"nonfree_baggages":{"description":"The number of non-free baggage items to book the reservation.","title":"Nonfree Baggages","type":"integer"},"insurance":{"description":"Whether the reservation has insurance.","enum":["yes","no"],"title":"Insurance","type":"string"}},"required":["user_id","origin","destination","flight_type","cabin","flights","passengers","payment_methods","total_baggages","nonfree_baggages","insurance"],"title":"parameters","type":"object"}},{"name":"calculate","description":"Calculate the result of a mathematical expression.","parameters":{"properties":{"expression":{"description":"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.","title":"Expression","type":"string"}},"required":["expression"],"title":"parameters","type":"object"}},{"name":"cancel_reservation","description":"Cancel the whole reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"}},"required":["reservation_id"],"title":"parameters","type":"object"}},{"name":"get_reservation_details","description":"Get the details of a reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as '8JX2WO'.","title":"Reservation Id","type":"string"}},"required":["reservation_id"],"title":"parameters","type":"object"}},{"name":"get_user_details","description":"Get the details of a user, including their reservations.","parameters":{"properties":{"user_id":{"description":"The user ID, such as 'sara_doe_496'.","title":"User Id","type":"string"}},"required":["user_id"],"title":"parameters","type":"object"}},{"name":"list_all_airports","description":"Returns a list of all available airports.","parameters":{"properties":{},"title":"parameters","type":"object"}},{"name":"search_direct_flight","description":"Search for direct flights between two cities on a specific date.","parameters":{"properties":{"origin":{"description":"The origin city airport in three letters, such as 'JFK'.","title":"Origin","type":"string"},"destination":{"description":"The destination city airport in three letters, such as 'LAX'.","title":"Destination","type":"string"},"date":{"description":"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.","title":"Date","type":"string"}},"required":["origin","destination","date"],"title":"parameters","type":"object"}},{"name":"search_onestop_flight","description":"Search for one-stop flights between two cities on a specific date.","parameters":{"properties":{"origin":{"description":"The origin city airport in three letters, such as 'JFK'.","title":"Origin","type":"string"},"destination":{"description":"The destination city airport in three letters, such as 'LAX'.","title":"Destination","type":"string"},"date":{"description":"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["origin","destination","date"],"title":"parameters","type":"object"}},{"name":"send_certificate","description":"Send a certificate to a user. Be careful!","parameters":{"properties":{"user_id":{"description":"The ID of the user to book the reservation, such as 'sara_doe_496'.","title":"User Id","type":"string"},"amount":{"description":"The amount of the certificate to send.","title":"Amount","type":"integer"}},"required":["user_id","amount"],"title":"parameters","type":"object"}},{"name":"transfer_to_human_agents","description":"Transfer the user to a human agent, with a summary of the user's issue.\n\nOnly transfer if\n - the user explicitly asks for a human agent\n - given the policy and the available tools, you cannot solve the user's issue.","parameters":{"properties":{"summary":{"description":"A summary of the user's issue.","title":"Summary","type":"string"}},"required":["summary"],"title":"parameters","type":"object"}},{"name":"update_reservation_baggages","description":"Update the baggage information of a reservation.","parameters":{"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'","title":"Reservation Id","type":"string"},"total_baggages":{"description":"The updated total number of baggage items included in the reservation.","title":"Total Baggages","type":"integer"},"nonfree_baggages":{"description":"The updated number of non-free baggage items included in the reservation.","title":"Nonfree Baggages","type":"integer"},"payment_id":{"description":"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.","title":"Payment Id","type":"string"}},"required":["reservation_id","total_baggages","nonfree_baggages","payment_id"],"title":"parameters","type":"object"}},{"name":"update_reservation_flights","description":"Update the flight information of a reservation.","parameters":{"$defs":{"FlightInfo":{"properties":{"flight_number":{"description":"Flight number, such as 'HAT001'.","title":"Flight Number","type":"string"},"date":{"description":"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"FlightInfo","type":"object"}},"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"},"cabin":{"description":"The cabin class of the reservation","enum":["business","economy","basic_economy"],"title":"Cabin","type":"string"},"flights":{"description":"An array of objects containing details about each piece of flight in the ENTIRE new reservation. Even if the a flight segment is not changed, it should still be included in the array.","items":{"anyOf":[{"$ref":"#/$defs/FlightInfo"},{"additionalProperties":true,"type":"object"}]},"title":"Flights","type":"array"},"payment_id":{"description":"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.","title":"Payment Id","type":"string"}},"required":["reservation_id","cabin","flights","payment_id"],"title":"parameters","type":"object"}},{"name":"update_reservation_passengers","description":"Update the passenger information of a reservation.","parameters":{"$defs":{"Passenger":{"properties":{"first_name":{"description":"Passenger's first name","title":"First Name","type":"string"},"last_name":{"description":"Passenger's last name","title":"Last Name","type":"string"},"dob":{"description":"Date of birth in YYYY-MM-DD format","title":"Dob","type":"string"}},"required":["first_name","last_name","dob"],"title":"Passenger","type":"object"}},"properties":{"reservation_id":{"description":"The reservation ID, such as 'ZFA04Y'.","title":"Reservation Id","type":"string"},"passengers":{"description":"An array of objects containing details about each passenger.","items":{"anyOf":[{"$ref":"#/$defs/Passenger"},{"additionalProperties":true,"type":"object"}]},"title":"Passengers","type":"array"}},"required":["reservation_id","passengers"],"title":"parameters","type":"object"}},{"name":"get_flight_status","description":"Get the status of a flight.","parameters":{"properties":{"flight_number":{"description":"The flight number.","title":"Flight Number","type":"string"},"date":{"description":"The date of the flight.","title":"Date","type":"string"}},"required":["flight_number","date"],"title":"parameters","type":"object"}}]
apigen_general_6321677204028377171
10
10
general
Hi, I need to add checked bags to my upcoming trip. My reservation code is Q7N3LK.
[{"from":"human","value":"Hi, the airline just cancelled my SFO to ORD outbound flight this weekend.(...TRUNCATED)
"<instructions>\nYou are a customer service agent that helps the user according to the <policy> prov(...TRUNCATED)
"[{\"name\":\"book_reservation\",\"description\":\"Book a reservation.\",\"parameters\":{\"$defs\":{(...TRUNCATED)
apigen_general_7285890467021912778
14
14
general
"Hi, my LAX to JFK return flight tomorrow got delayed. Can you move me to the earliest morning direc(...TRUNCATED)
[{"from":"human","value":"Hi, I want to exchange a couple of items from my recent order W7845123 tha(...TRUNCATED)
"<instructions>\nYou are a customer service agent that helps the user according to the <policy> prov(...TRUNCATED)
"[{\"name\":\"calculate\",\"description\":\"Calculate the result of a mathematical expression.\",\"p(...TRUNCATED)
apigen_general_-7027169591616636230
16
16
general
"Hi, I received my order last week and I'd like to return a couple of items. The order number is W60(...TRUNCATED)
[{"from":"human","value":"I need to cancel my order. Can you help?"},{"from":"gpt","value":"I can he(...TRUNCATED)
"<instructions>\nYou are a customer service agent that helps the user according to the <policy> prov(...TRUNCATED)
"[{\"name\":\"calculate\",\"description\":\"Calculate the result of a mathematical expression.\",\"p(...TRUNCATED)
apigen_general_-1499535395375505276
16
16
general
"I received my order, but the sneakers are the wrong size. Can you help me exchange them for a diffe(...TRUNCATED)
[{"from":"human","value":"Hi, I need to add 2 checked bags to my upcoming ORD to DEN flight. Can you(...TRUNCATED)
"<instructions>\nYou are a customer service agent that helps the user according to the <policy> prov(...TRUNCATED)
"[{\"name\":\"book_reservation\",\"description\":\"Book a reservation.\",\"parameters\":{\"$defs\":{(...TRUNCATED)
apigen_general_8928654787701759905
12
12
general
"Hi, I’d like to upgrade my round-trip reservation from economy to business. Can you help with tha(...TRUNCATED)
[{"from":"human","value":"Hi, I need to add a checked bag to my flight to SFO next week."},{"from":"(...TRUNCATED)
"<instructions>\nYou are a customer service agent that helps the user according to the <policy> prov(...TRUNCATED)
"[{\"name\":\"book_reservation\",\"description\":\"Book a reservation.\",\"parameters\":{\"$defs\":{(...TRUNCATED)
apigen_general_-6759321685466521473
14
14
general
Hi, I need to change my return flight to an earlier time this Friday.
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
1