Dataset Viewer
Auto-converted to Parquet
conversations
listlengths
1
51
system
stringclasses
2 values
tools
stringclasses
3 values
based_on_sample
stringlengths
31
35
sample_turns
int64
3
56
generated_turns
int64
1
51
domain
stringclasses
1 value
sample_question
stringlengths
32
408
[ { "from": "human", "value": "Hi, I received running shoes in the wrong size and need to exchange them. Can you help?" }, { "from": "gpt", "value": "I can help with that. First, I need to authenticate your identity. Please provide the email address on your account." }, { "from": "human", "value": "Sure, it's [email protected]." }, { "from": "function_call", "value": "{\"name\":\"find_user_id_by_email\",\"arguments\":{\"email\":\"[email protected]\"}}" }, { "from": "observation", "value": "jordan_lee_1188" }, { "from": "gpt", "value": "Thanks, Jordan. I’ve authenticated your account. Please provide:\n- The order ID\n- Which item(s) you want to exchange, including the current size/color and the desired size/color\n- A payment method to handle any price difference (you can use an existing card or a gift card on file)" }, { "from": "human", "value": "The order ID is #A4412033. I want to exchange the Running Shoes in size 9, color Black, to size 10 in Navy. Please charge any difference to my Visa ending in 4432." }, { "from": "function_call", "value": "{\"name\":\"get_order_details\",\"arguments\":{\"order_id\":\"#A4412033\"}}" }, { "from": "observation", "value": "{\"order_id\":\"#A4412033\",\"user_id\":\"jordan_lee_1188\",\"address\":{\"address1\":\"2712 Maple Ave\",\"address2\":\"Apt 3B\",\"city\":\"Newark\",\"country\":\"USA\",\"state\":\"NJ\",\"zip\":\"07104\"},\"items\":[{\"name\":\"Running Shoes\",\"product_id\":\"7788990011\",\"item_id\":\"5556667771\",\"price\":129.99,\"options\":{\"size\":\"9\",\"color\":\"Black\",\"width\":\"Regular\"}},{\"name\":\"Fitness Tracker\",\"product_id\":\"9900112233\",\"item_id\":\"2223334445\",\"price\":199.00,\"options\":{\"band color\":\"Gray\"}}],\"fulfillments\":[{\"carrier\":\"UPS\",\"tracking_number\":\"1Z84E992015673219\",\"delivered_time\":\"2025-08-20 14:36:00\"}],\"status\":\"delivered\",\"payment_history\":[{\"transaction_type\":\"payment\",\"amount\":328.99,\"payment_method_id\":\"cc_4432\"}]}" }, { "from": "gpt", "value": "I see order #A4412033 is delivered, so we can request an exchange. You want to exchange:\n- Running Shoes (item 5556667771), size 9 Black → size 10 Navy\nI’ll check availability and price for the size 10 Navy option of the same Running Shoes product. Also, please confirm if there are any other items in this order you want to exchange. The exchange tool can be used only once per delivered order, so we need all items now before proceeding." }, { "from": "function_call", "value": "{\"name\":\"get_product_details\",\"arguments\":{\"product_id\":\"7788990011\"}}" }, { "from": "observation", "value": "{\"product_id\":\"7788990011\",\"name\":\"Running Shoes\",\"items\":[{\"item_id\":\"5556667771\",\"options\":{\"size\":\"9\",\"color\":\"Black\",\"width\":\"Regular\"},\"price\":129.99,\"stock\":12},{\"item_id\":\"5556667772\",\"options\":{\"size\":\"10\",\"color\":\"Navy\",\"width\":\"Regular\"},\"price\":139.99,\"stock\":7},{\"item_id\":\"5556667773\",\"options\":{\"size\":\"10\",\"color\":\"Black\",\"width\":\"Regular\"},\"price\":129.99,\"stock\":5},{\"item_id\":\"5556667774\",\"options\":{\"size\":\"10\",\"color\":\"Navy\",\"width\":\"Wide\"},\"price\":139.99,\"stock\":4},{\"item_id\":\"5556667775\",\"options\":{\"size\":\"9.5\",\"color\":\"Navy\",\"width\":\"Regular\"},\"price\":134.99,\"stock\":3}]}" }, { "from": "gpt", "value": "The requested replacement is available:\n- New item: size 10, Navy, Regular width (item 5556667772) at $139.99\n- Current item: size 9, Black (item 5556667771) at $129.99\nI’ll calculate the price difference." }, { "from": "function_call", "value": "{\"name\":\"calculate\",\"arguments\":{\"expression\":\"139.99 - 129.99\"}}" }, { "from": "observation", "value": "10" }, { "from": "gpt", "value": "Here’s the exchange summary:\n- Order ID: #A4412033 (status: delivered)\n- Exchange item(s):\n- From Running Shoes item 5556667771 (size 9 Black, $129.99)\n- To Running Shoes item 5556667772 (size 10 Navy, $139.99)\n- Price difference: $10.00 to be charged to Visa ending 4432\n- After submission, the order status will change to “exchange requested,” and you’ll receive an email with return instructions. No need to place a new order.\nPlease confirm:\n1) You want to proceed with this exchange as listed\n2) You have provided all items to be exchanged in this order (the exchange request can only be submitted once)\nReply “yes” to proceed or “no” to cancel." }, { "from": "human", "value": "Yes, please proceed. That’s the only item I need to exchange." }, { "from": "function_call", "value": "{\"name\":\"exchange_delivered_order_items\",\"arguments\":{\"order_id\":\"#A4412033\",\"exchanges\":[{\"from_item_id\":\"5556667771\",\"to_item_id\":\"5556667772\"}],\"payment_method_id\":\"cc_4432\"}}" }, { "from": "observation", "value": "{\"order_id\":\"#A4412033\",\"user_id\":\"jordan_lee_1188\",\"address\":{\"address1\":\"2712 Maple Ave\",\"address2\":\"Apt 3B\",\"city\":\"Newark\",\"country\":\"USA\",\"state\":\"NJ\",\"zip\":\"07104\"},\"items\":[{\"name\":\"Running Shoes\",\"product_id\":\"7788990011\",\"item_id\":\"5556667771\",\"price\":129.99,\"options\":{\"size\":\"9\",\"color\":\"Black\",\"width\":\"Regular\"}},{\"name\":\"Fitness Tracker\",\"product_id\":\"9900112233\",\"item_id\":\"2223334445\",\"price\":199.00,\"options\":{\"band color\":\"Gray\"}}],\"fulfillments\":[{\"carrier\":\"UPS\",\"tracking_number\":\"1Z84E992015673219\",\"delivered_time\":\"2025-08-20 14:36:00\"}],\"status\":\"exchange requested\",\"payment_history\":[{\"transaction_type\":\"payment\",\"amount\":328.99,\"payment_method_id\":\"cc_4432\"},{\"transaction_type\":\"payment\",\"amount\":10.00,\"payment_method_id\":\"cc_4432\"}],\"exchange_requests\":[{\"from_item_id\":\"5556667771\",\"to_item_id\":\"5556667772\",\"difference_charged\":10.00}]}" }, { "from": "gpt", "value": "Your exchange request for order #A4412033 has been submitted. We charged $10.00 to your Visa ending 4432 for the price difference. You’ll receive an email shortly with instructions on how to return the original shoes. There’s no need to place a new order.\nIf you need anything else, let me know." } ]
# Retail agent policy As a retail agent, you can help users cancel or modify pending orders, return or exchange delivered orders, modify their default user address, or provide information about their own profile, orders, and related products. - At the beginning of the conversation, you have to authenticate the user identity by locating their user id via email, or via name + zip code. This has to be done even when the user already provides the user id. - Once the user has been authenticated, you can provide the user with information about order, product, profile information, e.g. help the user look up order id. - You can only help one user per conversation (but you can handle multiple requests from the same user), and must deny any requests for tasks related to any other user. - Before taking consequential actions that update the database (cancel, modify, return, exchange), you have to list the action detail and obtain explicit user confirmation (yes) to proceed. - You should not make up any information or knowledge or procedures not provided from the user or the tools, or give subjective recommendations or comments. - You should at most make one tool call at a time, and if you take a tool call, you should not respond to the user at the same time. If you respond to the user, you should not make a tool call. - 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 - All times in the database are EST and 24 hour based. For example "02:30:00" means 2:30 AM EST. - Each user has a profile of its email, default address, user id, and payment methods. Each payment method is either a gift card, a paypal account, or a credit card. - Our retail store has 50 types of products. For each type of product, there are variant items of different options. For example, for a 't shirt' product, there could be an item with option 'color blue size M', and another item with option 'color red size L'. - Each product has an unique product id, and each item has an unique item id. They have no relations and should not be confused. - Each order can be in status 'pending', 'processed', 'delivered', or 'cancelled'. Generally, you can only take action on pending or delivered orders. - Exchange or modify order tools can only be called once. Be sure that all items to be changed are collected into a list before making the tool call!!! ## Cancel pending order - An order can only be cancelled if its status is 'pending', and you should check its status before taking the action. - The user needs to confirm the order id and the reason (either 'no longer needed' or 'ordered by mistake') for cancellation. - After user confirmation, the order status will be changed to 'cancelled', and the total will be refunded via the original payment method immediately if it is gift card, otherwise in 5 to 7 business days. ## Modify pending order - An order can only be modified if its status is 'pending', and you should check its status before taking the action. - For a pending order, you can take actions to modify its shipping address, payment method, or product item options, but nothing else. ### Modify payment - The user can only choose a single payment method different from the original payment method. - If the user wants the modify the payment method to gift card, it must have enough balance to cover the total amount. - After user confirmation, the order status will be kept 'pending'. The original payment method will be refunded immediately if it is a gift card, otherwise in 5 to 7 business days. ### Modify items - This action can only be called once, and will change the order status to 'pending (items modifed)', and the agent will not be able to modify or cancel the order anymore. So confirm all the details are right and be cautious before taking this action. In particular, remember to remind the customer to confirm they have provided all items to be modified. - For a pending order, each item can be modified to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. ## Return delivered order - An order can only be returned if its status is 'delivered', and you should check its status before taking the action. - The user needs to confirm the order id, the list of items to be returned, and a payment method to receive the refund. - The refund must either go to the original payment method, or an existing gift card. - After user confirmation, the order status will be changed to 'return requested', and the user will receive an email regarding how to return items. ## Exchange delivered order - An order can only be exchanged if its status is 'delivered', and you should check its status before taking the action. In particular, remember to remind the customer to confirm they have provided all items to be exchanged. - For a delivered order, each item can be exchanged to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. - After user confirmation, the order status will be changed to 'exchange requested', and the user will receive an email regarding how to return items. There is no need to place a new order.
[{"name": "calculate", "description": "Calculate the result of a mathematical expression.", "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": "cancel_pending_order", "description": "Cancel a pending order. If the order is already processed or delivered, it cannot be cancelled. The agent needs to explain the cancellation detail and ask for explicit user confirmation (yes/no) to proceed. If the user confirms, the order status will be changed to 'cancelled' and the payment will be refunded. The refund will be added to the user's gift card balance immediately if the payment was made using a gift card, otherwise the refund would take 5-7 business days to process. The function returns the order details after the cancellation.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "reason": {"type": "string", "enum": ["no longer needed", "ordered by mistake"], "description": "The reason for cancellation, which should be either 'no longer needed' or 'ordered by mistake'."}}, "required": ["order_id", "reason"]}}, {"name": "exchange_delivered_order_items", "description": "Exchange items in a delivered order to new items of the same product type. For a delivered order, return or exchange can be only done once by the agent. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "find_user_id_by_email", "description": "Find user id by email. If the user is not found, the function will return an error message.", "parameters": {"type": "object", "properties": {"email": {"type": "string", "description": "The email of the user, such as '[email protected]'."}}, "required": ["email"]}}, {"name": "find_user_id_by_name_zip", "description": "Find user id by first name, last name, and zip code. If the user is not found, the function will return an error message. By default, find user id by email, and only call this function if the user is not found by email or cannot remember email.", "parameters": {"type": "object", "properties": {"first_name": {"type": "string", "description": "The first name of the customer, such as 'John'."}, "last_name": {"type": "string", "description": "The last name of the customer, such as 'Doe'."}, "zip": {"type": "string", "description": "The zip code of the customer, such as '12345'."}}, "required": ["first_name", "last_name", "zip"]}}, {"name": "get_order_details", "description": "Get the status and details of an order.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}}, "required": ["order_id"]}}, {"name": "get_product_details", "description": "Get the inventory details of a product.", "parameters": {"type": "object", "properties": {"product_id": {"type": "string", "description": "The product id, such as '6086499569'. Be careful the product id is different from the item id."}}, "required": ["product_id"]}}, {"name": "get_user_details", "description": "Get the details of an user.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}}, "required": ["user_id"]}}, {"name": "list_all_product_types", "description": "List the name and product id of all product types. Each product type has a variety of different items with unique item ids and options. There are only 50 product types in the store.", "parameters": {"type": "object", "properties": {}, "required": []}}, {"name": "modify_pending_order_address", "description": "Modify the shipping address of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["order_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "modify_pending_order_items", "description": "Modify items in a pending order to new items of the same product type. For a pending order, this function can only be called once. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "modify_pending_order_payment", "description": "Modify the payment method of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "payment_method_id"]}}, {"name": "modify_user_address", "description": "Modify the default address of an user. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["user_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "return_delivered_order_items", "description": "Return some items of a delivered order. The order status will be changed to 'return requested'. The agent needs to explain the return detail and ask for explicit user confirmation (yes/no) to proceed. The user will receive follow-up email for how and where to return the item.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be returned, each such as '1008292230'. There could be duplicate items in the list."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "payment_method_id"]}}, {"name": "transfer_to_human_agents", "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.", "parameters": {"type": "object", "properties": {"summary": {"type": "string", "description": "A summary of the user's issue."}}, "required": ["summary"]}}]
apigen_general_-863434540578730952
16
20
general
Hello, I accidentally made a purchase that needs to be cancelled. Can you assist me?
[ { "from": "human", "value": "I'd like to cancel my reservation." }, { "from": "gpt", "value": "I can help with that. To proceed, please provide:\n1) Your user ID (e.g., 'sara_doe_496')\n2) Your reservation ID (e.g., 'ZFA04Y')\n3) The reason for cancellation (change of plan, airline cancelled flight, or other reasons)" }, { "from": "human", "value": "My user ID is emily_chen_1024, reservation ID is A1B2C3, and the reason is change of plan." }, { "from": "function_call", "value": "{\"name\":\"get_reservation_details\",\"arguments\":\"{\\\"reservation_id\\\":\\\"A1B2C3\\\"}\"}" }, { "from": "observation", "value": "{\"reservation_id\": \"A1B2C3\", \"user_id\": \"emily_chen_1024\", \"origin\": \"SEA\", \"destination\": \"JFK\", \"flight_type\": \"round_trip\", \"cabin\": \"economy\", \"flights\": [{\"origin\": \"SEA\", \"destination\": \"JFK\", \"flight_number\": \"HAT120\", \"date\": \"2024-06-10\", \"price\": 420}, {\"origin\": \"JFK\", \"destination\": \"SEA\", \"flight_number\": \"HAT121\", \"date\": \"2024-06-15\", \"price\": 420}], \"passengers\": [{\"first_name\": \"Emily\", \"last_name\": \"Chen\", \"dob\": \"1990-04-12\"}, {\"first_name\": \"David\", \"last_name\": \"Chen\", \"dob\": \"2015-03-08\"}], \"payment_history\": [{\"payment_id\": \"credit_card_1234567\", \"amount\": 840}], \"created_at\": \"2024-05-15T11:30:00\", \"total_baggages\": 0, \"nonfree_baggages\": 0, \"insurance\": \"no\"}" }, { "from": "function_call", "value": "{\"name\":\"get_user_details\",\"arguments\":\"{\\\"user_id\\\":\\\"emily_chen_1024\\\"}\"}" }, { "from": "observation", "value": "{\"name\": {\"first_name\": \"Emily\", \"last_name\": \"Chen\"}, \"address\": {\"address1\": \"712 Pine Street\", \"address2\": \"Apt 5C\", \"city\": \"Seattle\", \"country\": \"USA\", \"province\": \"WA\", \"zip\": \"98101\"}, \"email\": \"[email protected]\", \"dob\": \"1990-04-12\", \"payment_methods\": {\"credit_card_1234567\": {\"source\": \"credit_card\", \"brand\": \"visa\", \"last_four\": \"4412\", \"id\": \"credit_card_1234567\"}, \"gift_card_778899\": {\"source\": \"gift_card\", \"amount\": 120, \"id\": \"gift_card_778899\"}}, \"saved_passengers\": [{\"first_name\": \"David\", \"last_name\": \"Chen\", \"dob\": \"2015-03-08\"}], \"membership\": \"regular\", \"reservations\": [\"A1B2C3\", \"Q9W8E7\"]}" }, { "from": "gpt", "value": "Here’s what I found for reservation A1B2C3:\n- Trip: Round trip SEA ↔ JFK\n- Cabin: Economy\n- Passengers: Emily Chen and David Chen\n- Booking time: 2024-05-15T11:30:00\n- Reason for cancellation: Change of plan\nEligibility check:\n- This reservation was created within the last 24 hours, so it is eligible for cancellation regardless of fare type.\n- Refunds go back to the original payment method(s) within 5–7 business days.\nAction details:\n- Cancel the entire reservation A1B2C3 (all flights not yet flown)\n- Reason: Change of plan\n- Refund: $840 back to the original payment method (credit_card_1234567)\nPlease confirm with “yes” to proceed with the cancellation." }, { "from": "human", "value": "Yes, please cancel it." }, { "from": "function_call", "value": "{\"name\":\"cancel_reservation\",\"arguments\":\"{\\\"reservation_id\\\":\\\"A1B2C3\\\",\\\"reason\\\":\\\"change of plan\\\"}\"}" }, { "from": "observation", "value": "{\"reservation_id\": \"A1B2C3\", \"status\": \"cancelled\", \"refund\": {\"payment_id\": \"credit_card_1234567\", \"amount\": 840}, \"message\": \"Reservation cancelled. Refund will be processed to original payment method.\"}" }, { "from": "gpt", "value": "Your reservation A1B2C3 has been cancelled successfully.\nRefund details:\n- Amount: $840\n- Refund method: Original payment method (credit_card_1234567)\n- Timeline: 5–7 business days\nIs there anything else I can help you with today?" } ]
# 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.
[{"name": "book_reservation", "description": "Book a 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": "calculate", "description": "Calculate the result of a mathematical expression.", "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": "cancel_reservation", "description": "Cancel the whole reservation.", "parameters": {"type": "object", "properties": {"reservation_id": {"type": "string", "description": "The reservation ID, such as 'ZFA04Y'."}}, "required": ["reservation_id"]}}, {"name": "get_reservation_details", "description": "Get the details of a reservation.", "parameters": {"type": "object", "properties": {"reservation_id": {"type": "string", "description": "The reservation id, such as '8JX2WO'."}}, "required": ["reservation_id"]}}, {"name": "get_user_details", "description": "Get the details of an user.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}}, "required": ["user_id"]}}, {"name": "list_all_airports", "description": "List all airports and their cities.", "parameters": {"type": "object", "properties": {}, "required": []}}, {"name": "search_direct_flight", "description": "Search direct flights between two cities on a specific date.", "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": "search_onestop_flight", "description": "Search direct flights between two cities on a specific date.", "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": "send_certificate", "description": "Send a certificate to a user. Be careful!", "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": "think", "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.", "parameters": {"type": "object", "properties": {"thought": {"type": "string", "description": "The step by step thought process."}}, "required": ["thought"]}}, {"name": "transfer_to_human_agents", "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.", "parameters": {"type": "object", "properties": {"summary": {"type": "string", "description": "A summary of the user's issue."}}, "required": ["summary"]}}, {"name": "update_reservation_baggages", "description": "Update the baggage information of a reservation.", "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": "update_reservation_flights", "description": "Update the flight information of a reservation.", "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": "update_reservation_passengers", "description": "Update the passenger information of a reservation.", "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"]}}]
apigen_general_4476065888476300540
12
12
general
Hello, I'd like to add two checked bags to my existing reservation.
[ { "from": "human", "value": "Hi there, I need to change the size of the running shoes I ordered yesterday. Can you help me with that?" }, { "from": "gpt", "value": "I can help with that. First, I need to authenticate your identity. Please provide your email address, or your full name and zip code." }, { "from": "human", "value": "Sure, my email is [email protected]." }, { "from": "function_call", "value": "{\"name\": \"find_user_id_by_email\", \"arguments\": {\"email\": \"[email protected]\"}}" }, { "from": "observation", "value": "marco_lee_7741" }, { "from": "gpt", "value": "Thank you, Marco. Your identity has been verified. Please provide the order ID for the running shoes you want to modify." }, { "from": "human", "value": "The order ID is #A1029384." }, { "from": "function_call", "value": "{\"name\": \"get_order_details\", \"arguments\": {\"order_id\": \"#A1029384\"}}" }, { "from": "observation", "value": "{\"order_id\": \"#A1029384\", \"user_id\": \"marco_lee_7741\", \"address\": {\"address1\": \"45 Parkview Ave\", \"address2\": \"\", \"city\": \"Austin\", \"country\": \"USA\", \"state\": \"TX\", \"zip\": \"73301\"}, \"items\": [{\"name\": \"Running Shoes Pro\", \"product_id\": \"prod_901122\", \"item_id\": \"item_555100\", \"price\": 129.99, \"options\": {\"color\": \"blue\", \"size\": \"9\"}}, {\"name\": \"Performance Socks\", \"product_id\": \"prod_778899\", \"item_id\": \"item_777300\", \"price\": 15.00, \"options\": {\"color\": \"black\", \"size\": \"L\"}}], \"fulfillments\": [], \"status\": \"pending\", \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 144.99, \"payment_method_id\": \"visa_8394\"}]}" }, { "from": "gpt", "value": "I see order #A1029384 is in pending status, so we can modify it. Would you like to modify only the running shoes, or any other items as well? For the shoes, please provide the new item ID (same product, different options like size/color). Also, let me know which payment method you want to use for any price difference. Note: modifying items can only be done once per pending order, so please confirm all items you want changed in this request." }, { "from": "human", "value": "Just the running shoes. I want size 10 in red, item ID item_555210. Use my gift card gc_2401 for any difference." }, { "from": "function_call", "value": "{\"name\": \"get_user_details\", \"arguments\": {\"user_id\": \"marco_lee_7741\"}}" }, { "from": "observation", "value": "{\"user_id\": \"marco_lee_7741\", \"email\": \"[email protected]\", \"default_address\": {\"address1\": \"45 Parkview Ave\", \"address2\": \"\", \"city\": \"Austin\", \"country\": \"USA\", \"state\": \"TX\", \"zip\": \"73301\"}, \"payment_methods\": [{\"payment_method_id\": \"visa_8394\", \"type\": \"credit_card\", \"details\": {\"last4\": \"8394\"}}, {\"payment_method_id\": \"paypal_551102\", \"type\": \"paypal\", \"details\": {\"email\": \"[email protected]\"}}, {\"payment_method_id\": \"gc_2401\", \"type\": \"gift_card\", \"details\": {\"balance\": 8.00}}]}" }, { "from": "gpt", "value": "Thanks. I’ll check the price of the new variant to calculate the difference and make sure your gift card balance covers it." }, { "from": "function_call", "value": "{\"name\": \"get_product_details\", \"arguments\": {\"product_id\": \"prod_901122\"}}" }, { "from": "observation", "value": "{\"product_id\": \"prod_901122\", \"name\": \"Running Shoes Pro\", \"items\": [{\"item_id\": \"item_555090\", \"options\": {\"color\": \"black\", \"size\": \"9\"}, \"price\": 129.99}, {\"item_id\": \"item_555100\", \"options\": {\"color\": \"blue\", \"size\": \"9\"}, \"price\": 129.99}, {\"item_id\": \"item_555200\", \"options\": {\"color\": \"red\", \"size\": \"9\"}, \"price\": 129.99}, {\"item_id\": \"item_555210\", \"options\": {\"color\": \"red\", \"size\": \"10\"}, \"price\": 134.50}, {\"item_id\": \"item_555220\", \"options\": {\"color\": \"blue\", \"size\": \"10\"}, \"price\": 129.99}]}" }, { "from": "function_call", "value": "{\"name\": \"calculate\", \"arguments\": {\"expression\": \"134.50 - 129.99\"}}" }, { "from": "observation", "value": "4.51" }, { "from": "gpt", "value": "Here are the details I will proceed with:\n- Order: #A1029384 (status: pending)\n- Change items: Running Shoes Pro item_555100 (blue, size 9, $129.99) → item_555210 (red, size 10, $134.50)\n- Price difference: $4.51\n- Payment method for difference: gift card gc_2401 (current balance: $8.00), which is sufficient\nPlease confirm: Do you want me to proceed with modifying this order as listed? Reminder: modifying items can only be done once for a pending order, and after this change, the order cannot be modified or cancelled by me. Have you included all items you want to change? Reply “yes” to proceed or “no” to cancel." }, { "from": "human", "value": "Yes, please proceed." }, { "from": "function_call", "value": "{\"name\": \"modify_pending_order_items\", \"arguments\": {\"order_id\": \"#A1029384\", \"item_ids\": [\"item_555100\"], \"new_item_ids\": [\"item_555210\"], \"payment_method_id\": \"gc_2401\"}}" }, { "from": "observation", "value": "{\"order_id\": \"#A1029384\", \"user_id\": \"marco_lee_7741\", \"address\": {\"address1\": \"45 Parkview Ave\", \"address2\": \"\", \"city\": \"Austin\", \"country\": \"USA\", \"state\": \"TX\", \"zip\": \"73301\"}, \"items\": [{\"name\": \"Running Shoes Pro\", \"product_id\": \"prod_901122\", \"item_id\": \"item_555210\", \"price\": 134.50, \"options\": {\"color\": \"red\", \"size\": \"10\"}}, {\"name\": \"Performance Socks\", \"product_id\": \"prod_778899\", \"item_id\": \"item_777300\", \"price\": 15.00, \"options\": {\"color\": \"black\", \"size\": \"L\"}}], \"fulfillments\": [], \"status\": \"pending (items modified)\", \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 144.99, \"payment_method_id\": \"visa_8394\"}, {\"transaction_type\": \"adjustment\", \"amount\": 4.51, \"payment_method_id\": \"gc_2401\"}]}" }, { "from": "gpt", "value": "Your order has been updated successfully.\n- The Running Shoes Pro have been changed to item_555210 (red, size 10) at $134.50.\n- A price difference of $4.51 was charged to your gift card gc_2401.\n- Order status is now “pending (items modified).” Further modifications or cancellations are no longer available through me for this order.\n- Shipping address and the rest of the items remain unchanged.\nIs there anything else I can help you with today?" } ]
# Retail agent policy As a retail agent, you can help users cancel or modify pending orders, return or exchange delivered orders, modify their default user address, or provide information about their own profile, orders, and related products. - At the beginning of the conversation, you have to authenticate the user identity by locating their user id via email, or via name + zip code. This has to be done even when the user already provides the user id. - Once the user has been authenticated, you can provide the user with information about order, product, profile information, e.g. help the user look up order id. - You can only help one user per conversation (but you can handle multiple requests from the same user), and must deny any requests for tasks related to any other user. - Before taking consequential actions that update the database (cancel, modify, return, exchange), you have to list the action detail and obtain explicit user confirmation (yes) to proceed. - You should not make up any information or knowledge or procedures not provided from the user or the tools, or give subjective recommendations or comments. - You should at most make one tool call at a time, and if you take a tool call, you should not respond to the user at the same time. If you respond to the user, you should not make a tool call. - 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 - All times in the database are EST and 24 hour based. For example "02:30:00" means 2:30 AM EST. - Each user has a profile of its email, default address, user id, and payment methods. Each payment method is either a gift card, a paypal account, or a credit card. - Our retail store has 50 types of products. For each type of product, there are variant items of different options. For example, for a 't shirt' product, there could be an item with option 'color blue size M', and another item with option 'color red size L'. - Each product has an unique product id, and each item has an unique item id. They have no relations and should not be confused. - Each order can be in status 'pending', 'processed', 'delivered', or 'cancelled'. Generally, you can only take action on pending or delivered orders. - Exchange or modify order tools can only be called once. Be sure that all items to be changed are collected into a list before making the tool call!!! ## Cancel pending order - An order can only be cancelled if its status is 'pending', and you should check its status before taking the action. - The user needs to confirm the order id and the reason (either 'no longer needed' or 'ordered by mistake') for cancellation. - After user confirmation, the order status will be changed to 'cancelled', and the total will be refunded via the original payment method immediately if it is gift card, otherwise in 5 to 7 business days. ## Modify pending order - An order can only be modified if its status is 'pending', and you should check its status before taking the action. - For a pending order, you can take actions to modify its shipping address, payment method, or product item options, but nothing else. ### Modify payment - The user can only choose a single payment method different from the original payment method. - If the user wants the modify the payment method to gift card, it must have enough balance to cover the total amount. - After user confirmation, the order status will be kept 'pending'. The original payment method will be refunded immediately if it is a gift card, otherwise in 5 to 7 business days. ### Modify items - This action can only be called once, and will change the order status to 'pending (items modifed)', and the agent will not be able to modify or cancel the order anymore. So confirm all the details are right and be cautious before taking this action. In particular, remember to remind the customer to confirm they have provided all items to be modified. - For a pending order, each item can be modified to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. ## Return delivered order - An order can only be returned if its status is 'delivered', and you should check its status before taking the action. - The user needs to confirm the order id, the list of items to be returned, and a payment method to receive the refund. - The refund must either go to the original payment method, or an existing gift card. - After user confirmation, the order status will be changed to 'return requested', and the user will receive an email regarding how to return items. ## Exchange delivered order - An order can only be exchanged if its status is 'delivered', and you should check its status before taking the action. In particular, remember to remind the customer to confirm they have provided all items to be exchanged. - For a delivered order, each item can be exchanged to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. - After user confirmation, the order status will be changed to 'exchange requested', and the user will receive an email regarding how to return items. There is no need to place a new order.
[{"name": "calculate", "description": "Calculate the result of a mathematical expression.", "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": "cancel_pending_order", "description": "Cancel a pending order. If the order is already processed or delivered, it cannot be cancelled. The agent needs to explain the cancellation detail and ask for explicit user confirmation (yes/no) to proceed. If the user confirms, the order status will be changed to 'cancelled' and the payment will be refunded. The refund will be added to the user's gift card balance immediately if the payment was made using a gift card, otherwise the refund would take 5-7 business days to process. The function returns the order details after the cancellation.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "reason": {"type": "string", "enum": ["no longer needed", "ordered by mistake"], "description": "The reason for cancellation, which should be either 'no longer needed' or 'ordered by mistake'."}}, "required": ["order_id", "reason"]}}, {"name": "exchange_delivered_order_items", "description": "Exchange items in a delivered order to new items of the same product type. For a delivered order, return or exchange can be only done once by the agent. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "find_user_id_by_email", "description": "Find user id by email. If the user is not found, the function will return an error message.", "parameters": {"type": "object", "properties": {"email": {"type": "string", "description": "The email of the user, such as '[email protected]'."}}, "required": ["email"]}}, {"name": "find_user_id_by_name_zip", "description": "Find user id by first name, last name, and zip code. If the user is not found, the function will return an error message. By default, find user id by email, and only call this function if the user is not found by email or cannot remember email.", "parameters": {"type": "object", "properties": {"first_name": {"type": "string", "description": "The first name of the customer, such as 'John'."}, "last_name": {"type": "string", "description": "The last name of the customer, such as 'Doe'."}, "zip": {"type": "string", "description": "The zip code of the customer, such as '12345'."}}, "required": ["first_name", "last_name", "zip"]}}, {"name": "get_order_details", "description": "Get the status and details of an order.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}}, "required": ["order_id"]}}, {"name": "get_product_details", "description": "Get the inventory details of a product.", "parameters": {"type": "object", "properties": {"product_id": {"type": "string", "description": "The product id, such as '6086499569'. Be careful the product id is different from the item id."}}, "required": ["product_id"]}}, {"name": "get_user_details", "description": "Get the details of an user.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}}, "required": ["user_id"]}}, {"name": "list_all_product_types", "description": "List the name and product id of all product types. Each product type has a variety of different items with unique item ids and options. There are only 50 product types in the store.", "parameters": {"type": "object", "properties": {}, "required": []}}, {"name": "modify_pending_order_address", "description": "Modify the shipping address of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["order_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "modify_pending_order_items", "description": "Modify items in a pending order to new items of the same product type. For a pending order, this function can only be called once. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "modify_pending_order_payment", "description": "Modify the payment method of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "payment_method_id"]}}, {"name": "modify_user_address", "description": "Modify the default address of an user. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["user_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "return_delivered_order_items", "description": "Return some items of a delivered order. The order status will be changed to 'return requested'. The agent needs to explain the return detail and ask for explicit user confirmation (yes/no) to proceed. The user will receive follow-up email for how and where to return the item.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be returned, each such as '1008292230'. There could be duplicate items in the list."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "payment_method_id"]}}, {"name": "transfer_to_human_agents", "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.", "parameters": {"type": "object", "properties": {"summary": {"type": "string", "description": "A summary of the user's issue."}}, "required": ["summary"]}}]
apigen_general_-3957603683190390887
16
23
general
Hello! I recently bought a desk lamp from you, but I think I need one with a bit more brightness. Would it be possible to exchange it?
[ { "from": "human", "value": "Hi, I received my order and I want to return a couple of items. Can you help?" }, { "from": "gpt", "value": "I can help with that. First, I need to verify your identity. Please provide the email address on your account. If you don’t remember it, we can use your first name, last name, and zip code instead." }, { "from": "human", "value": "Sure, it’s [email protected]." }, { "from": "function_call", "value": "{\"name\":\"find_user_id_by_email\",\"arguments\":{\"email\":\"[email protected]\"}}" }, { "from": "observation", "value": "li_wei_2045" }, { "from": "gpt", "value": "Thanks. I’ve located your account. Please provide the order ID you want to return items from. If you’re not sure of the order ID, I can help you look it up." }, { "from": "human", "value": "The order ID is #A5573219." }, { "from": "function_call", "value": "{\"name\":\"get_order_details\",\"arguments\":{\"order_id\":\"#A5573219\"}}" }, { "from": "observation", "value": "{\"order_id\":\"#A5573219\",\"user_id\":\"li_wei_2045\",\"address\":{\"address1\":\"2450 Pine Street\",\"address2\":\"Unit 12B\",\"city\":\"Philadelphia\",\"country\":\"USA\",\"state\":\"PA\",\"zip\":\"19107\"},\"items\":[{\"name\":\"Running Shoes\",\"product_id\":\"1029384756\",\"item_id\":\"8844221100\",\"price\":119.99,\"options\":{\"size\":\"9\",\"color\":\"black\"}},{\"name\":\"Gaming Keyboard\",\"product_id\":\"5647382910\",\"item_id\":\"7766554433\",\"price\":149.5,\"options\":{\"switch\":\"blue\",\"layout\":\"tenkeyless\",\"backlight\":\"RGB\"}},{\"name\":\"Electric Kettle\",\"product_id\":\"9988776655\",\"item_id\":\"1122334455\",\"price\":69.99,\"options\":{\"capacity\":\"1.7L\",\"color\":\"stainless steel\"}},{\"name\":\"Noise-Cancelling Headphones\",\"product_id\":\"2233445566\",\"item_id\":\"6677889900\",\"price\":289.99,\"options\":{\"color\":\"silver\",\"microphone\":\"yes\",\"wireless\":\"yes\"}}],\"fulfillments\":[{\"carrier\":\"UPS\",\"tracking_number\":\"1Z8927X33000123456\",\"delivered_at\":\"2025-08-15 14:22:00\"}],\"status\":\"delivered\",\"payment_history\":[{\"transaction_type\":\"payment\",\"amount\":629.47,\"payment_method_id\":\"paypal_82910\"}]}" }, { "from": "gpt", "value": "I see order #A5573219, and its status is delivered, so it is eligible for a return. Which items from this order would you like to return, and where would you like the refund to go—your original PayPal used for the order, or an existing gift card on your account?" }, { "from": "human", "value": "I’d like to return the Gaming Keyboard and the Electric Kettle. Please refund to my original PayPal." }, { "from": "function_call", "value": "{\"name\":\"calculate\",\"arguments\":{\"expression\":\"149.50 + 69.99\"}}" }, { "from": "observation", "value": "219.49" }, { "from": "gpt", "value": "Here’s what I have for your return request:\n- Order: #A5573219\n- Items to return:\n• Gaming Keyboard (item_id: 7766554433) — $149.50\n• Electric Kettle (item_id: 1122334455) — $69.99\n- Refund amount: $219.49\n- Refund destination: Original PayPal (payment_method_id: paypal_82910)\nAfter we proceed, the order status will change to “return requested,” and you’ll receive an email with instructions on how and where to return the items. Please confirm that all details are correct and that you want to proceed (yes/no)." }, { "from": "human", "value": "Yes, please proceed." }, { "from": "function_call", "value": "{\"name\":\"return_delivered_order_items\",\"arguments\":{\"order_id\":\"#A5573219\",\"items\":[{\"item_id\":\"7766554433\"},{\"item_id\":\"1122334455\"}],\"refund_to\":\"original_payment_method\",\"payment_method_id\":\"paypal_82910\"}}" }, { "from": "observation", "value": "{\"order_id\":\"#A5573219\",\"user_id\":\"li_wei_2045\",\"status\":\"return requested\",\"return_items\":[{\"item_id\":\"7766554433\",\"name\":\"Gaming Keyboard\",\"price\":149.5},{\"item_id\":\"1122334455\",\"name\":\"Electric Kettle\",\"price\":69.99}],\"refund\":{\"amount\":219.49,\"refund_to\":\"paypal_82910\"}}" }, { "from": "gpt", "value": "Your return request is submitted for order #A5573219. The Gaming Keyboard and Electric Kettle have been marked for return, and a refund of $219.49 will be issued to your original PayPal (paypal_82910) after the items are received and processed. You’ll receive an email shortly with instructions for returning the items.\nIs there anything else I can assist you with today?" } ]
# Retail agent policy As a retail agent, you can help users cancel or modify pending orders, return or exchange delivered orders, modify their default user address, or provide information about their own profile, orders, and related products. - At the beginning of the conversation, you have to authenticate the user identity by locating their user id via email, or via name + zip code. This has to be done even when the user already provides the user id. - Once the user has been authenticated, you can provide the user with information about order, product, profile information, e.g. help the user look up order id. - You can only help one user per conversation (but you can handle multiple requests from the same user), and must deny any requests for tasks related to any other user. - Before taking consequential actions that update the database (cancel, modify, return, exchange), you have to list the action detail and obtain explicit user confirmation (yes) to proceed. - You should not make up any information or knowledge or procedures not provided from the user or the tools, or give subjective recommendations or comments. - You should at most make one tool call at a time, and if you take a tool call, you should not respond to the user at the same time. If you respond to the user, you should not make a tool call. - 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 - All times in the database are EST and 24 hour based. For example "02:30:00" means 2:30 AM EST. - Each user has a profile of its email, default address, user id, and payment methods. Each payment method is either a gift card, a paypal account, or a credit card. - Our retail store has 50 types of products. For each type of product, there are variant items of different options. For example, for a 't shirt' product, there could be an item with option 'color blue size M', and another item with option 'color red size L'. - Each product has an unique product id, and each item has an unique item id. They have no relations and should not be confused. - Each order can be in status 'pending', 'processed', 'delivered', or 'cancelled'. Generally, you can only take action on pending or delivered orders. - Exchange or modify order tools can only be called once. Be sure that all items to be changed are collected into a list before making the tool call!!! ## Cancel pending order - An order can only be cancelled if its status is 'pending', and you should check its status before taking the action. - The user needs to confirm the order id and the reason (either 'no longer needed' or 'ordered by mistake') for cancellation. - After user confirmation, the order status will be changed to 'cancelled', and the total will be refunded via the original payment method immediately if it is gift card, otherwise in 5 to 7 business days. ## Modify pending order - An order can only be modified if its status is 'pending', and you should check its status before taking the action. - For a pending order, you can take actions to modify its shipping address, payment method, or product item options, but nothing else. ### Modify payment - The user can only choose a single payment method different from the original payment method. - If the user wants the modify the payment method to gift card, it must have enough balance to cover the total amount. - After user confirmation, the order status will be kept 'pending'. The original payment method will be refunded immediately if it is a gift card, otherwise in 5 to 7 business days. ### Modify items - This action can only be called once, and will change the order status to 'pending (items modifed)', and the agent will not be able to modify or cancel the order anymore. So confirm all the details are right and be cautious before taking this action. In particular, remember to remind the customer to confirm they have provided all items to be modified. - For a pending order, each item can be modified to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. ## Return delivered order - An order can only be returned if its status is 'delivered', and you should check its status before taking the action. - The user needs to confirm the order id, the list of items to be returned, and a payment method to receive the refund. - The refund must either go to the original payment method, or an existing gift card. - After user confirmation, the order status will be changed to 'return requested', and the user will receive an email regarding how to return items. ## Exchange delivered order - An order can only be exchanged if its status is 'delivered', and you should check its status before taking the action. In particular, remember to remind the customer to confirm they have provided all items to be exchanged. - For a delivered order, each item can be exchanged to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. - After user confirmation, the order status will be changed to 'exchange requested', and the user will receive an email regarding how to return items. There is no need to place a new order.
[{"name": "calculate", "description": "Calculate the result of a mathematical expression.", "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": "cancel_pending_order", "description": "Cancel a pending order. If the order is already processed or delivered, it cannot be cancelled. The agent needs to explain the cancellation detail and ask for explicit user confirmation (yes/no) to proceed. If the user confirms, the order status will be changed to 'cancelled' and the payment will be refunded. The refund will be added to the user's gift card balance immediately if the payment was made using a gift card, otherwise the refund would take 5-7 business days to process. The function returns the order details after the cancellation.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "reason": {"type": "string", "enum": ["no longer needed", "ordered by mistake"], "description": "The reason for cancellation, which should be either 'no longer needed' or 'ordered by mistake'."}}, "required": ["order_id", "reason"]}}, {"name": "exchange_delivered_order_items", "description": "Exchange items in a delivered order to new items of the same product type. For a delivered order, return or exchange can be only done once by the agent. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "find_user_id_by_email", "description": "Find user id by email. If the user is not found, the function will return an error message.", "parameters": {"type": "object", "properties": {"email": {"type": "string", "description": "The email of the user, such as '[email protected]'."}}, "required": ["email"]}}, {"name": "find_user_id_by_name_zip", "description": "Find user id by first name, last name, and zip code. If the user is not found, the function will return an error message. By default, find user id by email, and only call this function if the user is not found by email or cannot remember email.", "parameters": {"type": "object", "properties": {"first_name": {"type": "string", "description": "The first name of the customer, such as 'John'."}, "last_name": {"type": "string", "description": "The last name of the customer, such as 'Doe'."}, "zip": {"type": "string", "description": "The zip code of the customer, such as '12345'."}}, "required": ["first_name", "last_name", "zip"]}}, {"name": "get_order_details", "description": "Get the status and details of an order.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}}, "required": ["order_id"]}}, {"name": "get_product_details", "description": "Get the inventory details of a product.", "parameters": {"type": "object", "properties": {"product_id": {"type": "string", "description": "The product id, such as '6086499569'. Be careful the product id is different from the item id."}}, "required": ["product_id"]}}, {"name": "get_user_details", "description": "Get the details of an user.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}}, "required": ["user_id"]}}, {"name": "list_all_product_types", "description": "List the name and product id of all product types. Each product type has a variety of different items with unique item ids and options. There are only 50 product types in the store.", "parameters": {"type": "object", "properties": {}, "required": []}}, {"name": "modify_pending_order_address", "description": "Modify the shipping address of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["order_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "modify_pending_order_items", "description": "Modify items in a pending order to new items of the same product type. For a pending order, this function can only be called once. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "modify_pending_order_payment", "description": "Modify the payment method of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "payment_method_id"]}}, {"name": "modify_user_address", "description": "Modify the default address of an user. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["user_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "return_delivered_order_items", "description": "Return some items of a delivered order. The order status will be changed to 'return requested'. The agent needs to explain the return detail and ask for explicit user confirmation (yes/no) to proceed. The user will receive follow-up email for how and where to return the item.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be returned, each such as '1008292230'. There could be duplicate items in the list."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "payment_method_id"]}}, {"name": "think", "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.", "parameters": {"type": "object", "properties": {"thought": {"type": "string", "description": "The step by step thought process."}}, "required": ["thought"]}}, {"name": "transfer_to_human_agents", "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.", "parameters": {"type": "object", "properties": {"summary": {"type": "string", "description": "A summary of the user's issue."}}, "required": ["summary"]}}]
apigen_general_1214696953512471759
14
18
general
Hello! I've made an order recently and I need to change the shipping address for it. Can you assist me with that?
[ { "from": "human", "value": "Hi! I need to return a couple of items from my last delivery." }, { "from": "gpt", "value": "I can help with that. First, I need to authenticate your identity. Please provide your email address. If you don’t remember it, you can provide your first name, last name, and zip code instead." }, { "from": "human", "value": "Sure, it’s [email protected]." }, { "from": "function_call", "value": "{\"name\": \"find_user_id_by_email\", \"arguments\": \"{\\\"email\\\": \\\"[email protected]\\\"}\"}" }, { "from": "observation", "value": "marcus_lee_1382" }, { "from": "gpt", "value": "Thanks, Marcus. I’ve verified your identity.\nPlease provide the order ID for the delivery you want to return items from. If you don’t have it handy, I can help look it up. Also, let me know which items you want to return and which payment method to receive the refund: either the original payment method used for the order or an existing gift card on your account." }, { "from": "human", "value": "The order ID is #A9123409. I want to return the yoga mat and the stainless steel water bottle, and please refund to the same card I used." }, { "from": "function_call", "value": "{\"name\": \"get_order_details\", \"arguments\": \"{\\\"order_id\\\": \\\"#A9123409\\\"}\"}" }, { "from": "observation", "value": "{\"order_id\": \"#A9123409\", \"user_id\": \"marcus_lee_1382\", \"address\": {\"address1\": \"1250 Harrison St\", \"address2\": \"Apt 12B\", \"city\": \"San Francisco\", \"country\": \"USA\", \"state\": \"CA\", \"zip\": \"94107\"}, \"items\": [{\"name\": \"Bluetooth Headphones\", \"product_id\": \"2039485761\", \"item_id\": \"3301457890\", \"price\": 89.99, \"options\": {\"color\": \"black\", \"connectivity\": \"Bluetooth 5.2\"}}, {\"name\": \"Yoga Mat\", \"product_id\": \"7720348891\", \"item_id\": \"7744021188\", \"price\": 35.5, \"options\": {\"color\": \"teal\", \"thickness\": \"6mm\"}}, {\"name\": \"Stainless Steel Water Bottle\", \"product_id\": \"6655983210\", \"item_id\": \"5566123499\", \"price\": 22.0, \"options\": {\"size\": \"750ml\", \"color\": \"silver\"}}], \"fulfillments\": [{\"tracking_id\": [\"1Z999AA10123456784\"], \"item_ids\": [\"3301457890\", \"7744021188\", \"5566123499\"]}], \"status\": \"delivered\", \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 147.49, \"payment_method_id\": \"credit_card_0234\"}]}" }, { "from": "function_call", "value": "{\"name\": \"calculate\", \"arguments\": \"{\\\"expression\\\": \\\"35.5 + 22.0\\\"}\"}" }, { "from": "observation", "value": "57.5" }, { "from": "gpt", "value": "I found your order #A9123409, and it’s delivered, so we can proceed with a return.\nHere are the return details:\n- Items to return:\n- Yoga Mat (item ID: 7744021188) – $35.50\n- Stainless Steel Water Bottle (item ID: 5566123499) – $22.00\n- Refund total: $57.50\n- Refund method: Original payment method (credit_card_0234)\n- Order status after submission: return requested\n- You’ll receive an email with instructions on how to return the items.\nBefore I proceed, please confirm:\n1) You want to return item IDs 7744021188 and 5566123499 from order #A9123409\n2) You agree to receive a $57.50 refund to the original card (credit_card_0234)\nReply “yes” to confirm or let me know if you need any changes." }, { "from": "human", "value": "Yes, please proceed." }, { "from": "function_call", "value": "{\"name\": \"return_delivered_order_items\", \"arguments\": \"{\\\"order_id\\\": \\\"#A9123409\\\", \\\"item_ids\\\": [\\\"7744021188\\\", \\\"5566123499\\\"], \\\"payment_method_id\\\": \\\"credit_card_0234\\\"}\"}" }, { "from": "observation", "value": "{\"order_id\": \"#A9123409\", \"user_id\": \"marcus_lee_1382\", \"address\": {\"address1\": \"1250 Harrison St\", \"address2\": \"Apt 12B\", \"city\": \"San Francisco\", \"country\": \"USA\", \"state\": \"CA\", \"zip\": \"94107\"}, \"items\": [{\"name\": \"Bluetooth Headphones\", \"product_id\": \"2039485761\", \"item_id\": \"3301457890\", \"price\": 89.99, \"options\": {\"color\": \"black\", \"connectivity\": \"Bluetooth 5.2\"}}, {\"name\": \"Yoga Mat\", \"product_id\": \"7720348891\", \"item_id\": \"7744021188\", \"price\": 35.5, \"options\": {\"color\": \"teal\", \"thickness\": \"6mm\"}}, {\"name\": \"Stainless Steel Water Bottle\", \"product_id\": \"6655983210\", \"item_id\": \"5566123499\", \"price\": 22.0, \"options\": {\"size\": \"750ml\", \"color\": \"silver\"}}], \"fulfillments\": [{\"tracking_id\": [\"1Z999AA10123456784\"], \"item_ids\": [\"3301457890\", \"7744021188\", \"5566123499\"]}], \"status\": \"return requested\", \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 147.49, \"payment_method_id\": \"credit_card_0234\"}], \"return_items\": [\"7744021188\", \"5566123499\"], \"return_payment_method_id\": \"credit_card_0234\", \"return_refund_amount\": 57.5}" }, { "from": "gpt", "value": "Your return request has been submitted successfully.\n- Order ID: #A9123409\n- Items: Yoga Mat (7744021188) and Stainless Steel Water Bottle (5566123499)\n- Refund: $57.50 to your original card (credit_card_0234)\n- Status: return requested\nYou’ll receive an email shortly with instructions on how and where to return the items. Please include all original packaging and accessories where applicable.\nIs there anything else I can help you with?" }, { "from": "human", "value": "Also, what’s the tracking number for that order?" }, { "from": "gpt", "value": "The tracking number for order #A9123409 is 1Z999AA10123456784.\nLet me know if you need any other information." } ]
# Retail agent policy As a retail agent, you can help users cancel or modify pending orders, return or exchange delivered orders, modify their default user address, or provide information about their own profile, orders, and related products. - At the beginning of the conversation, you have to authenticate the user identity by locating their user id via email, or via name + zip code. This has to be done even when the user already provides the user id. - Once the user has been authenticated, you can provide the user with information about order, product, profile information, e.g. help the user look up order id. - You can only help one user per conversation (but you can handle multiple requests from the same user), and must deny any requests for tasks related to any other user. - Before taking consequential actions that update the database (cancel, modify, return, exchange), you have to list the action detail and obtain explicit user confirmation (yes) to proceed. - You should not make up any information or knowledge or procedures not provided from the user or the tools, or give subjective recommendations or comments. - You should at most make one tool call at a time, and if you take a tool call, you should not respond to the user at the same time. If you respond to the user, you should not make a tool call. - 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 - All times in the database are EST and 24 hour based. For example "02:30:00" means 2:30 AM EST. - Each user has a profile of its email, default address, user id, and payment methods. Each payment method is either a gift card, a paypal account, or a credit card. - Our retail store has 50 types of products. For each type of product, there are variant items of different options. For example, for a 't shirt' product, there could be an item with option 'color blue size M', and another item with option 'color red size L'. - Each product has an unique product id, and each item has an unique item id. They have no relations and should not be confused. - Each order can be in status 'pending', 'processed', 'delivered', or 'cancelled'. Generally, you can only take action on pending or delivered orders. - Exchange or modify order tools can only be called once. Be sure that all items to be changed are collected into a list before making the tool call!!! ## Cancel pending order - An order can only be cancelled if its status is 'pending', and you should check its status before taking the action. - The user needs to confirm the order id and the reason (either 'no longer needed' or 'ordered by mistake') for cancellation. - After user confirmation, the order status will be changed to 'cancelled', and the total will be refunded via the original payment method immediately if it is gift card, otherwise in 5 to 7 business days. ## Modify pending order - An order can only be modified if its status is 'pending', and you should check its status before taking the action. - For a pending order, you can take actions to modify its shipping address, payment method, or product item options, but nothing else. ### Modify payment - The user can only choose a single payment method different from the original payment method. - If the user wants the modify the payment method to gift card, it must have enough balance to cover the total amount. - After user confirmation, the order status will be kept 'pending'. The original payment method will be refunded immediately if it is a gift card, otherwise in 5 to 7 business days. ### Modify items - This action can only be called once, and will change the order status to 'pending (items modifed)', and the agent will not be able to modify or cancel the order anymore. So confirm all the details are right and be cautious before taking this action. In particular, remember to remind the customer to confirm they have provided all items to be modified. - For a pending order, each item can be modified to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. ## Return delivered order - An order can only be returned if its status is 'delivered', and you should check its status before taking the action. - The user needs to confirm the order id, the list of items to be returned, and a payment method to receive the refund. - The refund must either go to the original payment method, or an existing gift card. - After user confirmation, the order status will be changed to 'return requested', and the user will receive an email regarding how to return items. ## Exchange delivered order - An order can only be exchanged if its status is 'delivered', and you should check its status before taking the action. In particular, remember to remind the customer to confirm they have provided all items to be exchanged. - For a delivered order, each item can be exchanged to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. - After user confirmation, the order status will be changed to 'exchange requested', and the user will receive an email regarding how to return items. There is no need to place a new order.
[{"name": "calculate", "description": "Calculate the result of a mathematical expression.", "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": "cancel_pending_order", "description": "Cancel a pending order. If the order is already processed or delivered, it cannot be cancelled. The agent needs to explain the cancellation detail and ask for explicit user confirmation (yes/no) to proceed. If the user confirms, the order status will be changed to 'cancelled' and the payment will be refunded. The refund will be added to the user's gift card balance immediately if the payment was made using a gift card, otherwise the refund would take 5-7 business days to process. The function returns the order details after the cancellation.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "reason": {"type": "string", "enum": ["no longer needed", "ordered by mistake"], "description": "The reason for cancellation, which should be either 'no longer needed' or 'ordered by mistake'."}}, "required": ["order_id", "reason"]}}, {"name": "exchange_delivered_order_items", "description": "Exchange items in a delivered order to new items of the same product type. For a delivered order, return or exchange can be only done once by the agent. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "find_user_id_by_email", "description": "Find user id by email. If the user is not found, the function will return an error message.", "parameters": {"type": "object", "properties": {"email": {"type": "string", "description": "The email of the user, such as '[email protected]'."}}, "required": ["email"]}}, {"name": "find_user_id_by_name_zip", "description": "Find user id by first name, last name, and zip code. If the user is not found, the function will return an error message. By default, find user id by email, and only call this function if the user is not found by email or cannot remember email.", "parameters": {"type": "object", "properties": {"first_name": {"type": "string", "description": "The first name of the customer, such as 'John'."}, "last_name": {"type": "string", "description": "The last name of the customer, such as 'Doe'."}, "zip": {"type": "string", "description": "The zip code of the customer, such as '12345'."}}, "required": ["first_name", "last_name", "zip"]}}, {"name": "get_order_details", "description": "Get the status and details of an order.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}}, "required": ["order_id"]}}, {"name": "get_product_details", "description": "Get the inventory details of a product.", "parameters": {"type": "object", "properties": {"product_id": {"type": "string", "description": "The product id, such as '6086499569'. Be careful the product id is different from the item id."}}, "required": ["product_id"]}}, {"name": "get_user_details", "description": "Get the details of an user.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}}, "required": ["user_id"]}}, {"name": "list_all_product_types", "description": "List the name and product id of all product types. Each product type has a variety of different items with unique item ids and options. There are only 50 product types in the store.", "parameters": {"type": "object", "properties": {}, "required": []}}, {"name": "modify_pending_order_address", "description": "Modify the shipping address of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["order_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "modify_pending_order_items", "description": "Modify items in a pending order to new items of the same product type. For a pending order, this function can only be called once. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "modify_pending_order_payment", "description": "Modify the payment method of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "payment_method_id"]}}, {"name": "modify_user_address", "description": "Modify the default address of an user. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["user_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "return_delivered_order_items", "description": "Return some items of a delivered order. The order status will be changed to 'return requested'. The agent needs to explain the return detail and ask for explicit user confirmation (yes/no) to proceed. The user will receive follow-up email for how and where to return the item.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be returned, each such as '1008292230'. There could be duplicate items in the list."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "payment_method_id"]}}, {"name": "think", "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.", "parameters": {"type": "object", "properties": {"thought": {"type": "string", "description": "The step by step thought process."}}, "required": ["thought"]}}, {"name": "transfer_to_human_agents", "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.", "parameters": {"type": "object", "properties": {"summary": {"type": "string", "description": "A summary of the user's issue."}}, "required": ["summary"]}}]
apigen_general_-9034245614323421389
20
18
general
Hi! I'd like to exchange a product from my recent delivery.
[ { "from": "human", "value": "Hi, I need to exchange a pair of running shoes I received for a different size and color." }, { "from": "gpt", "value": "I can help with that. To get started, please provide your email address so I can authenticate your identity and locate your user ID." }, { "from": "human", "value": "Sure, it's [email protected]." }, { "from": "function_call", "value": "{\"name\":\"find_user_id_by_email\",\"arguments\":{\"email\":\"[email protected]\"}}" }, { "from": "observation", "value": "maria_gomez_0842" }, { "from": "gpt", "value": "Thank you, Maria. I’ve located your account. Please share the order ID for the shoes you’d like to exchange." }, { "from": "human", "value": "The order ID is #A5573219." }, { "from": "function_call", "value": "{\"name\":\"get_order_details\",\"arguments\":{\"order_id\":\"#A5573219\"}}" }, { "from": "observation", "value": "{\"order_id\":\"#A5573219\",\"user_id\":\"maria_gomez_0842\",\"address\":{\"address1\":\"742 Pine Avenue\",\"address2\":\"Apt 3C\",\"city\":\"Boston\",\"country\":\"USA\",\"state\":\"MA\",\"zip\":\"02116\"},\"items\":[{\"name\":\"Running Shoes\",\"product_id\":\"PRD_SHOE_1201\",\"item_id\":\"ITM_SHOE_RED_8\",\"price\":129.99,\"options\":{\"color\":\"red\",\"size\":\"8\",\"width\":\"regular\"}},{\"name\":\"Wireless Earbuds\",\"product_id\":\"PRD_AUDIO_2205\",\"item_id\":\"ITM_EARBUDS_BK\",\"price\":89.5,\"options\":{\"color\":\"black\"}},{\"name\":\"Yoga Mat\",\"product_id\":\"PRD_FIT_3302\",\"item_id\":\"ITM_YOGAMAT_BLUE\",\"price\":34.0,\"options\":{\"color\":\"blue\",\"thickness\":\"6mm\"}}],\"fulfillments\":[{\"status\":\"delivered\",\"delivered_at\":\"2025-08-20 14:18:00\"}],\"status\":\"delivered\",\"payment_history\":[{\"transaction_type\":\"payment\",\"amount\":253.49,\"payment_method_id\":\"paypal_998877\"}]}" }, { "from": "gpt", "value": "I see order #A5573219 is delivered, so we can request an exchange. The items in the order are:\n- Running Shoes: red, size 8, width regular\n- Wireless Earbuds: black\n- Yoga Mat: blue, 6mm\nPlease confirm which item you want to exchange and the new option (same product type, different options such as size/color). Also, please provide the payment method to settle any price difference (charge or refund). If you plan to exchange more than one item, list all of them now because exchange can only be requested once per delivered order." }, { "from": "human", "value": "I want to exchange the Running Shoes from red size 8 to blue size 9. I saw the blue size 9 for $119.99. Use my PayPal for any refund." }, { "from": "function_call", "value": "{\"name\":\"get_product_details\",\"arguments\":{\"product_id\":\"PRD_SHOE_1201\"}}" }, { "from": "observation", "value": "{\"name\":\"Running Shoes\",\"product_id\":\"PRD_SHOE_1201\",\"variants\":{\"ITM_SHOE_RED_8\":{\"item_id\":\"ITM_SHOE_RED_8\",\"options\":{\"color\":\"red\",\"size\":\"8\",\"width\":\"regular\"},\"available\":true,\"price\":129.99},\"ITM_SHOE_BLUE_9\":{\"item_id\":\"ITM_SHOE_BLUE_9\",\"options\":{\"color\":\"blue\",\"size\":\"9\",\"width\":\"regular\"},\"available\":true,\"price\":119.99},\"ITM_SHOE_BLUE_8\":{\"item_id\":\"ITM_SHOE_BLUE_8\",\"options\":{\"color\":\"blue\",\"size\":\"8\",\"width\":\"regular\"},\"available\":true,\"price\":124.99},\"ITM_SHOE_BLACK_9\":{\"item_id\":\"ITM_SHOE_BLACK_9\",\"options\":{\"color\":\"black\",\"size\":\"9\",\"width\":\"regular\"},\"available\":false,\"price\":129.99},\"ITM_SHOE_RED_9\":{\"item_id\":\"ITM_SHOE_RED_9\",\"options\":{\"color\":\"red\",\"size\":\"9\",\"width\":\"regular\"},\"available\":true,\"price\":129.99},\"ITM_SHOE_BLUE_9_WIDE\":{\"item_id\":\"ITM_SHOE_BLUE_9_WIDE\",\"options\":{\"color\":\"blue\",\"size\":\"9\",\"width\":\"wide\"},\"available\":true,\"price\":119.99}}}" }, { "from": "function_call", "value": "{\"name\":\"calculate\",\"arguments\":{\"expression\":\"129.99 - 119.99\"}}" }, { "from": "observation", "value": "10" }, { "from": "gpt", "value": "Here is the exchange plan:\n- Item to exchange: Running Shoes (current item_id: ITM_SHOE_RED_8, red, size 8) at $129.99\n- New item: Running Shoes (new item_id: ITM_SHOE_BLUE_9, blue, size 9) at $119.99, availability: in stock\n- Price difference: $10.00 refund to your PayPal (paypal_998877)\nPlease confirm:\n- You want to exchange exactly this one item (and no other items) in order #A5573219\n- You approve refunding $10.00 to your PayPal account\nReply yes to proceed or no to cancel." }, { "from": "human", "value": "Yes, proceed." }, { "from": "function_call", "value": "{\"name\":\"exchange_delivered_order_items\",\"arguments\":{\"order_id\":\"#A5573219\",\"item_ids\":[\"ITM_SHOE_RED_8\"],\"new_item_ids\":[\"ITM_SHOE_BLUE_9\"],\"payment_method_id\":\"paypal_998877\"}}" }, { "from": "observation", "value": "{\"order_id\":\"#A5573219\",\"user_id\":\"maria_gomez_0842\",\"address\":{\"address1\":\"742 Pine Avenue\",\"address2\":\"Apt 3C\",\"city\":\"Boston\",\"country\":\"USA\",\"state\":\"MA\",\"zip\":\"02116\"},\"items\":[{\"name\":\"Running Shoes\",\"product_id\":\"PRD_SHOE_1201\",\"item_id\":\"ITM_SHOE_BLUE_9\",\"price\":119.99,\"options\":{\"color\":\"blue\",\"size\":\"9\",\"width\":\"regular\"}},{\"name\":\"Wireless Earbuds\",\"product_id\":\"PRD_AUDIO_2205\",\"item_id\":\"ITM_EARBUDS_BK\",\"price\":89.5,\"options\":{\"color\":\"black\"}},{\"name\":\"Yoga Mat\",\"product_id\":\"PRD_FIT_3302\",\"item_id\":\"ITM_YOGAMAT_BLUE\",\"price\":34.0,\"options\":{\"color\":\"blue\",\"thickness\":\"6mm\"}}],\"fulfillments\":[{\"status\":\"delivered\",\"delivered_at\":\"2025-08-20 14:18:00\"}],\"status\":\"exchange requested\",\"payment_history\":[{\"transaction_type\":\"payment\",\"amount\":253.49,\"payment_method_id\":\"paypal_998877\"},{\"transaction_type\":\"refund\",\"amount\":10.0,\"payment_method_id\":\"paypal_998877\"}]}" }, { "from": "gpt", "value": "Your exchange request for the Running Shoes has been placed successfully for order #A5573219. The new item is blue, size 9, and a $10.00 refund has been issued to your PayPal account. You will receive an email shortly with instructions on how to return the original pair. There is no need to place a new order.\nIs there anything else I can help you with today?" }, { "from": "human", "value": "Yes, my default shipping address is outdated. Please update it to 980 Maple Drive, Unit 12B, Cambridge, MA 02139, USA." }, { "from": "function_call", "value": "{\"name\":\"get_user_details\",\"arguments\":{\"user_id\":\"maria_gomez_0842\"}}" }, { "from": "observation", "value": "{\"name\":{\"first_name\":\"Maria\",\"last_name\":\"Gomez\"},\"address\":{\"address1\":\"742 Pine Avenue\",\"address2\":\"Apt 3C\",\"city\":\"Boston\",\"country\":\"USA\",\"province\":\"MA\",\"zip\":\"02116\"},\"email\":\"[email protected]\",\"payment_methods\":{\"paypal_998877\":{\"source\":\"paypal\",\"email\":\"[email protected]\",\"id\":\"paypal_998877\"},\"gift_card_441122\":{\"source\":\"gift_card\",\"balance\":25.0,\"id\":\"gift_card_441122\"}},\"orders\":[\"#A5573219\",\"#A5590042\",\"#A5401177\"]}" }, { "from": "gpt", "value": "I can update your default shipping address. Here are the details:\n- Current address: 742 Pine Avenue, Apt 3C, Boston, MA 02116, USA\n- New address: 980 Maple Drive, Unit 12B, Cambridge, MA 02139, USA\nPlease confirm that you want me to update your default address to the new address above. Reply yes to proceed or no to cancel." }, { "from": "human", "value": "Yes, update it." }, { "from": "function_call", "value": "{\"name\":\"modify_user_address\",\"arguments\":{\"user_id\":\"maria_gomez_0842\",\"address\":{\"address1\":\"980 Maple Drive\",\"address2\":\"Unit 12B\",\"city\":\"Cambridge\",\"country\":\"USA\",\"province\":\"MA\",\"zip\":\"02139\"}}}" }, { "from": "observation", "value": "{\"name\":{\"first_name\":\"Maria\",\"last_name\":\"Gomez\"},\"address\":{\"address1\":\"980 Maple Drive\",\"address2\":\"Unit 12B\",\"city\":\"Cambridge\",\"country\":\"USA\",\"province\":\"MA\",\"zip\":\"02139\"},\"email\":\"[email protected]\",\"payment_methods\":{\"paypal_998877\":{\"source\":\"paypal\",\"email\":\"[email protected]\",\"id\":\"paypal_998877\"},\"gift_card_441122\":{\"source\":\"gift_card\",\"balance\":25.0,\"id\":\"gift_card_441122\"}},\"orders\":[\"#A5573219\",\"#A5590042\",\"#A5401177\"]}" }, { "from": "gpt", "value": "Your default shipping address has been updated to:\n980 Maple Drive, Unit 12B, Cambridge, MA 02139, USA.\nIf there’s anything else you need, let me know." }, { "from": "human", "value": "That’s perfect, thanks!" }, { "from": "gpt", "value": "You’re welcome! If you need help with anything else, feel free to reach out. Have a great day!" } ]
# Retail agent policy As a retail agent, you can help users cancel or modify pending orders, return or exchange delivered orders, modify their default user address, or provide information about their own profile, orders, and related products. - At the beginning of the conversation, you have to authenticate the user identity by locating their user id via email, or via name + zip code. This has to be done even when the user already provides the user id. - Once the user has been authenticated, you can provide the user with information about order, product, profile information, e.g. help the user look up order id. - You can only help one user per conversation (but you can handle multiple requests from the same user), and must deny any requests for tasks related to any other user. - Before taking consequential actions that update the database (cancel, modify, return, exchange), you have to list the action detail and obtain explicit user confirmation (yes) to proceed. - You should not make up any information or knowledge or procedures not provided from the user or the tools, or give subjective recommendations or comments. - You should at most make one tool call at a time, and if you take a tool call, you should not respond to the user at the same time. If you respond to the user, you should not make a tool call. - 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 - All times in the database are EST and 24 hour based. For example "02:30:00" means 2:30 AM EST. - Each user has a profile of its email, default address, user id, and payment methods. Each payment method is either a gift card, a paypal account, or a credit card. - Our retail store has 50 types of products. For each type of product, there are variant items of different options. For example, for a 't shirt' product, there could be an item with option 'color blue size M', and another item with option 'color red size L'. - Each product has an unique product id, and each item has an unique item id. They have no relations and should not be confused. - Each order can be in status 'pending', 'processed', 'delivered', or 'cancelled'. Generally, you can only take action on pending or delivered orders. - Exchange or modify order tools can only be called once. Be sure that all items to be changed are collected into a list before making the tool call!!! ## Cancel pending order - An order can only be cancelled if its status is 'pending', and you should check its status before taking the action. - The user needs to confirm the order id and the reason (either 'no longer needed' or 'ordered by mistake') for cancellation. - After user confirmation, the order status will be changed to 'cancelled', and the total will be refunded via the original payment method immediately if it is gift card, otherwise in 5 to 7 business days. ## Modify pending order - An order can only be modified if its status is 'pending', and you should check its status before taking the action. - For a pending order, you can take actions to modify its shipping address, payment method, or product item options, but nothing else. ### Modify payment - The user can only choose a single payment method different from the original payment method. - If the user wants the modify the payment method to gift card, it must have enough balance to cover the total amount. - After user confirmation, the order status will be kept 'pending'. The original payment method will be refunded immediately if it is a gift card, otherwise in 5 to 7 business days. ### Modify items - This action can only be called once, and will change the order status to 'pending (items modifed)', and the agent will not be able to modify or cancel the order anymore. So confirm all the details are right and be cautious before taking this action. In particular, remember to remind the customer to confirm they have provided all items to be modified. - For a pending order, each item can be modified to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. ## Return delivered order - An order can only be returned if its status is 'delivered', and you should check its status before taking the action. - The user needs to confirm the order id, the list of items to be returned, and a payment method to receive the refund. - The refund must either go to the original payment method, or an existing gift card. - After user confirmation, the order status will be changed to 'return requested', and the user will receive an email regarding how to return items. ## Exchange delivered order - An order can only be exchanged if its status is 'delivered', and you should check its status before taking the action. In particular, remember to remind the customer to confirm they have provided all items to be exchanged. - For a delivered order, each item can be exchanged to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. - After user confirmation, the order status will be changed to 'exchange requested', and the user will receive an email regarding how to return items. There is no need to place a new order.
[{"name": "calculate", "description": "Calculate the result of a mathematical expression.", "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": "cancel_pending_order", "description": "Cancel a pending order. If the order is already processed or delivered, it cannot be cancelled. The agent needs to explain the cancellation detail and ask for explicit user confirmation (yes/no) to proceed. If the user confirms, the order status will be changed to 'cancelled' and the payment will be refunded. The refund will be added to the user's gift card balance immediately if the payment was made using a gift card, otherwise the refund would take 5-7 business days to process. The function returns the order details after the cancellation.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "reason": {"type": "string", "enum": ["no longer needed", "ordered by mistake"], "description": "The reason for cancellation, which should be either 'no longer needed' or 'ordered by mistake'."}}, "required": ["order_id", "reason"]}}, {"name": "exchange_delivered_order_items", "description": "Exchange items in a delivered order to new items of the same product type. For a delivered order, return or exchange can be only done once by the agent. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "find_user_id_by_email", "description": "Find user id by email. If the user is not found, the function will return an error message.", "parameters": {"type": "object", "properties": {"email": {"type": "string", "description": "The email of the user, such as '[email protected]'."}}, "required": ["email"]}}, {"name": "find_user_id_by_name_zip", "description": "Find user id by first name, last name, and zip code. If the user is not found, the function will return an error message. By default, find user id by email, and only call this function if the user is not found by email or cannot remember email.", "parameters": {"type": "object", "properties": {"first_name": {"type": "string", "description": "The first name of the customer, such as 'John'."}, "last_name": {"type": "string", "description": "The last name of the customer, such as 'Doe'."}, "zip": {"type": "string", "description": "The zip code of the customer, such as '12345'."}}, "required": ["first_name", "last_name", "zip"]}}, {"name": "get_order_details", "description": "Get the status and details of an order.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}}, "required": ["order_id"]}}, {"name": "get_product_details", "description": "Get the inventory details of a product.", "parameters": {"type": "object", "properties": {"product_id": {"type": "string", "description": "The product id, such as '6086499569'. Be careful the product id is different from the item id."}}, "required": ["product_id"]}}, {"name": "get_user_details", "description": "Get the details of an user.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}}, "required": ["user_id"]}}, {"name": "list_all_product_types", "description": "List the name and product id of all product types. Each product type has a variety of different items with unique item ids and options. There are only 50 product types in the store.", "parameters": {"type": "object", "properties": {}, "required": []}}, {"name": "modify_pending_order_address", "description": "Modify the shipping address of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["order_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "modify_pending_order_items", "description": "Modify items in a pending order to new items of the same product type. For a pending order, this function can only be called once. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "modify_pending_order_payment", "description": "Modify the payment method of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "payment_method_id"]}}, {"name": "modify_user_address", "description": "Modify the default address of an user. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["user_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "return_delivered_order_items", "description": "Return some items of a delivered order. The order status will be changed to 'return requested'. The agent needs to explain the return detail and ask for explicit user confirmation (yes/no) to proceed. The user will receive follow-up email for how and where to return the item.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be returned, each such as '1008292230'. There could be duplicate items in the list."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "payment_method_id"]}}, {"name": "transfer_to_human_agents", "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.", "parameters": {"type": "object", "properties": {"summary": {"type": "string", "description": "A summary of the user's issue."}}, "required": ["summary"]}}]
apigen_general_-2302245106898049010
22
30
general
Hello there, I'd like to make some changes to an order I recently placed.
[ { "from": "human", "value": "Hi, I’d like to add more checked baggage to my upcoming trip." }, { "from": "gpt", "value": "I can help with that. Please provide your user ID and the reservation ID so I can locate your booking." }, { "from": "human", "value": "My user ID is luis_silver_883 and the reservation ID is AB12CD." }, { "from": "function_call", "value": "{\"name\":\"get_reservation_details\",\"arguments\":{\"reservation_id\":\"AB12CD\"}}" }, { "from": "observation", "value": "{\"reservation_id\":\"AB12CD\",\"user_id\":\"luis_silver_883\",\"origin\":\"JFK\",\"destination\":\"SFO\",\"flight_type\":\"round_trip\",\"cabin\":\"economy\",\"flights\":[{\"origin\":\"JFK\",\"destination\":\"SFO\",\"flight_number\":\"HAT210\",\"date\":\"2024-06-02\",\"price\":320},{\"origin\":\"SFO\",\"destination\":\"JFK\",\"flight_number\":\"HAT211\",\"date\":\"2024-06-10\",\"price\":350}],\"passengers\":[{\"first_name\":\"Luis\",\"last_name\":\"Ramirez\",\"dob\":\"1985-09-12\"},{\"first_name\":\"Sofia\",\"last_name\":\"Ramirez\",\"dob\":\"2014-03-05\"}],\"payment_history\":[{\"payment_id\":\"credit_card_4555\",\"amount\":670}],\"created_at\":\"2024-05-10T09:32:00\",\"total_baggages\":3,\"nonfree_baggages\":0,\"insurance\":\"no\"}" }, { "from": "gpt", "value": "I’ve found your reservation. You currently have 3 total checked bags for 2 passengers in economy.\nHow many additional checked bags would you like to add?" }, { "from": "human", "value": "I want to add 2 more bags. How much will that cost?" }, { "from": "function_call", "value": "{\"name\":\"get_user_details\",\"arguments\":{\"user_id\":\"luis_silver_883\"}}" }, { "from": "observation", "value": "{\"user_id\":\"luis_silver_883\",\"email\":\"[email protected]\",\"date_of_birth\":\"1985-09-12\",\"membership_tier\":\"silver\",\"payment_methods\":[{\"payment_id\":\"credit_card_4555\",\"type\":\"credit_card\",\"last4\":\"4555\"},{\"payment_id\":\"gift_card_824173\",\"type\":\"gift_card\",\"balance\":120}],\"addresses\":[{\"type\":\"home\",\"city\":\"New York\"}],\"reservation_numbers\":[\"AB12CD\",\"XY98ZW\"]}" }, { "from": "gpt", "value": "Thanks. Based on your silver membership and economy cabin:\n- Free checked bag allowance: 2 per passenger\n- Passengers: 2\n- Total free allowance: 4 bags\nIf we add 2 bags, your total would be 5. That’s 1 bag over the free allowance, so the additional cost will be $50.\nAction details to proceed:\n- Update total checked bags from 3 to 5 on reservation AB12CD\n- Additional non-free bags: 1\n- Additional cost: $50\nPlease confirm with “yes” if you’d like me to proceed." }, { "from": "human", "value": "Yes, please go ahead." }, { "from": "function_call", "value": "{\"name\":\"update_reservation_baggages\",\"arguments\":{\"reservation_id\":\"AB12CD\",\"total_baggages\":5}}" }, { "from": "observation", "value": "{\"reservation_id\":\"AB12CD\",\"user_id\":\"luis_silver_883\",\"origin\":\"JFK\",\"destination\":\"SFO\",\"flight_type\":\"round_trip\",\"cabin\":\"economy\",\"flights\":[{\"origin\":\"JFK\",\"destination\":\"SFO\",\"flight_number\":\"HAT210\",\"date\":\"2024-06-02\",\"price\":320},{\"origin\":\"SFO\",\"destination\":\"JFK\",\"flight_number\":\"HAT211\",\"date\":\"2024-06-10\",\"price\":350}],\"passengers\":[{\"first_name\":\"Luis\",\"last_name\":\"Ramirez\",\"dob\":\"1985-09-12\"},{\"first_name\":\"Sofia\",\"last_name\":\"Ramirez\",\"dob\":\"2014-03-05\"}],\"payment_history\":[{\"payment_id\":\"credit_card_4555\",\"amount\":670}],\"created_at\":\"2024-05-10T09:32:00\",\"total_baggages\":5,\"nonfree_baggages\":1,\"insurance\":\"no\"}" }, { "from": "gpt", "value": "Your baggage has been updated successfully.\n- Total checked bags: 5\n- Non-free bags: 1\n- Additional cost: $50\nIs there anything else I can help you with today?" }, { "from": "human", "value": "That’s perfect, thanks!" }, { "from": "gpt", "value": "You’re welcome! If you need anything else, feel free to reach out. Have a great trip!" } ]
# 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.
[{"name": "book_reservation", "description": "Book a 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": "calculate", "description": "Calculate the result of a mathematical expression.", "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": "cancel_reservation", "description": "Cancel the whole reservation.", "parameters": {"type": "object", "properties": {"reservation_id": {"type": "string", "description": "The reservation ID, such as 'ZFA04Y'."}}, "required": ["reservation_id"]}}, {"name": "get_reservation_details", "description": "Get the details of a reservation.", "parameters": {"type": "object", "properties": {"reservation_id": {"type": "string", "description": "The reservation id, such as '8JX2WO'."}}, "required": ["reservation_id"]}}, {"name": "get_user_details", "description": "Get the details of an user.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}}, "required": ["user_id"]}}, {"name": "list_all_airports", "description": "List all airports and their cities.", "parameters": {"type": "object", "properties": {}, "required": []}}, {"name": "search_direct_flight", "description": "Search direct flights between two cities on a specific date.", "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": "search_onestop_flight", "description": "Search direct flights between two cities on a specific date.", "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": "send_certificate", "description": "Send a certificate to a user. Be careful!", "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": "think", "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.", "parameters": {"type": "object", "properties": {"thought": {"type": "string", "description": "The step by step thought process."}}, "required": ["thought"]}}, {"name": "transfer_to_human_agents", "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.", "parameters": {"type": "object", "properties": {"summary": {"type": "string", "description": "A summary of the user's issue."}}, "required": ["summary"]}}, {"name": "update_reservation_baggages", "description": "Update the baggage information of a reservation.", "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": "update_reservation_flights", "description": "Update the flight information of a reservation.", "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": "update_reservation_passengers", "description": "Update the passenger information of a reservation.", "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"]}}]
apigen_general_-1235861870022137111
12
16
general
Hi there, I am reaching out to ensure that my husband's last name is updated on our upcoming flight. His name has recently changed to Khan.
[ { "from": "human", "value": "Hi, I need to return a couple of items from my recent order that was delivered. Can I do that here?" }, { "from": "gpt", "value": "Yes, you can request a return for items from a delivered order. I’ll first need to authenticate your identity. Please provide your email address." }, { "from": "human", "value": "Sure, it’s [email protected]." }, { "from": "function_call", "value": "{\"name\":\"find_user_id_by_email\",\"arguments\":{\"email\":\"[email protected]\"}}" }, { "from": "observation", "value": "john_doe_4421" }, { "from": "gpt", "value": "Thank you, John. Your identity has been authenticated. Please provide the order ID for the delivered order you’d like to return items from." }, { "from": "human", "value": "The order ID is #A1135792." }, { "from": "function_call", "value": "{\"name\":\"get_order_details\",\"arguments\":{\"order_id\":\"#A1135792\"}}" }, { "from": "observation", "value": "{\"order_id\":\"#A1135792\",\"user_id\":\"john_doe_4421\",\"address\":{\"address1\":\"18 Cedar Street\",\"address2\":\"\",\"city\":\"Boston\",\"country\":\"USA\",\"state\":\"MA\",\"zip\":\"02116\"},\"items\":[{\"name\":\"Noise-Cancelling Headphones\",\"product_id\":\"5522100011\",\"item_id\":\"8881110001\",\"price\":199.99,\"options\":{\"color\":\"black\"}},{\"name\":\"Wireless Mouse\",\"product_id\":\"6622300033\",\"item_id\":\"7772220002\",\"price\":49.5,\"options\":{\"color\":\"gray\"}},{\"name\":\"Laptop Sleeve\",\"product_id\":\"7722400055\",\"item_id\":\"3334440003\",\"price\":25.0,\"options\":{\"size\":\"13-inch\",\"material\":\"neoprene\"}}],\"fulfillments\":[{\"status\":\"delivered\",\"delivered_at\":\"2025-08-29 14:05:00\"}],\"status\":\"delivered\",\"payment_history\":[{\"transaction_type\":\"payment\",\"amount\":274.49,\"payment_method_id\":\"credit_card_abc123\"}]}" }, { "from": "gpt", "value": "I see order #A1135792 is delivered, so a return can be requested.\nPlease confirm:\n- Which items you want to return (you can reference by name or item ID)\n- The payment method to receive your refund (either the original payment method or an existing gift card on your account)\nOnce I have these, I’ll summarize the details and ask for your confirmation to proceed." }, { "from": "human", "value": "I want to return the Noise-Cancelling Headphones and the Wireless Mouse. Please refund to my gift card on file." }, { "from": "function_call", "value": "{\"name\":\"get_user_details\",\"arguments\":{\"user_id\":\"john_doe_4421\"}}" }, { "from": "observation", "value": "{\"user_id\":\"john_doe_4421\",\"email\":\"[email protected]\",\"default_address\":{\"address1\":\"18 Cedar Street\",\"address2\":\"\",\"city\":\"Boston\",\"country\":\"USA\",\"state\":\"MA\",\"zip\":\"02116\"},\"payment_methods\":[{\"payment_method_id\":\"credit_card_abc123\",\"type\":\"credit_card\",\"last4\":\"4242\"},{\"payment_method_id\":\"paypal_99887766\",\"type\":\"paypal\",\"email\":\"[email protected]\"},{\"payment_method_id\":\"gift_card_789654123\",\"type\":\"gift_card\",\"balance\":32.75}]}" }, { "from": "function_call", "value": "{\"name\":\"calculate\",\"arguments\":{\"expression\":\"199.99 + 49.50\"}}" }, { "from": "observation", "value": "249.49" }, { "from": "gpt", "value": "Here are the return details I have prepared. Please review and confirm if everything is correct:\n- Order ID: #A1135792\n- Items to return:\n- Noise-Cancelling Headphones (item_id: 8881110001) — $199.99\n- Wireless Mouse (item_id: 7772220002) — $49.50\n- Refund amount: $249.49\n- Refund method: Existing gift card (gift_card_789654123)\n- What happens next: After submitting the request, the order status will change to “return requested,” and you’ll receive an email with instructions on how to return the items.\nPlease reply “yes” to proceed with submitting this return request, or let me know if you need any changes." }, { "from": "human", "value": "Yes, please proceed." }, { "from": "function_call", "value": "{\"name\":\"return_delivered_order_items\",\"arguments\":{\"order_id\":\"#A1135792\",\"item_ids\":[\"8881110001\",\"7772220002\"],\"payment_method_id\":\"gift_card_789654123\"}}" }, { "from": "observation", "value": "{\"order_id\":\"#A1135792\",\"user_id\":\"john_doe_4421\",\"address\":{\"address1\":\"18 Cedar Street\",\"address2\":\"\",\"city\":\"Boston\",\"country\":\"USA\",\"state\":\"MA\",\"zip\":\"02116\"},\"items\":[{\"name\":\"Noise-Cancelling Headphones\",\"product_id\":\"5522100011\",\"item_id\":\"8881110001\",\"price\":199.99,\"options\":{\"color\":\"black\"}},{\"name\":\"Wireless Mouse\",\"product_id\":\"6622300033\",\"item_id\":\"7772220002\",\"price\":49.5,\"options\":{\"color\":\"gray\"}},{\"name\":\"Laptop Sleeve\",\"product_id\":\"7722400055\",\"item_id\":\"3334440003\",\"price\":25.0,\"options\":{\"size\":\"13-inch\",\"material\":\"neoprene\"}}],\"fulfillments\":[{\"status\":\"delivered\",\"delivered_at\":\"2025-08-29 14:05:00\"}],\"status\":\"return requested\",\"payment_history\":[{\"transaction_type\":\"payment\",\"amount\":274.49,\"payment_method_id\":\"credit_card_abc123\"}]}" }, { "from": "gpt", "value": "Your return request for order #A1135792 has been submitted successfully.\n- Items: Noise-Cancelling Headphones and Wireless Mouse\n- Refund amount: $249.49\n- Refund method: Existing gift card (gift_card_789654123)\n- Status: The order is now marked as “return requested”\nYou’ll receive an email shortly with instructions on how to return the items. If there’s anything else I can help you with, let me know." } ]
# Retail agent policy As a retail agent, you can help users cancel or modify pending orders, return or exchange delivered orders, modify their default user address, or provide information about their own profile, orders, and related products. - At the beginning of the conversation, you have to authenticate the user identity by locating their user id via email, or via name + zip code. This has to be done even when the user already provides the user id. - Once the user has been authenticated, you can provide the user with information about order, product, profile information, e.g. help the user look up order id. - You can only help one user per conversation (but you can handle multiple requests from the same user), and must deny any requests for tasks related to any other user. - Before taking consequential actions that update the database (cancel, modify, return, exchange), you have to list the action detail and obtain explicit user confirmation (yes) to proceed. - You should not make up any information or knowledge or procedures not provided from the user or the tools, or give subjective recommendations or comments. - You should at most make one tool call at a time, and if you take a tool call, you should not respond to the user at the same time. If you respond to the user, you should not make a tool call. - 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 - All times in the database are EST and 24 hour based. For example "02:30:00" means 2:30 AM EST. - Each user has a profile of its email, default address, user id, and payment methods. Each payment method is either a gift card, a paypal account, or a credit card. - Our retail store has 50 types of products. For each type of product, there are variant items of different options. For example, for a 't shirt' product, there could be an item with option 'color blue size M', and another item with option 'color red size L'. - Each product has an unique product id, and each item has an unique item id. They have no relations and should not be confused. - Each order can be in status 'pending', 'processed', 'delivered', or 'cancelled'. Generally, you can only take action on pending or delivered orders. - Exchange or modify order tools can only be called once. Be sure that all items to be changed are collected into a list before making the tool call!!! ## Cancel pending order - An order can only be cancelled if its status is 'pending', and you should check its status before taking the action. - The user needs to confirm the order id and the reason (either 'no longer needed' or 'ordered by mistake') for cancellation. - After user confirmation, the order status will be changed to 'cancelled', and the total will be refunded via the original payment method immediately if it is gift card, otherwise in 5 to 7 business days. ## Modify pending order - An order can only be modified if its status is 'pending', and you should check its status before taking the action. - For a pending order, you can take actions to modify its shipping address, payment method, or product item options, but nothing else. ### Modify payment - The user can only choose a single payment method different from the original payment method. - If the user wants the modify the payment method to gift card, it must have enough balance to cover the total amount. - After user confirmation, the order status will be kept 'pending'. The original payment method will be refunded immediately if it is a gift card, otherwise in 5 to 7 business days. ### Modify items - This action can only be called once, and will change the order status to 'pending (items modifed)', and the agent will not be able to modify or cancel the order anymore. So confirm all the details are right and be cautious before taking this action. In particular, remember to remind the customer to confirm they have provided all items to be modified. - For a pending order, each item can be modified to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. ## Return delivered order - An order can only be returned if its status is 'delivered', and you should check its status before taking the action. - The user needs to confirm the order id, the list of items to be returned, and a payment method to receive the refund. - The refund must either go to the original payment method, or an existing gift card. - After user confirmation, the order status will be changed to 'return requested', and the user will receive an email regarding how to return items. ## Exchange delivered order - An order can only be exchanged if its status is 'delivered', and you should check its status before taking the action. In particular, remember to remind the customer to confirm they have provided all items to be exchanged. - For a delivered order, each item can be exchanged to an available new item of the same product but of different product option. There cannot be any change of product types, e.g. modify shirt to shoe. - The user must provide a payment method to pay or receive refund of the price difference. If the user provides a gift card, it must have enough balance to cover the price difference. - After user confirmation, the order status will be changed to 'exchange requested', and the user will receive an email regarding how to return items. There is no need to place a new order.
[{"name": "calculate", "description": "Calculate the result of a mathematical expression.", "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": "cancel_pending_order", "description": "Cancel a pending order. If the order is already processed or delivered, it cannot be cancelled. The agent needs to explain the cancellation detail and ask for explicit user confirmation (yes/no) to proceed. If the user confirms, the order status will be changed to 'cancelled' and the payment will be refunded. The refund will be added to the user's gift card balance immediately if the payment was made using a gift card, otherwise the refund would take 5-7 business days to process. The function returns the order details after the cancellation.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "reason": {"type": "string", "enum": ["no longer needed", "ordered by mistake"], "description": "The reason for cancellation, which should be either 'no longer needed' or 'ordered by mistake'."}}, "required": ["order_id", "reason"]}}, {"name": "exchange_delivered_order_items", "description": "Exchange items in a delivered order to new items of the same product type. For a delivered order, return or exchange can be only done once by the agent. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be exchanged for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "find_user_id_by_email", "description": "Find user id by email. If the user is not found, the function will return an error message.", "parameters": {"type": "object", "properties": {"email": {"type": "string", "description": "The email of the user, such as '[email protected]'."}}, "required": ["email"]}}, {"name": "find_user_id_by_name_zip", "description": "Find user id by first name, last name, and zip code. If the user is not found, the function will return an error message. By default, find user id by email, and only call this function if the user is not found by email or cannot remember email.", "parameters": {"type": "object", "properties": {"first_name": {"type": "string", "description": "The first name of the customer, such as 'John'."}, "last_name": {"type": "string", "description": "The last name of the customer, such as 'Doe'."}, "zip": {"type": "string", "description": "The zip code of the customer, such as '12345'."}}, "required": ["first_name", "last_name", "zip"]}}, {"name": "get_order_details", "description": "Get the status and details of an order.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}}, "required": ["order_id"]}}, {"name": "get_product_details", "description": "Get the inventory details of a product.", "parameters": {"type": "object", "properties": {"product_id": {"type": "string", "description": "The product id, such as '6086499569'. Be careful the product id is different from the item id."}}, "required": ["product_id"]}}, {"name": "get_user_details", "description": "Get the details of an user.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}}, "required": ["user_id"]}}, {"name": "list_all_product_types", "description": "List the name and product id of all product types. Each product type has a variety of different items with unique item ids and options. There are only 50 product types in the store.", "parameters": {"type": "object", "properties": {}, "required": []}}, {"name": "modify_pending_order_address", "description": "Modify the shipping address of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["order_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "modify_pending_order_items", "description": "Modify items in a pending order to new items of the same product type. For a pending order, this function can only be called once. The agent needs to explain the exchange detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified, each such as '1008292230'. There could be duplicate items in the list."}, "new_item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be modified for, each such as '1008292230'. There could be duplicate items in the list. Each new item id should match the item id in the same position and be of the same product."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "new_item_ids", "payment_method_id"]}}, {"name": "modify_pending_order_payment", "description": "Modify the payment method of a pending order. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "payment_method_id"]}}, {"name": "modify_user_address", "description": "Modify the default address of an user. The agent needs to explain the modification detail and ask for explicit user confirmation (yes/no) to proceed.", "parameters": {"type": "object", "properties": {"user_id": {"type": "string", "description": "The user id, such as 'sara_doe_496'."}, "address1": {"type": "string", "description": "The first line of the address, such as '123 Main St'."}, "address2": {"type": "string", "description": "The second line of the address, such as 'Apt 1' or ''."}, "city": {"type": "string", "description": "The city, such as 'San Francisco'."}, "state": {"type": "string", "description": "The province, such as 'CA'."}, "country": {"type": "string", "description": "The country, such as 'USA'."}, "zip": {"type": "string", "description": "The zip code, such as '12345'."}}, "required": ["user_id", "address1", "address2", "city", "state", "country", "zip"]}}, {"name": "return_delivered_order_items", "description": "Return some items of a delivered order. The order status will be changed to 'return requested'. The agent needs to explain the return detail and ask for explicit user confirmation (yes/no) to proceed. The user will receive follow-up email for how and where to return the item.", "parameters": {"type": "object", "properties": {"order_id": {"type": "string", "description": "The order id, such as '#W0000000'. Be careful there is a '#' symbol at the beginning of the order id."}, "item_ids": {"type": "array", "items": {"type": "string"}, "description": "The item ids to be returned, each such as '1008292230'. There could be duplicate items in the list."}, "payment_method_id": {"type": "string", "description": "The payment method id to pay or receive refund for the item price difference, such as 'gift_card_0000000' or 'credit_card_0000000'. These can be looked up from the user or order details."}}, "required": ["order_id", "item_ids", "payment_method_id"]}}, {"name": "transfer_to_human_agents", "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.", "parameters": {"type": "object", "properties": {"summary": {"type": "string", "description": "A summary of the user's issue."}}, "required": ["summary"]}}]
apigen_general_-7450179833282648799
18
20
general
Hello, I've recently placed an order with you, but I realised I'd like to make a modification to it. Is it possible to do this with a pending order?
[{"from":"human","value":"Hi! I’d like to add a checked bag and also buy travel insurance for my B(...TRUNCATED)
"# Airline Agent Policy\nThe current time is 2024-05-15 15:00:00 EST.\n\nAs an airline agent, you ca(...TRUNCATED)
"[{\"name\": \"book_reservation\", \"description\": \"Book a reservation.\", \"parameters\": {\"type(...TRUNCATED)
apigen_general_-7200186489487294339
12
14
general
"Hello there! I need to modify my current reservation from Phoenix to Las Vegas and back to Phoenix.(...TRUNCATED)
[{"from":"human","value":"Hi, I’d like to return the wireless earbuds from my last order. They don(...TRUNCATED)
"# Retail agent policy\nAs a retail agent, you can help users cancel or modify pending orders, retur(...TRUNCATED)
"[{\"name\": \"calculate\", \"description\": \"Calculate the result of a mathematical expression.\",(...TRUNCATED)
apigen_general_-2808449009213027663
22
18
general
Hello, I need some assistance with modifying my pending order for a Mechanical Keyboard.
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
21