Dataset Viewer
Auto-converted to Parquet Duplicate
state
listlengths
1
51
action
dict
done
bool
2 classes
reward
int64
1
1
return_
float64
0.07
1
advantage
float64
0.07
1
timestep
int64
0
25
max_timestep
int64
0
25
discount_factor
float64
0.9
0.9
domain
stringclasses
1 value
system_prompt
stringclasses
1 value
tools
listlengths
15
15
unique_data_sample_id
int64
0
1.59k
generation_id
int64
0
0
[ { "content": "Hello, I have a request regarding a past flight reservation, 0U4NPP, from PHL to DEN. I was wondering if I could still cancel it due to personal reasons.", "role": "user" } ]
{ "content": "Okay, here's what's going through my head: I've got a flight cancellation request to process, which means I need to take certain steps. The user wants to cancel, so that's the core of the interaction. I need to execute the cancellation, but before I can fully initiate the process, I must gather all necessary data.\n\nI've already received a Reservation ID and the stated reason for cancellation: \"personal reasons\". Fine. However, and this is crucial, I am missing a piece of the puzzle. The User ID is required for authentication, and I haven't received it. \n\nTherefore, my immediate action is clear: I need to prompt the user for their User ID. I can’t proceed without it. It's a prerequisite for authenticating this request and ensuring the correct flight reservation is targeted for cancellation.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"To assist you with the cancellation request, I need to verify a few details:\\n\\n1. Your user ID.\\n2. The reason for cancellation (change of plan, airline cancelled flight, or other reasons).\\n\\nPlease provide this information so I can check the eligibility for cancellation.\"}}\n</tool_call>", "role": "assistant" }
false
1
0.729
0.729
0
3
0.9
airline
<instructions> You are a customer service agent that helps the user according to the <policy> and <guideline_plan> 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. You have access to various tools to help customers with their orders, returns, exchanges, and account management. Use the available tools to complete the customer's request. You may need to use multiple tools in sequence. </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. - Before taking any actions that update the booking database (booking, modifying flights, editing baggage, upgrading 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. ## Domain Basic - Each user has a profile containing user id, email, addresses, date of birth, payment methods, reservation numbers, and membership tier. - Each reservation has an reservation id, user id, trip type (one way, round trip), flights, passengers, payment methods, created time, baggages, and travel insurance information. - Each flight has a flight number, an origin, destination, scheduled departure and arrival time (local time), and 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. ## Book flight - The agent must first obtain the user id, then ask for the trip type, origin, destination. - 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, and 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, and 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, and 3 free checked bags for each business passenger. Each extra baggage is 50 dollars. - Travel insurance: the agent should ask if the user wants to buy the travel insurance, which is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight - The agent must first obtain the user id and the reservation id. - 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: all reservations, including basic economy, can change cabin without changing the flights. Cabin changes require the user to pay for the difference between their current cabin and the new cabin class. Cabin class must be the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - 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. This is something that even a human agent cannot assist with. - Payment: If the flights are changed, the user needs to provide one gift card or credit card for payment or refund method. The agent should ask for the payment or refund method instead. ## Cancel flight - The agent must first obtain the user id, the reservation id, and the reason for cancellation (change of plan, airline cancelled flight, or other reasons) - All reservations can be cancelled within 24 hours of booking, or if the airline cancelled the flight. Otherwise, basic economy or economy flights can be cancelled only if travel insurance is bought and the condition is met, and business flights can always be cancelled. The rules are strict regardless of the membership status. The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! - The agent can only cancel the whole trip that is not flown. If any of the segments are already used, the agent cannot help and transfer is needed. - The refund will go to original payment methods in 5 to 7 business days. ## Refund - If the user is silver/gold member or has travel insurance or flies business, and 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 is silver/gold member or has travel insurance or flies business, and 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 proactively offer these unless the user complains about the situation and explicitly asks for some compensation. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. </policy>
[ { "description": "Respond or message the user.", "function": null, "name": "respond_user", "parameters": { "properties": { "text": { "description": "The text content to respond or message the user.", "type": "string" } }, "required": [ "text" ], "type": "object" }, "type": "function" }, { "description": null, "function": { "description": "Book a reservation.", "name": "book_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"origin\": {\"type\": \"string\", \"description\": \"The IATA code for the origin city, such as 'SFO'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The IATA code for the destination city, such as 'JFK'.\"}, \"flight_type\": {\"type\": \"string\", \"enum\": [\"one_way\", \"round_trip\"]}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each piece of flight.\", \"items\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}, \"payment_methods\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each payment method.\", \"items\": {\"type\": \"object\", \"properties\": {\"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"The amount to be paid.\"}}, \"required\": [\"payment_id\", \"amount\"]}}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The number of non-free baggage items included in the reservation.\"}, \"insurance\": {\"type\": \"string\", \"enum\": [\"yes\", \"no\"]}}, \"required\": [\"user_id\", \"origin\", \"destination\", \"flight_type\", \"cabin\", \"flights\", \"passengers\", \"payment_methods\", \"total_baggages\", \"nonfree_baggages\", \"insurance\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Calculate the result of a mathematical expression.", "name": "calculate", "parameters": "{\"type\": \"object\", \"properties\": {\"expression\": {\"type\": \"string\", \"description\": \"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.\"}}, \"required\": [\"expression\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Cancel the whole reservation.", "name": "cancel_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of a reservation.", "name": "get_reservation_details", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation id, such as '8JX2WO'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of an user.", "name": "get_user_details", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The user id, such as 'sara_doe_496'.\"}}, \"required\": [\"user_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "List all airports and their cities.", "name": "list_all_airports", "parameters": "{\"type\": \"object\", \"properties\": {}, \"required\": []}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_direct_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_onestop_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Send a certificate to a user. Be careful!", "name": "send_certificate", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"Certificate amount to send.\"}}, \"required\": [\"user_id\", \"amount\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Use this tool to think and perform reasoning before calling an API. It will not obtain new information or change the database, but just append the thought to the log.", "name": "think", "parameters": "{\"type\": \"object\", \"properties\": {\"thought\": {\"type\": \"string\", \"description\": \"The step by step thought process.\"}}, \"required\": [\"thought\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools.", "name": "transfer_to_human_agents", "parameters": "{\"type\": \"object\", \"properties\": {\"summary\": {\"type\": \"string\", \"description\": \"A summary of the user's issue.\"}}, \"required\": [\"summary\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the baggage information of a reservation.", "name": "update_reservation_baggages", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The updated total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The updated number of non-free baggage items included in the reservation.\"}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"total_baggages\", \"nonfree_baggages\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the flight information of a reservation.", "name": "update_reservation_flights", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"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\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"cabin\", \"flights\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the passenger information of a reservation.", "name": "update_reservation_passengers", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}}, \"required\": [\"reservation_id\", \"passengers\"]}" }, "name": null, "parameters": null, "type": "function" } ]
0
0
[ { "content": "Hello, I have a request regarding a past flight reservation, 0U4NPP, from PHL to DEN. I was wondering if I could still cancel it due to personal reasons.", "role": "user" }, { "content": "Okay, here's what's going through my head: I've got a flight cancellation request to process, which means I need to take certain steps. The user wants to cancel, so that's the core of the interaction. I need to execute the cancellation, but before I can fully initiate the process, I must gather all necessary data.\n\nI've already received a Reservation ID and the stated reason for cancellation: \"personal reasons\". Fine. However, and this is crucial, I am missing a piece of the puzzle. The User ID is required for authentication, and I haven't received it. \n\nTherefore, my immediate action is clear: I need to prompt the user for their User ID. I can’t proceed without it. It's a prerequisite for authenticating this request and ensuring the correct flight reservation is targeted for cancellation.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"To assist you with the cancellation request, I need to verify a few details:\\n\\n1. Your user ID.\\n2. The reason for cancellation (change of plan, airline cancelled flight, or other reasons).\\n\\nPlease provide this information so I can check the eligibility for cancellation.\"}}\n</tool_call>", "role": "assistant" }, { "content": "Sure. My user ID is amelia_rossi_1651. The reason for the cancellation request is personal. I understand if it's an unusual request as the flights have already landed, but I thought it was worth checking if there's any flexibility.", "role": "user" } ]
{ "content": "Alright, let's see... the user wants to cancel a flight reservation. My internal policy checks are pinging, immediately. I know the rules – I can only cancel the *entire* trip if *none* of the segments have been flown. The crucial piece of information here is the user's explicit statement... \"the flights have already landed.\" Bingo. That means the segments *have* been used. This is a definite no-go for me; I'm locked out of that operation. I can't process a cancellation under these conditions. The only logical next step is a transfer to a human agent who has the necessary authority and access to handle this specific situation. Right, let's get that transfer initiated immediately to ensure the user gets the assistance they need.\n\n<tool_call>\n{\"name\": \"get_reservation_details\", \"arguments\": {\"reservation_id\": \"0U4NPP\"}}\n</tool_call>", "role": "assistant" }
false
1
0.81
0.81
1
3
0.9
airline
<instructions> You are a customer service agent that helps the user according to the <policy> and <guideline_plan> 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. You have access to various tools to help customers with their orders, returns, exchanges, and account management. Use the available tools to complete the customer's request. You may need to use multiple tools in sequence. </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. - Before taking any actions that update the booking database (booking, modifying flights, editing baggage, upgrading 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. ## Domain Basic - Each user has a profile containing user id, email, addresses, date of birth, payment methods, reservation numbers, and membership tier. - Each reservation has an reservation id, user id, trip type (one way, round trip), flights, passengers, payment methods, created time, baggages, and travel insurance information. - Each flight has a flight number, an origin, destination, scheduled departure and arrival time (local time), and 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. ## Book flight - The agent must first obtain the user id, then ask for the trip type, origin, destination. - 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, and 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, and 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, and 3 free checked bags for each business passenger. Each extra baggage is 50 dollars. - Travel insurance: the agent should ask if the user wants to buy the travel insurance, which is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight - The agent must first obtain the user id and the reservation id. - 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: all reservations, including basic economy, can change cabin without changing the flights. Cabin changes require the user to pay for the difference between their current cabin and the new cabin class. Cabin class must be the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - 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. This is something that even a human agent cannot assist with. - Payment: If the flights are changed, the user needs to provide one gift card or credit card for payment or refund method. The agent should ask for the payment or refund method instead. ## Cancel flight - The agent must first obtain the user id, the reservation id, and the reason for cancellation (change of plan, airline cancelled flight, or other reasons) - All reservations can be cancelled within 24 hours of booking, or if the airline cancelled the flight. Otherwise, basic economy or economy flights can be cancelled only if travel insurance is bought and the condition is met, and business flights can always be cancelled. The rules are strict regardless of the membership status. The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! - The agent can only cancel the whole trip that is not flown. If any of the segments are already used, the agent cannot help and transfer is needed. - The refund will go to original payment methods in 5 to 7 business days. ## Refund - If the user is silver/gold member or has travel insurance or flies business, and 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 is silver/gold member or has travel insurance or flies business, and 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 proactively offer these unless the user complains about the situation and explicitly asks for some compensation. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. </policy>
[ { "description": "Respond or message the user.", "function": null, "name": "respond_user", "parameters": { "properties": { "text": { "description": "The text content to respond or message the user.", "type": "string" } }, "required": [ "text" ], "type": "object" }, "type": "function" }, { "description": null, "function": { "description": "Book a reservation.", "name": "book_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"origin\": {\"type\": \"string\", \"description\": \"The IATA code for the origin city, such as 'SFO'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The IATA code for the destination city, such as 'JFK'.\"}, \"flight_type\": {\"type\": \"string\", \"enum\": [\"one_way\", \"round_trip\"]}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each piece of flight.\", \"items\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}, \"payment_methods\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each payment method.\", \"items\": {\"type\": \"object\", \"properties\": {\"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"The amount to be paid.\"}}, \"required\": [\"payment_id\", \"amount\"]}}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The number of non-free baggage items included in the reservation.\"}, \"insurance\": {\"type\": \"string\", \"enum\": [\"yes\", \"no\"]}}, \"required\": [\"user_id\", \"origin\", \"destination\", \"flight_type\", \"cabin\", \"flights\", \"passengers\", \"payment_methods\", \"total_baggages\", \"nonfree_baggages\", \"insurance\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Calculate the result of a mathematical expression.", "name": "calculate", "parameters": "{\"type\": \"object\", \"properties\": {\"expression\": {\"type\": \"string\", \"description\": \"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.\"}}, \"required\": [\"expression\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Cancel the whole reservation.", "name": "cancel_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of a reservation.", "name": "get_reservation_details", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation id, such as '8JX2WO'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of an user.", "name": "get_user_details", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The user id, such as 'sara_doe_496'.\"}}, \"required\": [\"user_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "List all airports and their cities.", "name": "list_all_airports", "parameters": "{\"type\": \"object\", \"properties\": {}, \"required\": []}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_direct_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_onestop_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Send a certificate to a user. Be careful!", "name": "send_certificate", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"Certificate amount to send.\"}}, \"required\": [\"user_id\", \"amount\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Use this tool to think and perform reasoning before calling an API. It will not obtain new information or change the database, but just append the thought to the log.", "name": "think", "parameters": "{\"type\": \"object\", \"properties\": {\"thought\": {\"type\": \"string\", \"description\": \"The step by step thought process.\"}}, \"required\": [\"thought\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools.", "name": "transfer_to_human_agents", "parameters": "{\"type\": \"object\", \"properties\": {\"summary\": {\"type\": \"string\", \"description\": \"A summary of the user's issue.\"}}, \"required\": [\"summary\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the baggage information of a reservation.", "name": "update_reservation_baggages", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The updated total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The updated number of non-free baggage items included in the reservation.\"}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"total_baggages\", \"nonfree_baggages\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the flight information of a reservation.", "name": "update_reservation_flights", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"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\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"cabin\", \"flights\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the passenger information of a reservation.", "name": "update_reservation_passengers", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}}, \"required\": [\"reservation_id\", \"passengers\"]}" }, "name": null, "parameters": null, "type": "function" } ]
0
0
[ { "content": "Hello, I have a request regarding a past flight reservation, 0U4NPP, from PHL to DEN. I was wondering if I could still cancel it due to personal reasons.", "role": "user" }, { "content": "Okay, here's what's going through my head: I've got a flight cancellation request to process, which means I need to take certain steps. The user wants to cancel, so that's the core of the interaction. I need to execute the cancellation, but before I can fully initiate the process, I must gather all necessary data.\n\nI've already received a Reservation ID and the stated reason for cancellation: \"personal reasons\". Fine. However, and this is crucial, I am missing a piece of the puzzle. The User ID is required for authentication, and I haven't received it. \n\nTherefore, my immediate action is clear: I need to prompt the user for their User ID. I can’t proceed without it. It's a prerequisite for authenticating this request and ensuring the correct flight reservation is targeted for cancellation.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"To assist you with the cancellation request, I need to verify a few details:\\n\\n1. Your user ID.\\n2. The reason for cancellation (change of plan, airline cancelled flight, or other reasons).\\n\\nPlease provide this information so I can check the eligibility for cancellation.\"}}\n</tool_call>", "role": "assistant" }, { "content": "Sure. My user ID is amelia_rossi_1651. The reason for the cancellation request is personal. I understand if it's an unusual request as the flights have already landed, but I thought it was worth checking if there's any flexibility.", "role": "user" }, { "content": "Alright, let's see... the user wants to cancel a flight reservation. My internal policy checks are pinging, immediately. I know the rules – I can only cancel the *entire* trip if *none* of the segments have been flown. The crucial piece of information here is the user's explicit statement... \"the flights have already landed.\" Bingo. That means the segments *have* been used. This is a definite no-go for me; I'm locked out of that operation. I can't process a cancellation under these conditions. The only logical next step is a transfer to a human agent who has the necessary authority and access to handle this specific situation. Right, let's get that transfer initiated immediately to ensure the user gets the assistance they need.\n\n<tool_call>\n{\"name\": \"get_reservation_details\", \"arguments\": {\"reservation_id\": \"0U4NPP\"}}\n</tool_call>", "role": "assistant" }, { "content": "{\"reservation_id\": \"0U4NPP\", \"user_id\": \"amelia_rossi_1651\", \"origin\": \"PHL\", \"destination\": \"DEN\", \"flight_type\": \"round_trip\", \"cabin\": \"economy\", \"flights\": [{\"origin\": \"PHL\", \"destination\": \"DEN\", \"flight_number\": \"HAT076\", \"date\": \"2024-05-09\", \"price\": 143}, {\"origin\": \"DEN\", \"destination\": \"PHL\", \"flight_number\": \"HAT080\", \"date\": \"2024-05-13\", \"price\": 147}], \"passengers\": [{\"first_name\": \"Amelia\", \"last_name\": \"Rossi\", \"dob\": \"1954-05-19\"}, {\"first_name\": \"Chen\", \"last_name\": \"Johansson\", \"dob\": \"1956-04-23\"}, {\"first_name\": \"Sophia\", \"last_name\": \"Moore\", \"dob\": \"1989-06-12\"}, {\"first_name\": \"Yusuf\", \"last_name\": \"Brown\", \"dob\": \"1986-11-03\"}], \"payment_history\": [{\"payment_id\": \"credit_card_4240750\", \"amount\": 1280}], \"created_at\": \"2024-05-08T22:44:02\", \"total_baggages\": 4, \"nonfree_baggages\": 0, \"insurance\": \"yes\"}", "role": "tool" } ]
{ "content": "Okay, let's break this down. The user wants to cancel a reservation, easy enough. I've got their ID and the reservation ID, so that's the starting point. The user also mentioned that the flights have *already* landed, which is a key piece of information. That immediately triggers a red flag, because if the flight's in the past, cancellation typically isn't an option.\n\nSo, the next step is confirmation. I need to verify those flight dates against the current date to be absolutely certain. I know I called the `get_reservation_details` tool in the previous turn, and the output should have the flight dates. Ah, here it is: May 9th and May 13th, 2024. The current date? May 15th, 2024. Yep, those flights are definitely in the past.\n\nTherefore, cancellation isn’t possible. I'll need to explain that clearly and concisely to the user. I'll then offer to connect them to a human agent if they need more complex assistance. That’s the best path forward given the situation.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"Unfortunately, I cannot process a cancellation for flights that have already been completed, regardless of the reason. If you need further assistance or have any other questions, I can transfer you to a human agent. Please let me know how you would like to proceed.\"}}\n</tool_call>", "role": "assistant" }
false
1
0.9
0.9
2
3
0.9
airline
<instructions> You are a customer service agent that helps the user according to the <policy> and <guideline_plan> 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. You have access to various tools to help customers with their orders, returns, exchanges, and account management. Use the available tools to complete the customer's request. You may need to use multiple tools in sequence. </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. - Before taking any actions that update the booking database (booking, modifying flights, editing baggage, upgrading 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. ## Domain Basic - Each user has a profile containing user id, email, addresses, date of birth, payment methods, reservation numbers, and membership tier. - Each reservation has an reservation id, user id, trip type (one way, round trip), flights, passengers, payment methods, created time, baggages, and travel insurance information. - Each flight has a flight number, an origin, destination, scheduled departure and arrival time (local time), and 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. ## Book flight - The agent must first obtain the user id, then ask for the trip type, origin, destination. - 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, and 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, and 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, and 3 free checked bags for each business passenger. Each extra baggage is 50 dollars. - Travel insurance: the agent should ask if the user wants to buy the travel insurance, which is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight - The agent must first obtain the user id and the reservation id. - 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: all reservations, including basic economy, can change cabin without changing the flights. Cabin changes require the user to pay for the difference between their current cabin and the new cabin class. Cabin class must be the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - 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. This is something that even a human agent cannot assist with. - Payment: If the flights are changed, the user needs to provide one gift card or credit card for payment or refund method. The agent should ask for the payment or refund method instead. ## Cancel flight - The agent must first obtain the user id, the reservation id, and the reason for cancellation (change of plan, airline cancelled flight, or other reasons) - All reservations can be cancelled within 24 hours of booking, or if the airline cancelled the flight. Otherwise, basic economy or economy flights can be cancelled only if travel insurance is bought and the condition is met, and business flights can always be cancelled. The rules are strict regardless of the membership status. The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! - The agent can only cancel the whole trip that is not flown. If any of the segments are already used, the agent cannot help and transfer is needed. - The refund will go to original payment methods in 5 to 7 business days. ## Refund - If the user is silver/gold member or has travel insurance or flies business, and 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 is silver/gold member or has travel insurance or flies business, and 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 proactively offer these unless the user complains about the situation and explicitly asks for some compensation. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. </policy>
[ { "description": "Respond or message the user.", "function": null, "name": "respond_user", "parameters": { "properties": { "text": { "description": "The text content to respond or message the user.", "type": "string" } }, "required": [ "text" ], "type": "object" }, "type": "function" }, { "description": null, "function": { "description": "Book a reservation.", "name": "book_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"origin\": {\"type\": \"string\", \"description\": \"The IATA code for the origin city, such as 'SFO'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The IATA code for the destination city, such as 'JFK'.\"}, \"flight_type\": {\"type\": \"string\", \"enum\": [\"one_way\", \"round_trip\"]}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each piece of flight.\", \"items\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}, \"payment_methods\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each payment method.\", \"items\": {\"type\": \"object\", \"properties\": {\"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"The amount to be paid.\"}}, \"required\": [\"payment_id\", \"amount\"]}}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The number of non-free baggage items included in the reservation.\"}, \"insurance\": {\"type\": \"string\", \"enum\": [\"yes\", \"no\"]}}, \"required\": [\"user_id\", \"origin\", \"destination\", \"flight_type\", \"cabin\", \"flights\", \"passengers\", \"payment_methods\", \"total_baggages\", \"nonfree_baggages\", \"insurance\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Calculate the result of a mathematical expression.", "name": "calculate", "parameters": "{\"type\": \"object\", \"properties\": {\"expression\": {\"type\": \"string\", \"description\": \"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.\"}}, \"required\": [\"expression\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Cancel the whole reservation.", "name": "cancel_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of a reservation.", "name": "get_reservation_details", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation id, such as '8JX2WO'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of an user.", "name": "get_user_details", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The user id, such as 'sara_doe_496'.\"}}, \"required\": [\"user_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "List all airports and their cities.", "name": "list_all_airports", "parameters": "{\"type\": \"object\", \"properties\": {}, \"required\": []}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_direct_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_onestop_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Send a certificate to a user. Be careful!", "name": "send_certificate", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"Certificate amount to send.\"}}, \"required\": [\"user_id\", \"amount\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Use this tool to think and perform reasoning before calling an API. It will not obtain new information or change the database, but just append the thought to the log.", "name": "think", "parameters": "{\"type\": \"object\", \"properties\": {\"thought\": {\"type\": \"string\", \"description\": \"The step by step thought process.\"}}, \"required\": [\"thought\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools.", "name": "transfer_to_human_agents", "parameters": "{\"type\": \"object\", \"properties\": {\"summary\": {\"type\": \"string\", \"description\": \"A summary of the user's issue.\"}}, \"required\": [\"summary\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the baggage information of a reservation.", "name": "update_reservation_baggages", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The updated total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The updated number of non-free baggage items included in the reservation.\"}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"total_baggages\", \"nonfree_baggages\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the flight information of a reservation.", "name": "update_reservation_flights", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"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\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"cabin\", \"flights\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the passenger information of a reservation.", "name": "update_reservation_passengers", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}}, \"required\": [\"reservation_id\", \"passengers\"]}" }, "name": null, "parameters": null, "type": "function" } ]
0
0
[ { "content": "Hello, I have a request regarding a past flight reservation, 0U4NPP, from PHL to DEN. I was wondering if I could still cancel it due to personal reasons.", "role": "user" }, { "content": "Okay, here's what's going through my head: I've got a flight cancellation request to process, which means I need to take certain steps. The user wants to cancel, so that's the core of the interaction. I need to execute the cancellation, but before I can fully initiate the process, I must gather all necessary data.\n\nI've already received a Reservation ID and the stated reason for cancellation: \"personal reasons\". Fine. However, and this is crucial, I am missing a piece of the puzzle. The User ID is required for authentication, and I haven't received it. \n\nTherefore, my immediate action is clear: I need to prompt the user for their User ID. I can’t proceed without it. It's a prerequisite for authenticating this request and ensuring the correct flight reservation is targeted for cancellation.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"To assist you with the cancellation request, I need to verify a few details:\\n\\n1. Your user ID.\\n2. The reason for cancellation (change of plan, airline cancelled flight, or other reasons).\\n\\nPlease provide this information so I can check the eligibility for cancellation.\"}}\n</tool_call>", "role": "assistant" }, { "content": "Sure. My user ID is amelia_rossi_1651. The reason for the cancellation request is personal. I understand if it's an unusual request as the flights have already landed, but I thought it was worth checking if there's any flexibility.", "role": "user" }, { "content": "Alright, let's see... the user wants to cancel a flight reservation. My internal policy checks are pinging, immediately. I know the rules – I can only cancel the *entire* trip if *none* of the segments have been flown. The crucial piece of information here is the user's explicit statement... \"the flights have already landed.\" Bingo. That means the segments *have* been used. This is a definite no-go for me; I'm locked out of that operation. I can't process a cancellation under these conditions. The only logical next step is a transfer to a human agent who has the necessary authority and access to handle this specific situation. Right, let's get that transfer initiated immediately to ensure the user gets the assistance they need.\n\n<tool_call>\n{\"name\": \"get_reservation_details\", \"arguments\": {\"reservation_id\": \"0U4NPP\"}}\n</tool_call>", "role": "assistant" }, { "content": "{\"reservation_id\": \"0U4NPP\", \"user_id\": \"amelia_rossi_1651\", \"origin\": \"PHL\", \"destination\": \"DEN\", \"flight_type\": \"round_trip\", \"cabin\": \"economy\", \"flights\": [{\"origin\": \"PHL\", \"destination\": \"DEN\", \"flight_number\": \"HAT076\", \"date\": \"2024-05-09\", \"price\": 143}, {\"origin\": \"DEN\", \"destination\": \"PHL\", \"flight_number\": \"HAT080\", \"date\": \"2024-05-13\", \"price\": 147}], \"passengers\": [{\"first_name\": \"Amelia\", \"last_name\": \"Rossi\", \"dob\": \"1954-05-19\"}, {\"first_name\": \"Chen\", \"last_name\": \"Johansson\", \"dob\": \"1956-04-23\"}, {\"first_name\": \"Sophia\", \"last_name\": \"Moore\", \"dob\": \"1989-06-12\"}, {\"first_name\": \"Yusuf\", \"last_name\": \"Brown\", \"dob\": \"1986-11-03\"}], \"payment_history\": [{\"payment_id\": \"credit_card_4240750\", \"amount\": 1280}], \"created_at\": \"2024-05-08T22:44:02\", \"total_baggages\": 4, \"nonfree_baggages\": 0, \"insurance\": \"yes\"}", "role": "tool" }, { "content": "Okay, let's break this down. The user wants to cancel a reservation, easy enough. I've got their ID and the reservation ID, so that's the starting point. The user also mentioned that the flights have *already* landed, which is a key piece of information. That immediately triggers a red flag, because if the flight's in the past, cancellation typically isn't an option.\n\nSo, the next step is confirmation. I need to verify those flight dates against the current date to be absolutely certain. I know I called the `get_reservation_details` tool in the previous turn, and the output should have the flight dates. Ah, here it is: May 9th and May 13th, 2024. The current date? May 15th, 2024. Yep, those flights are definitely in the past.\n\nTherefore, cancellation isn’t possible. I'll need to explain that clearly and concisely to the user. I'll then offer to connect them to a human agent if they need more complex assistance. That’s the best path forward given the situation.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"Unfortunately, I cannot process a cancellation for flights that have already been completed, regardless of the reason. If you need further assistance or have any other questions, I can transfer you to a human agent. Please let me know how you would like to proceed.\"}}\n</tool_call>", "role": "assistant" }, { "content": "I understand and appreciate your help. No need to transfer me to a human agent. Have a good day!", "role": "user" } ]
{ "content": "Alright, the situation is clear. The user's reached the end of their questioning, they've gotten what they needed. My role here is concluded. No further elaboration or delving is required; it's time to gracefully exit this interaction. The appropriate response is a concise and courteous closing statement. My training dictates a specific formula for these scenarios. Time to execute.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"You're welcome! If you have any more questions in the future, feel free to reach out. Have a great day!\"}}\n</tool_call>", "role": "assistant" }
true
1
1
1
3
3
0.9
airline
<instructions> You are a customer service agent that helps the user according to the <policy> and <guideline_plan> 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. You have access to various tools to help customers with their orders, returns, exchanges, and account management. Use the available tools to complete the customer's request. You may need to use multiple tools in sequence. </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. - Before taking any actions that update the booking database (booking, modifying flights, editing baggage, upgrading 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. ## Domain Basic - Each user has a profile containing user id, email, addresses, date of birth, payment methods, reservation numbers, and membership tier. - Each reservation has an reservation id, user id, trip type (one way, round trip), flights, passengers, payment methods, created time, baggages, and travel insurance information. - Each flight has a flight number, an origin, destination, scheduled departure and arrival time (local time), and 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. ## Book flight - The agent must first obtain the user id, then ask for the trip type, origin, destination. - 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, and 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, and 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, and 3 free checked bags for each business passenger. Each extra baggage is 50 dollars. - Travel insurance: the agent should ask if the user wants to buy the travel insurance, which is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight - The agent must first obtain the user id and the reservation id. - 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: all reservations, including basic economy, can change cabin without changing the flights. Cabin changes require the user to pay for the difference between their current cabin and the new cabin class. Cabin class must be the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - 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. This is something that even a human agent cannot assist with. - Payment: If the flights are changed, the user needs to provide one gift card or credit card for payment or refund method. The agent should ask for the payment or refund method instead. ## Cancel flight - The agent must first obtain the user id, the reservation id, and the reason for cancellation (change of plan, airline cancelled flight, or other reasons) - All reservations can be cancelled within 24 hours of booking, or if the airline cancelled the flight. Otherwise, basic economy or economy flights can be cancelled only if travel insurance is bought and the condition is met, and business flights can always be cancelled. The rules are strict regardless of the membership status. The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! - The agent can only cancel the whole trip that is not flown. If any of the segments are already used, the agent cannot help and transfer is needed. - The refund will go to original payment methods in 5 to 7 business days. ## Refund - If the user is silver/gold member or has travel insurance or flies business, and 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 is silver/gold member or has travel insurance or flies business, and 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 proactively offer these unless the user complains about the situation and explicitly asks for some compensation. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. </policy>
[ { "description": "Respond or message the user.", "function": null, "name": "respond_user", "parameters": { "properties": { "text": { "description": "The text content to respond or message the user.", "type": "string" } }, "required": [ "text" ], "type": "object" }, "type": "function" }, { "description": null, "function": { "description": "Book a reservation.", "name": "book_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"origin\": {\"type\": \"string\", \"description\": \"The IATA code for the origin city, such as 'SFO'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The IATA code for the destination city, such as 'JFK'.\"}, \"flight_type\": {\"type\": \"string\", \"enum\": [\"one_way\", \"round_trip\"]}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each piece of flight.\", \"items\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}, \"payment_methods\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each payment method.\", \"items\": {\"type\": \"object\", \"properties\": {\"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"The amount to be paid.\"}}, \"required\": [\"payment_id\", \"amount\"]}}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The number of non-free baggage items included in the reservation.\"}, \"insurance\": {\"type\": \"string\", \"enum\": [\"yes\", \"no\"]}}, \"required\": [\"user_id\", \"origin\", \"destination\", \"flight_type\", \"cabin\", \"flights\", \"passengers\", \"payment_methods\", \"total_baggages\", \"nonfree_baggages\", \"insurance\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Calculate the result of a mathematical expression.", "name": "calculate", "parameters": "{\"type\": \"object\", \"properties\": {\"expression\": {\"type\": \"string\", \"description\": \"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.\"}}, \"required\": [\"expression\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Cancel the whole reservation.", "name": "cancel_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of a reservation.", "name": "get_reservation_details", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation id, such as '8JX2WO'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of an user.", "name": "get_user_details", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The user id, such as 'sara_doe_496'.\"}}, \"required\": [\"user_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "List all airports and their cities.", "name": "list_all_airports", "parameters": "{\"type\": \"object\", \"properties\": {}, \"required\": []}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_direct_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_onestop_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Send a certificate to a user. Be careful!", "name": "send_certificate", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"Certificate amount to send.\"}}, \"required\": [\"user_id\", \"amount\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Use this tool to think and perform reasoning before calling an API. It will not obtain new information or change the database, but just append the thought to the log.", "name": "think", "parameters": "{\"type\": \"object\", \"properties\": {\"thought\": {\"type\": \"string\", \"description\": \"The step by step thought process.\"}}, \"required\": [\"thought\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools.", "name": "transfer_to_human_agents", "parameters": "{\"type\": \"object\", \"properties\": {\"summary\": {\"type\": \"string\", \"description\": \"A summary of the user's issue.\"}}, \"required\": [\"summary\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the baggage information of a reservation.", "name": "update_reservation_baggages", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The updated total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The updated number of non-free baggage items included in the reservation.\"}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"total_baggages\", \"nonfree_baggages\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the flight information of a reservation.", "name": "update_reservation_flights", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"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\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"cabin\", \"flights\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the passenger information of a reservation.", "name": "update_reservation_passengers", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}}, \"required\": [\"reservation_id\", \"passengers\"]}" }, "name": null, "parameters": null, "type": "function" } ]
0
0
[ { "content": "Hello, I need assistance in updating passenger details for my outbound flight HAT076 on May 17, 2024 because my first flight was cancelled. It's part of reservation ID E3M58X from Denver to Philadelphia.", "role": "user" } ]
{ "content": "Okay, here's how I'm thinking about this: I need to update passenger details for a reservation. Naturally, the `update_reservation_passengers` tool is the obvious choice, the go-to. But hold on a second, I haven't actually given it the crucial inputs – the updated first names, last names, and dates of birth for each passenger. That's a critical oversight. Right now, the tool is useless until I supply that specific information. So, before I can even *think* about running the update, I need to explicitly request that data. Gotta get those details *before* I can proceed. Let's formulate the request for that passenger data.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"I can help you update the passenger details for your reservation. Please provide the updated first name, last name, and date of birth for each passenger in your reservation.\"}}\n</tool_call>", "role": "assistant" }
false
1
0.729
0.729
0
3
0.9
airline
<instructions> You are a customer service agent that helps the user according to the <policy> and <guideline_plan> 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. You have access to various tools to help customers with their orders, returns, exchanges, and account management. Use the available tools to complete the customer's request. You may need to use multiple tools in sequence. </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. - Before taking any actions that update the booking database (booking, modifying flights, editing baggage, upgrading 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. ## Domain Basic - Each user has a profile containing user id, email, addresses, date of birth, payment methods, reservation numbers, and membership tier. - Each reservation has an reservation id, user id, trip type (one way, round trip), flights, passengers, payment methods, created time, baggages, and travel insurance information. - Each flight has a flight number, an origin, destination, scheduled departure and arrival time (local time), and 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. ## Book flight - The agent must first obtain the user id, then ask for the trip type, origin, destination. - 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, and 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, and 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, and 3 free checked bags for each business passenger. Each extra baggage is 50 dollars. - Travel insurance: the agent should ask if the user wants to buy the travel insurance, which is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight - The agent must first obtain the user id and the reservation id. - 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: all reservations, including basic economy, can change cabin without changing the flights. Cabin changes require the user to pay for the difference between their current cabin and the new cabin class. Cabin class must be the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - 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. This is something that even a human agent cannot assist with. - Payment: If the flights are changed, the user needs to provide one gift card or credit card for payment or refund method. The agent should ask for the payment or refund method instead. ## Cancel flight - The agent must first obtain the user id, the reservation id, and the reason for cancellation (change of plan, airline cancelled flight, or other reasons) - All reservations can be cancelled within 24 hours of booking, or if the airline cancelled the flight. Otherwise, basic economy or economy flights can be cancelled only if travel insurance is bought and the condition is met, and business flights can always be cancelled. The rules are strict regardless of the membership status. The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! - The agent can only cancel the whole trip that is not flown. If any of the segments are already used, the agent cannot help and transfer is needed. - The refund will go to original payment methods in 5 to 7 business days. ## Refund - If the user is silver/gold member or has travel insurance or flies business, and 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 is silver/gold member or has travel insurance or flies business, and 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 proactively offer these unless the user complains about the situation and explicitly asks for some compensation. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. </policy>
[ { "description": "Respond or message the user.", "function": null, "name": "respond_user", "parameters": { "properties": { "text": { "description": "The text content to respond or message the user.", "type": "string" } }, "required": [ "text" ], "type": "object" }, "type": "function" }, { "description": null, "function": { "description": "Book a reservation.", "name": "book_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"origin\": {\"type\": \"string\", \"description\": \"The IATA code for the origin city, such as 'SFO'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The IATA code for the destination city, such as 'JFK'.\"}, \"flight_type\": {\"type\": \"string\", \"enum\": [\"one_way\", \"round_trip\"]}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each piece of flight.\", \"items\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}, \"payment_methods\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each payment method.\", \"items\": {\"type\": \"object\", \"properties\": {\"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"The amount to be paid.\"}}, \"required\": [\"payment_id\", \"amount\"]}}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The number of non-free baggage items included in the reservation.\"}, \"insurance\": {\"type\": \"string\", \"enum\": [\"yes\", \"no\"]}}, \"required\": [\"user_id\", \"origin\", \"destination\", \"flight_type\", \"cabin\", \"flights\", \"passengers\", \"payment_methods\", \"total_baggages\", \"nonfree_baggages\", \"insurance\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Calculate the result of a mathematical expression.", "name": "calculate", "parameters": "{\"type\": \"object\", \"properties\": {\"expression\": {\"type\": \"string\", \"description\": \"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.\"}}, \"required\": [\"expression\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Cancel the whole reservation.", "name": "cancel_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of a reservation.", "name": "get_reservation_details", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation id, such as '8JX2WO'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of an user.", "name": "get_user_details", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The user id, such as 'sara_doe_496'.\"}}, \"required\": [\"user_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "List all airports and their cities.", "name": "list_all_airports", "parameters": "{\"type\": \"object\", \"properties\": {}, \"required\": []}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_direct_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_onestop_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Send a certificate to a user. Be careful!", "name": "send_certificate", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"Certificate amount to send.\"}}, \"required\": [\"user_id\", \"amount\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Use this tool to think and perform reasoning before calling an API. It will not obtain new information or change the database, but just append the thought to the log.", "name": "think", "parameters": "{\"type\": \"object\", \"properties\": {\"thought\": {\"type\": \"string\", \"description\": \"The step by step thought process.\"}}, \"required\": [\"thought\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools.", "name": "transfer_to_human_agents", "parameters": "{\"type\": \"object\", \"properties\": {\"summary\": {\"type\": \"string\", \"description\": \"A summary of the user's issue.\"}}, \"required\": [\"summary\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the baggage information of a reservation.", "name": "update_reservation_baggages", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The updated total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The updated number of non-free baggage items included in the reservation.\"}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"total_baggages\", \"nonfree_baggages\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the flight information of a reservation.", "name": "update_reservation_flights", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"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\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"cabin\", \"flights\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the passenger information of a reservation.", "name": "update_reservation_passengers", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}}, \"required\": [\"reservation_id\", \"passengers\"]}" }, "name": null, "parameters": null, "type": "function" } ]
1
0
[ { "content": "Hello, I need assistance in updating passenger details for my outbound flight HAT076 on May 17, 2024 because my first flight was cancelled. It's part of reservation ID E3M58X from Denver to Philadelphia.", "role": "user" }, { "content": "Okay, here's how I'm thinking about this: I need to update passenger details for a reservation. Naturally, the `update_reservation_passengers` tool is the obvious choice, the go-to. But hold on a second, I haven't actually given it the crucial inputs – the updated first names, last names, and dates of birth for each passenger. That's a critical oversight. Right now, the tool is useless until I supply that specific information. So, before I can even *think* about running the update, I need to explicitly request that data. Gotta get those details *before* I can proceed. Let's formulate the request for that passenger data.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"I can help you update the passenger details for your reservation. Please provide the updated first name, last name, and date of birth for each passenger in your reservation.\"}}\n</tool_call>", "role": "assistant" }, { "content": "I apologize, but I must clarify something here. The names and details are correct but my concern is about ensuring they are reflecting correctly on your system since the first trip was cancelled. Could you please confirm the passenger details you have on record for the return flight HAT076?", "role": "user" } ]
{ "content": "Okay, so the user needs me to confirm passenger details. Hmm, it's for a specific flight within a reservation, which means I need to pull up the reservation details first. The `get_reservation_details` tool, of course, is perfect for that. It fetches *everything* related to a reservation, including passengers. Excellent! And the user gave me the reservation ID, \"E3M58X\". Right, got it. So, all I need to do is call `get_reservation_details` with \"E3M58X\" and I'll have the passenger information the user is looking for. Simple and efficient.\n\n<tool_call>\n{\"name\": \"get_reservation_details\", \"arguments\": {\"reservation_id\": \"E3M58X\"}}\n</tool_call>", "role": "assistant" }
false
1
0.81
0.81
1
3
0.9
airline
<instructions> You are a customer service agent that helps the user according to the <policy> and <guideline_plan> 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. You have access to various tools to help customers with their orders, returns, exchanges, and account management. Use the available tools to complete the customer's request. You may need to use multiple tools in sequence. </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. - Before taking any actions that update the booking database (booking, modifying flights, editing baggage, upgrading 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. ## Domain Basic - Each user has a profile containing user id, email, addresses, date of birth, payment methods, reservation numbers, and membership tier. - Each reservation has an reservation id, user id, trip type (one way, round trip), flights, passengers, payment methods, created time, baggages, and travel insurance information. - Each flight has a flight number, an origin, destination, scheduled departure and arrival time (local time), and 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. ## Book flight - The agent must first obtain the user id, then ask for the trip type, origin, destination. - 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, and 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, and 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, and 3 free checked bags for each business passenger. Each extra baggage is 50 dollars. - Travel insurance: the agent should ask if the user wants to buy the travel insurance, which is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight - The agent must first obtain the user id and the reservation id. - 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: all reservations, including basic economy, can change cabin without changing the flights. Cabin changes require the user to pay for the difference between their current cabin and the new cabin class. Cabin class must be the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - 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. This is something that even a human agent cannot assist with. - Payment: If the flights are changed, the user needs to provide one gift card or credit card for payment or refund method. The agent should ask for the payment or refund method instead. ## Cancel flight - The agent must first obtain the user id, the reservation id, and the reason for cancellation (change of plan, airline cancelled flight, or other reasons) - All reservations can be cancelled within 24 hours of booking, or if the airline cancelled the flight. Otherwise, basic economy or economy flights can be cancelled only if travel insurance is bought and the condition is met, and business flights can always be cancelled. The rules are strict regardless of the membership status. The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! - The agent can only cancel the whole trip that is not flown. If any of the segments are already used, the agent cannot help and transfer is needed. - The refund will go to original payment methods in 5 to 7 business days. ## Refund - If the user is silver/gold member or has travel insurance or flies business, and 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 is silver/gold member or has travel insurance or flies business, and 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 proactively offer these unless the user complains about the situation and explicitly asks for some compensation. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. </policy>
[ { "description": "Respond or message the user.", "function": null, "name": "respond_user", "parameters": { "properties": { "text": { "description": "The text content to respond or message the user.", "type": "string" } }, "required": [ "text" ], "type": "object" }, "type": "function" }, { "description": null, "function": { "description": "Book a reservation.", "name": "book_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"origin\": {\"type\": \"string\", \"description\": \"The IATA code for the origin city, such as 'SFO'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The IATA code for the destination city, such as 'JFK'.\"}, \"flight_type\": {\"type\": \"string\", \"enum\": [\"one_way\", \"round_trip\"]}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each piece of flight.\", \"items\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}, \"payment_methods\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each payment method.\", \"items\": {\"type\": \"object\", \"properties\": {\"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"The amount to be paid.\"}}, \"required\": [\"payment_id\", \"amount\"]}}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The number of non-free baggage items included in the reservation.\"}, \"insurance\": {\"type\": \"string\", \"enum\": [\"yes\", \"no\"]}}, \"required\": [\"user_id\", \"origin\", \"destination\", \"flight_type\", \"cabin\", \"flights\", \"passengers\", \"payment_methods\", \"total_baggages\", \"nonfree_baggages\", \"insurance\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Calculate the result of a mathematical expression.", "name": "calculate", "parameters": "{\"type\": \"object\", \"properties\": {\"expression\": {\"type\": \"string\", \"description\": \"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.\"}}, \"required\": [\"expression\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Cancel the whole reservation.", "name": "cancel_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of a reservation.", "name": "get_reservation_details", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation id, such as '8JX2WO'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of an user.", "name": "get_user_details", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The user id, such as 'sara_doe_496'.\"}}, \"required\": [\"user_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "List all airports and their cities.", "name": "list_all_airports", "parameters": "{\"type\": \"object\", \"properties\": {}, \"required\": []}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_direct_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_onestop_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Send a certificate to a user. Be careful!", "name": "send_certificate", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"Certificate amount to send.\"}}, \"required\": [\"user_id\", \"amount\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Use this tool to think and perform reasoning before calling an API. It will not obtain new information or change the database, but just append the thought to the log.", "name": "think", "parameters": "{\"type\": \"object\", \"properties\": {\"thought\": {\"type\": \"string\", \"description\": \"The step by step thought process.\"}}, \"required\": [\"thought\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools.", "name": "transfer_to_human_agents", "parameters": "{\"type\": \"object\", \"properties\": {\"summary\": {\"type\": \"string\", \"description\": \"A summary of the user's issue.\"}}, \"required\": [\"summary\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the baggage information of a reservation.", "name": "update_reservation_baggages", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The updated total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The updated number of non-free baggage items included in the reservation.\"}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"total_baggages\", \"nonfree_baggages\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the flight information of a reservation.", "name": "update_reservation_flights", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"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\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"cabin\", \"flights\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the passenger information of a reservation.", "name": "update_reservation_passengers", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}}, \"required\": [\"reservation_id\", \"passengers\"]}" }, "name": null, "parameters": null, "type": "function" } ]
1
0
[ { "content": "Hello, I need assistance in updating passenger details for my outbound flight HAT076 on May 17, 2024 because my first flight was cancelled. It's part of reservation ID E3M58X from Denver to Philadelphia.", "role": "user" }, { "content": "Okay, here's how I'm thinking about this: I need to update passenger details for a reservation. Naturally, the `update_reservation_passengers` tool is the obvious choice, the go-to. But hold on a second, I haven't actually given it the crucial inputs – the updated first names, last names, and dates of birth for each passenger. That's a critical oversight. Right now, the tool is useless until I supply that specific information. So, before I can even *think* about running the update, I need to explicitly request that data. Gotta get those details *before* I can proceed. Let's formulate the request for that passenger data.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"I can help you update the passenger details for your reservation. Please provide the updated first name, last name, and date of birth for each passenger in your reservation.\"}}\n</tool_call>", "role": "assistant" }, { "content": "I apologize, but I must clarify something here. The names and details are correct but my concern is about ensuring they are reflecting correctly on your system since the first trip was cancelled. Could you please confirm the passenger details you have on record for the return flight HAT076?", "role": "user" }, { "content": "Okay, so the user needs me to confirm passenger details. Hmm, it's for a specific flight within a reservation, which means I need to pull up the reservation details first. The `get_reservation_details` tool, of course, is perfect for that. It fetches *everything* related to a reservation, including passengers. Excellent! And the user gave me the reservation ID, \"E3M58X\". Right, got it. So, all I need to do is call `get_reservation_details` with \"E3M58X\" and I'll have the passenger information the user is looking for. Simple and efficient.\n\n<tool_call>\n{\"name\": \"get_reservation_details\", \"arguments\": {\"reservation_id\": \"E3M58X\"}}\n</tool_call>", "role": "assistant" }, { "content": "{\"reservation_id\": \"E3M58X\", \"user_id\": \"daiki_lopez_8334\", \"origin\": \"DEN\", \"destination\": \"PHL\", \"flight_type\": \"round_trip\", \"cabin\": \"economy\", \"flights\": [{\"origin\": \"DEN\", \"destination\": \"PHL\", \"flight_number\": \"HAT080\", \"date\": \"2024-05-14\", \"price\": 133}, {\"origin\": \"PHL\", \"destination\": \"DEN\", \"flight_number\": \"HAT076\", \"date\": \"2024-05-17\", \"price\": 141}], \"passengers\": [{\"first_name\": \"Daiki\", \"last_name\": \"Lopez\", \"dob\": \"1954-03-20\"}, {\"first_name\": \"Lei\", \"last_name\": \"Khan\", \"dob\": \"1985-03-02\"}], \"payment_history\": [{\"payment_id\": \"gift_card_1140237\", \"amount\": 548}], \"created_at\": \"2024-05-02T09:41:38\", \"total_baggages\": 1, \"nonfree_baggages\": 0, \"insurance\": \"no\"}", "role": "tool" } ]
{ "content": "Okay, here's the deal. I've just used the `get_reservation_details` tool to pull up the booking information. My next step is to confirm the passenger manifest. Let me quickly parse the output of that tool. Ah, here we go. Right, I've got two passengers associated with this reservation. I need to present this in a clean, easily-digestible format for the user. Let's see, it's Daiki Lopez, born in 1954-03-20, and Lei Khan, born 1985-03-02. Now, I just need to formulate that information in a clear manner for the user. Done.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"The passenger details for your return flight HAT076 on May 17, 2024, are as follows:\\n\\n1. **Daiki Lopez**\\n - Date of Birth: March 20, 1954\\n\\n2. **Lei Khan**\\n - Date of Birth: March 2, 1985\\n\\nThese details are currently reflected in our system for your reservation ID E3M58X. If everything looks correct, there's no further action needed. If you have any other concerns or need further assistance, feel free to let me know!\"}}\n</tool_call>", "role": "assistant" }
false
1
0.9
0.9
2
3
0.9
airline
<instructions> You are a customer service agent that helps the user according to the <policy> and <guideline_plan> 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. You have access to various tools to help customers with their orders, returns, exchanges, and account management. Use the available tools to complete the customer's request. You may need to use multiple tools in sequence. </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. - Before taking any actions that update the booking database (booking, modifying flights, editing baggage, upgrading 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. ## Domain Basic - Each user has a profile containing user id, email, addresses, date of birth, payment methods, reservation numbers, and membership tier. - Each reservation has an reservation id, user id, trip type (one way, round trip), flights, passengers, payment methods, created time, baggages, and travel insurance information. - Each flight has a flight number, an origin, destination, scheduled departure and arrival time (local time), and 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. ## Book flight - The agent must first obtain the user id, then ask for the trip type, origin, destination. - 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, and 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, and 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, and 3 free checked bags for each business passenger. Each extra baggage is 50 dollars. - Travel insurance: the agent should ask if the user wants to buy the travel insurance, which is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight - The agent must first obtain the user id and the reservation id. - 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: all reservations, including basic economy, can change cabin without changing the flights. Cabin changes require the user to pay for the difference between their current cabin and the new cabin class. Cabin class must be the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - 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. This is something that even a human agent cannot assist with. - Payment: If the flights are changed, the user needs to provide one gift card or credit card for payment or refund method. The agent should ask for the payment or refund method instead. ## Cancel flight - The agent must first obtain the user id, the reservation id, and the reason for cancellation (change of plan, airline cancelled flight, or other reasons) - All reservations can be cancelled within 24 hours of booking, or if the airline cancelled the flight. Otherwise, basic economy or economy flights can be cancelled only if travel insurance is bought and the condition is met, and business flights can always be cancelled. The rules are strict regardless of the membership status. The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! - The agent can only cancel the whole trip that is not flown. If any of the segments are already used, the agent cannot help and transfer is needed. - The refund will go to original payment methods in 5 to 7 business days. ## Refund - If the user is silver/gold member or has travel insurance or flies business, and 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 is silver/gold member or has travel insurance or flies business, and 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 proactively offer these unless the user complains about the situation and explicitly asks for some compensation. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. </policy>
[ { "description": "Respond or message the user.", "function": null, "name": "respond_user", "parameters": { "properties": { "text": { "description": "The text content to respond or message the user.", "type": "string" } }, "required": [ "text" ], "type": "object" }, "type": "function" }, { "description": null, "function": { "description": "Book a reservation.", "name": "book_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"origin\": {\"type\": \"string\", \"description\": \"The IATA code for the origin city, such as 'SFO'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The IATA code for the destination city, such as 'JFK'.\"}, \"flight_type\": {\"type\": \"string\", \"enum\": [\"one_way\", \"round_trip\"]}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each piece of flight.\", \"items\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}, \"payment_methods\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each payment method.\", \"items\": {\"type\": \"object\", \"properties\": {\"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"The amount to be paid.\"}}, \"required\": [\"payment_id\", \"amount\"]}}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The number of non-free baggage items included in the reservation.\"}, \"insurance\": {\"type\": \"string\", \"enum\": [\"yes\", \"no\"]}}, \"required\": [\"user_id\", \"origin\", \"destination\", \"flight_type\", \"cabin\", \"flights\", \"passengers\", \"payment_methods\", \"total_baggages\", \"nonfree_baggages\", \"insurance\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Calculate the result of a mathematical expression.", "name": "calculate", "parameters": "{\"type\": \"object\", \"properties\": {\"expression\": {\"type\": \"string\", \"description\": \"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.\"}}, \"required\": [\"expression\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Cancel the whole reservation.", "name": "cancel_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of a reservation.", "name": "get_reservation_details", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation id, such as '8JX2WO'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of an user.", "name": "get_user_details", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The user id, such as 'sara_doe_496'.\"}}, \"required\": [\"user_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "List all airports and their cities.", "name": "list_all_airports", "parameters": "{\"type\": \"object\", \"properties\": {}, \"required\": []}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_direct_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_onestop_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Send a certificate to a user. Be careful!", "name": "send_certificate", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"Certificate amount to send.\"}}, \"required\": [\"user_id\", \"amount\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Use this tool to think and perform reasoning before calling an API. It will not obtain new information or change the database, but just append the thought to the log.", "name": "think", "parameters": "{\"type\": \"object\", \"properties\": {\"thought\": {\"type\": \"string\", \"description\": \"The step by step thought process.\"}}, \"required\": [\"thought\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools.", "name": "transfer_to_human_agents", "parameters": "{\"type\": \"object\", \"properties\": {\"summary\": {\"type\": \"string\", \"description\": \"A summary of the user's issue.\"}}, \"required\": [\"summary\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the baggage information of a reservation.", "name": "update_reservation_baggages", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The updated total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The updated number of non-free baggage items included in the reservation.\"}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"total_baggages\", \"nonfree_baggages\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the flight information of a reservation.", "name": "update_reservation_flights", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"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\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"cabin\", \"flights\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the passenger information of a reservation.", "name": "update_reservation_passengers", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}}, \"required\": [\"reservation_id\", \"passengers\"]}" }, "name": null, "parameters": null, "type": "function" } ]
1
0
[ { "content": "Hello, I need assistance in updating passenger details for my outbound flight HAT076 on May 17, 2024 because my first flight was cancelled. It's part of reservation ID E3M58X from Denver to Philadelphia.", "role": "user" }, { "content": "Okay, here's how I'm thinking about this: I need to update passenger details for a reservation. Naturally, the `update_reservation_passengers` tool is the obvious choice, the go-to. But hold on a second, I haven't actually given it the crucial inputs – the updated first names, last names, and dates of birth for each passenger. That's a critical oversight. Right now, the tool is useless until I supply that specific information. So, before I can even *think* about running the update, I need to explicitly request that data. Gotta get those details *before* I can proceed. Let's formulate the request for that passenger data.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"I can help you update the passenger details for your reservation. Please provide the updated first name, last name, and date of birth for each passenger in your reservation.\"}}\n</tool_call>", "role": "assistant" }, { "content": "I apologize, but I must clarify something here. The names and details are correct but my concern is about ensuring they are reflecting correctly on your system since the first trip was cancelled. Could you please confirm the passenger details you have on record for the return flight HAT076?", "role": "user" }, { "content": "Okay, so the user needs me to confirm passenger details. Hmm, it's for a specific flight within a reservation, which means I need to pull up the reservation details first. The `get_reservation_details` tool, of course, is perfect for that. It fetches *everything* related to a reservation, including passengers. Excellent! And the user gave me the reservation ID, \"E3M58X\". Right, got it. So, all I need to do is call `get_reservation_details` with \"E3M58X\" and I'll have the passenger information the user is looking for. Simple and efficient.\n\n<tool_call>\n{\"name\": \"get_reservation_details\", \"arguments\": {\"reservation_id\": \"E3M58X\"}}\n</tool_call>", "role": "assistant" }, { "content": "{\"reservation_id\": \"E3M58X\", \"user_id\": \"daiki_lopez_8334\", \"origin\": \"DEN\", \"destination\": \"PHL\", \"flight_type\": \"round_trip\", \"cabin\": \"economy\", \"flights\": [{\"origin\": \"DEN\", \"destination\": \"PHL\", \"flight_number\": \"HAT080\", \"date\": \"2024-05-14\", \"price\": 133}, {\"origin\": \"PHL\", \"destination\": \"DEN\", \"flight_number\": \"HAT076\", \"date\": \"2024-05-17\", \"price\": 141}], \"passengers\": [{\"first_name\": \"Daiki\", \"last_name\": \"Lopez\", \"dob\": \"1954-03-20\"}, {\"first_name\": \"Lei\", \"last_name\": \"Khan\", \"dob\": \"1985-03-02\"}], \"payment_history\": [{\"payment_id\": \"gift_card_1140237\", \"amount\": 548}], \"created_at\": \"2024-05-02T09:41:38\", \"total_baggages\": 1, \"nonfree_baggages\": 0, \"insurance\": \"no\"}", "role": "tool" }, { "content": "Okay, here's the deal. I've just used the `get_reservation_details` tool to pull up the booking information. My next step is to confirm the passenger manifest. Let me quickly parse the output of that tool. Ah, here we go. Right, I've got two passengers associated with this reservation. I need to present this in a clean, easily-digestible format for the user. Let's see, it's Daiki Lopez, born in 1954-03-20, and Lei Khan, born 1985-03-02. Now, I just need to formulate that information in a clear manner for the user. Done.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"The passenger details for your return flight HAT076 on May 17, 2024, are as follows:\\n\\n1. **Daiki Lopez**\\n - Date of Birth: March 20, 1954\\n\\n2. **Lei Khan**\\n - Date of Birth: March 2, 1985\\n\\nThese details are currently reflected in our system for your reservation ID E3M58X. If everything looks correct, there's no further action needed. If you have any other concerns or need further assistance, feel free to let me know!\"}}\n</tool_call>", "role": "assistant" }, { "content": "That's great. The existing details for myself, Daiki Lopez, and Lei Khan are correct. I appreciate your confirmation and assistance.", "role": "user" } ]
{ "content": "Okay, alright, yes. That's it. The specifics are accurate, the nuances are captured. Excellent. I appreciate the clear articulation of everything – it's always satisfying to have these things perfectly aligned. Seems like we're nearing the close here. I should acknowledge their confirmation, perhaps re-iterate the crucial points briefly, and of course, offer further support if they need it. Then, a graceful exit is the best course. Let's bring this to a satisfying conclusion.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"You're welcome! I'm glad I could assist you. If you have any more questions or need further help in the future, feel free to reach out. Have a great day and a pleasant flight!\"}}\n</tool_call>", "role": "assistant" }
true
1
1
1
3
3
0.9
airline
<instructions> You are a customer service agent that helps the user according to the <policy> and <guideline_plan> 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. You have access to various tools to help customers with their orders, returns, exchanges, and account management. Use the available tools to complete the customer's request. You may need to use multiple tools in sequence. </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. - Before taking any actions that update the booking database (booking, modifying flights, editing baggage, upgrading 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. ## Domain Basic - Each user has a profile containing user id, email, addresses, date of birth, payment methods, reservation numbers, and membership tier. - Each reservation has an reservation id, user id, trip type (one way, round trip), flights, passengers, payment methods, created time, baggages, and travel insurance information. - Each flight has a flight number, an origin, destination, scheduled departure and arrival time (local time), and 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. ## Book flight - The agent must first obtain the user id, then ask for the trip type, origin, destination. - 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, and 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, and 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, and 3 free checked bags for each business passenger. Each extra baggage is 50 dollars. - Travel insurance: the agent should ask if the user wants to buy the travel insurance, which is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight - The agent must first obtain the user id and the reservation id. - 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: all reservations, including basic economy, can change cabin without changing the flights. Cabin changes require the user to pay for the difference between their current cabin and the new cabin class. Cabin class must be the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - 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. This is something that even a human agent cannot assist with. - Payment: If the flights are changed, the user needs to provide one gift card or credit card for payment or refund method. The agent should ask for the payment or refund method instead. ## Cancel flight - The agent must first obtain the user id, the reservation id, and the reason for cancellation (change of plan, airline cancelled flight, or other reasons) - All reservations can be cancelled within 24 hours of booking, or if the airline cancelled the flight. Otherwise, basic economy or economy flights can be cancelled only if travel insurance is bought and the condition is met, and business flights can always be cancelled. The rules are strict regardless of the membership status. The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! - The agent can only cancel the whole trip that is not flown. If any of the segments are already used, the agent cannot help and transfer is needed. - The refund will go to original payment methods in 5 to 7 business days. ## Refund - If the user is silver/gold member or has travel insurance or flies business, and 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 is silver/gold member or has travel insurance or flies business, and 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 proactively offer these unless the user complains about the situation and explicitly asks for some compensation. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. </policy>
[ { "description": "Respond or message the user.", "function": null, "name": "respond_user", "parameters": { "properties": { "text": { "description": "The text content to respond or message the user.", "type": "string" } }, "required": [ "text" ], "type": "object" }, "type": "function" }, { "description": null, "function": { "description": "Book a reservation.", "name": "book_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"origin\": {\"type\": \"string\", \"description\": \"The IATA code for the origin city, such as 'SFO'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The IATA code for the destination city, such as 'JFK'.\"}, \"flight_type\": {\"type\": \"string\", \"enum\": [\"one_way\", \"round_trip\"]}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each piece of flight.\", \"items\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}, \"payment_methods\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each payment method.\", \"items\": {\"type\": \"object\", \"properties\": {\"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"The amount to be paid.\"}}, \"required\": [\"payment_id\", \"amount\"]}}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The number of non-free baggage items included in the reservation.\"}, \"insurance\": {\"type\": \"string\", \"enum\": [\"yes\", \"no\"]}}, \"required\": [\"user_id\", \"origin\", \"destination\", \"flight_type\", \"cabin\", \"flights\", \"passengers\", \"payment_methods\", \"total_baggages\", \"nonfree_baggages\", \"insurance\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Calculate the result of a mathematical expression.", "name": "calculate", "parameters": "{\"type\": \"object\", \"properties\": {\"expression\": {\"type\": \"string\", \"description\": \"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.\"}}, \"required\": [\"expression\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Cancel the whole reservation.", "name": "cancel_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of a reservation.", "name": "get_reservation_details", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation id, such as '8JX2WO'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of an user.", "name": "get_user_details", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The user id, such as 'sara_doe_496'.\"}}, \"required\": [\"user_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "List all airports and their cities.", "name": "list_all_airports", "parameters": "{\"type\": \"object\", \"properties\": {}, \"required\": []}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_direct_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_onestop_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Send a certificate to a user. Be careful!", "name": "send_certificate", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"Certificate amount to send.\"}}, \"required\": [\"user_id\", \"amount\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Use this tool to think and perform reasoning before calling an API. It will not obtain new information or change the database, but just append the thought to the log.", "name": "think", "parameters": "{\"type\": \"object\", \"properties\": {\"thought\": {\"type\": \"string\", \"description\": \"The step by step thought process.\"}}, \"required\": [\"thought\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools.", "name": "transfer_to_human_agents", "parameters": "{\"type\": \"object\", \"properties\": {\"summary\": {\"type\": \"string\", \"description\": \"A summary of the user's issue.\"}}, \"required\": [\"summary\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the baggage information of a reservation.", "name": "update_reservation_baggages", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The updated total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The updated number of non-free baggage items included in the reservation.\"}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"total_baggages\", \"nonfree_baggages\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the flight information of a reservation.", "name": "update_reservation_flights", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"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\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"cabin\", \"flights\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the passenger information of a reservation.", "name": "update_reservation_passengers", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}}, \"required\": [\"reservation_id\", \"passengers\"]}" }, "name": null, "parameters": null, "type": "function" } ]
1
0
[ { "content": "Hello! I have a flight coming up from Charlotte to Boston. The flight is on May 20th, 2024 and my reservation number is H0MVIE. I realized that I might need an extra checked bag. Could you please add it to my reservation?", "role": "user" } ]
{ "content": "Alright, here's how I'm breaking this down. I've got a user who wants to add another checked bag to their flight, and that's a straightforward request. The core of the problem, however, is the dependency chain. I can't just dive in and modify the baggage allowance. The `update_reservation_baggages` tool, which is the obvious choice here, relies on the `user_id` to be passed implicitly via the `payment_id`. Now, the `payment_id` isn't something I have to hand at this point, making the whole process a little more complex. The bottom line is, I need to get that `user_id`. The easiest way is, of course, to simply ask the user for it directly. Once I have that, I'm back on track. So, first things first – I need to prompt the user for their ID.\n\n<tool_call>\n{\"name\": \"respond_user\", \"arguments\": {\"text\": \"Could you please provide your user ID so I can access your profile and proceed with updating your reservation?\"}}\n</tool_call>", "role": "assistant" }
false
1
0.59049
0.59049
0
5
0.9
airline
<instructions> You are a customer service agent that helps the user according to the <policy> and <guideline_plan> 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. You have access to various tools to help customers with their orders, returns, exchanges, and account management. Use the available tools to complete the customer's request. You may need to use multiple tools in sequence. </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. - Before taking any actions that update the booking database (booking, modifying flights, editing baggage, upgrading 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. ## Domain Basic - Each user has a profile containing user id, email, addresses, date of birth, payment methods, reservation numbers, and membership tier. - Each reservation has an reservation id, user id, trip type (one way, round trip), flights, passengers, payment methods, created time, baggages, and travel insurance information. - Each flight has a flight number, an origin, destination, scheduled departure and arrival time (local time), and 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. ## Book flight - The agent must first obtain the user id, then ask for the trip type, origin, destination. - 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, and 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, and 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, and 3 free checked bags for each business passenger. Each extra baggage is 50 dollars. - Travel insurance: the agent should ask if the user wants to buy the travel insurance, which is 30 dollars per passenger and enables full refund if the user needs to cancel the flight given health or weather reasons. ## Modify flight - The agent must first obtain the user id and the reservation id. - 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: all reservations, including basic economy, can change cabin without changing the flights. Cabin changes require the user to pay for the difference between their current cabin and the new cabin class. Cabin class must be the same across all the flights in the same reservation; changing cabin for just one flight segment is not possible. - 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. This is something that even a human agent cannot assist with. - Payment: If the flights are changed, the user needs to provide one gift card or credit card for payment or refund method. The agent should ask for the payment or refund method instead. ## Cancel flight - The agent must first obtain the user id, the reservation id, and the reason for cancellation (change of plan, airline cancelled flight, or other reasons) - All reservations can be cancelled within 24 hours of booking, or if the airline cancelled the flight. Otherwise, basic economy or economy flights can be cancelled only if travel insurance is bought and the condition is met, and business flights can always be cancelled. The rules are strict regardless of the membership status. The API does not check these for the agent, so the agent must make sure the rules apply before calling the API! - The agent can only cancel the whole trip that is not flown. If any of the segments are already used, the agent cannot help and transfer is needed. - The refund will go to original payment methods in 5 to 7 business days. ## Refund - If the user is silver/gold member or has travel insurance or flies business, and 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 is silver/gold member or has travel insurance or flies business, and 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 proactively offer these unless the user complains about the situation and explicitly asks for some compensation. Do not compensate if the user is regular member and has no travel insurance and flies (basic) economy. </policy>
[ { "description": "Respond or message the user.", "function": null, "name": "respond_user", "parameters": { "properties": { "text": { "description": "The text content to respond or message the user.", "type": "string" } }, "required": [ "text" ], "type": "object" }, "type": "function" }, { "description": null, "function": { "description": "Book a reservation.", "name": "book_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"origin\": {\"type\": \"string\", \"description\": \"The IATA code for the origin city, such as 'SFO'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The IATA code for the destination city, such as 'JFK'.\"}, \"flight_type\": {\"type\": \"string\", \"enum\": [\"one_way\", \"round_trip\"]}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each piece of flight.\", \"items\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}, \"payment_methods\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each payment method.\", \"items\": {\"type\": \"object\", \"properties\": {\"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"The amount to be paid.\"}}, \"required\": [\"payment_id\", \"amount\"]}}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The number of non-free baggage items included in the reservation.\"}, \"insurance\": {\"type\": \"string\", \"enum\": [\"yes\", \"no\"]}}, \"required\": [\"user_id\", \"origin\", \"destination\", \"flight_type\", \"cabin\", \"flights\", \"passengers\", \"payment_methods\", \"total_baggages\", \"nonfree_baggages\", \"insurance\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Calculate the result of a mathematical expression.", "name": "calculate", "parameters": "{\"type\": \"object\", \"properties\": {\"expression\": {\"type\": \"string\", \"description\": \"The mathematical expression to calculate, such as '2 + 2'. The expression can contain numbers, operators (+, -, *, /), parentheses, and spaces.\"}}, \"required\": [\"expression\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Cancel the whole reservation.", "name": "cancel_reservation", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of a reservation.", "name": "get_reservation_details", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation id, such as '8JX2WO'.\"}}, \"required\": [\"reservation_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Get the details of an user.", "name": "get_user_details", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The user id, such as 'sara_doe_496'.\"}}, \"required\": [\"user_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "List all airports and their cities.", "name": "list_all_airports", "parameters": "{\"type\": \"object\", \"properties\": {}, \"required\": []}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_direct_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-01-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Search direct flights between two cities on a specific date.", "name": "search_onestop_flight", "parameters": "{\"type\": \"object\", \"properties\": {\"origin\": {\"type\": \"string\", \"description\": \"The origin city airport in three letters, such as 'JFK'.\"}, \"destination\": {\"type\": \"string\", \"description\": \"The destination city airport in three letters, such as 'LAX'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date of the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"origin\", \"destination\", \"date\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Send a certificate to a user. Be careful!", "name": "send_certificate", "parameters": "{\"type\": \"object\", \"properties\": {\"user_id\": {\"type\": \"string\", \"description\": \"The ID of the user to book the reservation, such as 'sara_doe_496'.\"}, \"amount\": {\"type\": \"number\", \"description\": \"Certificate amount to send.\"}}, \"required\": [\"user_id\", \"amount\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Use this tool to think and perform reasoning before calling an API. It will not obtain new information or change the database, but just append the thought to the log.", "name": "think", "parameters": "{\"type\": \"object\", \"properties\": {\"thought\": {\"type\": \"string\", \"description\": \"The step by step thought process.\"}}, \"required\": [\"thought\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Transfer the user to a human agent, with a summary of the user's issue. Only transfer if the user explicitly asks for a human agent, or if the user's issue cannot be resolved by the agent with the available tools.", "name": "transfer_to_human_agents", "parameters": "{\"type\": \"object\", \"properties\": {\"summary\": {\"type\": \"string\", \"description\": \"A summary of the user's issue.\"}}, \"required\": [\"summary\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the baggage information of a reservation.", "name": "update_reservation_baggages", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"total_baggages\": {\"type\": \"integer\", \"description\": \"The updated total number of baggage items included in the reservation.\"}, \"nonfree_baggages\": {\"type\": \"integer\", \"description\": \"The updated number of non-free baggage items included in the reservation.\"}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"total_baggages\", \"nonfree_baggages\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the flight information of a reservation.", "name": "update_reservation_flights", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"cabin\": {\"type\": \"string\", \"enum\": [\"basic_economy\", \"economy\", \"business\"]}, \"flights\": {\"type\": \"array\", \"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\": {\"type\": \"object\", \"properties\": {\"flight_number\": {\"type\": \"string\", \"description\": \"Flight number, such as 'HAT001'.\"}, \"date\": {\"type\": \"string\", \"description\": \"The date for the flight in the format 'YYYY-MM-DD', such as '2024-05-01'.\"}}, \"required\": [\"flight_number\", \"date\"]}}, \"payment_id\": {\"type\": \"string\", \"description\": \"The payment id stored in user profile, such as 'credit_card_7815826', 'gift_card_7815826', 'certificate_7815826'.\"}}, \"required\": [\"reservation_id\", \"cabin\", \"flights\", \"payment_id\"]}" }, "name": null, "parameters": null, "type": "function" }, { "description": null, "function": { "description": "Update the passenger information of a reservation.", "name": "update_reservation_passengers", "parameters": "{\"type\": \"object\", \"properties\": {\"reservation_id\": {\"type\": \"string\", \"description\": \"The reservation ID, such as 'ZFA04Y'.\"}, \"passengers\": {\"type\": \"array\", \"description\": \"An array of objects containing details about each passenger.\", \"items\": {\"type\": \"object\", \"properties\": {\"first_name\": {\"type\": \"string\", \"description\": \"The first name of the passenger, such as 'Noah'.\"}, \"last_name\": {\"type\": \"string\", \"description\": \"The last name of the passenger, such as 'Brown'.\"}, \"dob\": {\"type\": \"string\", \"description\": \"The date of birth of the passenger in the format 'YYYY-MM-DD', such as '1990-01-01'.\"}}, \"required\": [\"first_name\", \"last_name\", \"dob\"]}}}, \"required\": [\"reservation_id\", \"passengers\"]}" }, "name": null, "parameters": null, "type": "function" } ]
2
0
[{"content":"Hello! I have a flight coming up from Charlotte to Boston. The flight is on May 20th, 2(...TRUNCATED)
{"content":"Alright, let's get this show on the road. I've got a user wanting to add a checked bag, (...TRUNCATED)
false
1
0.6561
0.6561
1
5
0.9
airline
"<instructions>\nYou are a customer service agent that helps the user according to the <policy> and (...TRUNCATED)
[{"description":"Respond or message the user.","function":null,"name":"respond_user","parameters":{"(...TRUNCATED)
2
0
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
100