Dataset Viewer
conversations
listlengths 9
45
| system
stringclasses 2
values | tools
stringclasses 3
values | based_on_sample
stringlengths 30
35
| sample_turns
int64 3
56
| generated_turns
int64 9
45
| domain
stringclasses 1
value | sample_question
stringlengths 32
370
|
---|---|---|---|---|---|---|---|
[
{
"from": "human",
"value": "Hi there! I need to exchange one of the items in my delivered order #A7732041."
},
{
"from": "gpt",
"value": "I can help with that. First, I need to verify your identity. Please provide your email address, or your first name, last name, and zip code."
},
{
"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": "megan_choi_8842"
},
{
"from": "function_call",
"value": "{\"name\":\"get_order_details\",\"arguments\":{\"order_id\":\"#A7732041\"}}"
},
{
"from": "observation",
"value": "{\"order_id\":\"#A7732041\",\"user_id\":\"megan_choi_8842\",\"address\":{\"address1\":\"1432 Garden Lane\",\"address2\":\"\",\"city\":\"Seattle\",\"country\":\"USA\",\"state\":\"WA\",\"zip\":\"98109\"},\"items\":[{\"name\":\"Running Shoes\",\"product_id\":\"3726159042\",\"item_id\":\"1122334455\",\"price\":129.99,\"options\":{\"size\":\"8\",\"color\":\"blue\"}},{\"name\":\"Noise Cancelling Headphones\",\"product_id\":\"7401592631\",\"item_id\":\"9988776655\",\"price\":249.0,\"options\":{\"color\":\"black\",\"wireless\":\"yes\"}},{\"name\":\"Yoga Mat\",\"product_id\":\"5102463897\",\"item_id\":\"4455667788\",\"price\":36.0,\"options\":{\"color\":\"green\",\"thickness\":\"6mm\"}}],\"fulfillments\":[{\"fulfillment_id\":\"FUL-10045\",\"status\":\"delivered\",\"delivered_at\":\"2025-08-20 15:22:00\"}],\"status\":\"delivered\",\"payment_history\":[{\"transaction_type\":\"payment\",\"amount\":414.99,\"payment_method_id\":\"cc_233344\"}]}"
},
{
"from": "gpt",
"value": "Thanks, Megan. I’ve located your order #A7732041 and confirmed it’s in delivered status. Here’s a quick summary:\n- Shipping address: 1432 Garden Lane, Seattle, WA 98109, USA\n- Items:\n1) Running Shoes — $129.99 (size 8, color blue)\n2) Noise Cancelling Headphones — $249.00 (black, wireless)\n3) Yoga Mat — $36.00 (green, 6mm)\n- Original payment method: cc_233344\nI can process an exchange for delivered orders for items to a different variant of the same product (e.g., different size or color). Which item would you like to exchange, and what are the desired options? Please also confirm that you’ve listed all items you want to exchange in this order (we can only process one exchange request per delivered order)."
},
{
"from": "human",
"value": "I want to exchange the Running Shoes from size 8 to size 9, same blue color. Is there any price difference? You can use the same card on file if needed."
},
{
"from": "function_call",
"value": "{\"name\":\"get_product_details\",\"arguments\":{\"product_id\":\"3726159042\"}}"
},
{
"from": "observation",
"value": "{\"name\":\"Running Shoes\",\"product_id\":\"3726159042\",\"variants\":{\"1122334455\":{\"item_id\":\"1122334455\",\"options\":{\"size\":\"8\",\"color\":\"blue\"},\"available\":true,\"price\":129.99},\"2233445566\":{\"item_id\":\"2233445566\",\"options\":{\"size\":\"9\",\"color\":\"blue\"},\"available\":true,\"price\":139.99},\"3344556677\":{\"item_id\":\"3344556677\",\"options\":{\"size\":\"8\",\"color\":\"black\"},\"available\":true,\"price\":129.99},\"4455667789\":{\"item_id\":\"4455667789\",\"options\":{\"size\":\"9\",\"color\":\"black\"},\"available\":true,\"price\":139.99},\"5566778890\":{\"item_id\":\"5566778890\",\"options\":{\"size\":\"8.5\",\"color\":\"blue\"},\"available\":true,\"price\":134.99}}}"
},
{
"from": "function_call",
"value": "{\"name\":\"calculate\",\"arguments\":{\"expression\":\"139.99 - 129.99\"}}"
},
{
"from": "observation",
"value": "10.0"
},
{
"from": "gpt",
"value": "I found the requested variant:\n- Current item in your order: Running Shoes (item_id 1122334455), size 8, color blue — $129.99\n- Desired variant: Running Shoes (item_id 2233445566), size 9, color blue — $139.99\nPrice difference calculation:\n- $139.99 - $129.99 = $10.00 additional\nWe’ll use your original payment method (cc_233344) for the additional $10.00. Please also confirm this is the only item you want to exchange from this order.\nLet me confirm the details:\n- Action: Exchange delivered order item\n- Order: #A7732041\n- Item: Running Shoes (item_id 1122334455, size 8, color blue) → Running Shoes (item_id 2233445566, size 9, color blue)\n- Payment method: cc_233344\n- Total impact: Charge $10.00 to the original payment method\nPlease confirm with 'yes' to proceed."
},
{
"from": "human",
"value": "Yes, please proceed."
},
{
"from": "function_call",
"value": "{\"name\":\"exchange_delivered_order_items\",\"arguments\":{\"order_id\":\"#A7732041\",\"item_ids\":[\"1122334455\"],\"new_item_ids\":[\"2233445566\"],\"payment_method_id\":\"cc_233344\"}}"
},
{
"from": "observation",
"value": "{\"order_id\":\"#A7732041\",\"user_id\":\"megan_choi_8842\",\"address\":{\"address1\":\"1432 Garden Lane\",\"address2\":\"\",\"city\":\"Seattle\",\"country\":\"USA\",\"state\":\"WA\",\"zip\":\"98109\"},\"items\":[{\"name\":\"Running Shoes\",\"product_id\":\"3726159042\",\"item_id\":\"2233445566\",\"price\":139.99,\"options\":{\"size\":\"9\",\"color\":\"blue\"}},{\"name\":\"Noise Cancelling Headphones\",\"product_id\":\"7401592631\",\"item_id\":\"9988776655\",\"price\":249.0,\"options\":{\"color\":\"black\",\"wireless\":\"yes\"}},{\"name\":\"Yoga Mat\",\"product_id\":\"5102463897\",\"item_id\":\"4455667788\",\"price\":36.0,\"options\":{\"color\":\"green\",\"thickness\":\"6mm\"}}],\"fulfillments\":[{\"fulfillment_id\":\"FUL-10045\",\"status\":\"delivered\",\"delivered_at\":\"2025-08-20 15:22:00\"}],\"status\":\"exchange requested\",\"payment_history\":[{\"transaction_type\":\"payment\",\"amount\":414.99,\"payment_method_id\":\"cc_233344\"},{\"transaction_type\":\"payment\",\"amount\":10.0,\"payment_method_id\":\"cc_233344\"}]}"
},
{
"from": "gpt",
"value": "Your exchange request has been submitted successfully for order #A7732041.\n- Exchanged item:\n- Running Shoes changed from size 8, blue (item_id 1122334455) to size 9, blue (item_id 2233445566)\n- Additional charge: $10.00 to cc_233344\n- Order status: exchange requested\nYou’ll receive an email shortly with instructions on how to return the original shoes so we can complete the exchange. If you need anything else with this order, 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": "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_-2375064588633937709
| 22 | 18 |
general
|
Hi! I have a pending order with you, #W3913498. I'm thinking of making a slight change. Could you assist me with that?
|
[
{
"from": "human",
"value": "Hi, I need to return the noise-cancelling headphones from my recent order."
},
{
"from": "gpt",
"value": "I can help with that. First, to locate your account, please provide either your email address or your first and last name along with your zip code."
},
{
"from": "human",
"value": "My email is [email protected]."
},
{
"from": "function_call",
"value": "{\"name\":\"find_user_id_by_email\",\"arguments\":{\"email\":\"[email protected]\"}}"
},
{
"from": "observation",
"value": "jamie_lee_2048"
},
{
"from": "gpt",
"value": "Thank you, Jamie. I’ve located your user ID: jamie_lee_2048. Could you share the order ID for the headphones? If you don’t have it handy, I can look it up for you."
},
{
"from": "human",
"value": "The order ID is #A8832045."
},
{
"from": "function_call",
"value": "{\"name\":\"get_order_details\",\"arguments\":{\"order_id\":\"#A8832045\"}}"
},
{
"from": "observation",
"value": "{\"order_id\":\"#A8832045\",\"user_id\":\"jamie_lee_2048\",\"address\":{\"address1\":\"742 Evergreen Terrace\",\"address2\":\"\",\"city\":\"Springfield\",\"country\":\"USA\",\"state\":\"IL\",\"zip\":\"62704\"},\"items\":[{\"name\":\"Noise-Cancelling Headphones\",\"product_id\":\"5023458901\",\"item_id\":\"7712345001\",\"price\":229.99,\"options\":{\"color\":\"black\"}},{\"name\":\"Laptop Sleeve\",\"product_id\":\"6023490021\",\"item_id\":\"7712345012\",\"price\":29.50,\"options\":{\"size\":\"13 inch\",\"color\":\"gray\"}}],\"fulfillments\":[{\"tracking_id\":[\"1Z999AA10123456784\"],\"item_ids\":[\"7712345001\",\"7712345012\"]}],\"status\":\"delivered\",\"payment_history\":[{\"transaction_type\":\"payment\",\"amount\":259.49,\"payment_method_id\":\"cc_3049002\"}]}"
},
{
"from": "gpt",
"value": "I found your order #A8832045, and it’s marked as delivered. To process a return, please confirm:\n- The item(s) you want to return (item ID(s))\n- The payment method for the refund (either your original payment method or an existing gift card on your account)\n- A brief reason for the return"
},
{
"from": "human",
"value": "I want to return the headphones, item ID 7712345001. Please refund to my original credit card. Reason: they’re too tight."
},
{
"from": "function_call",
"value": "{\"name\":\"calculate\",\"arguments\":{\"expression\":\"229.99\"}}"
},
{
"from": "observation",
"value": "229.99"
},
{
"from": "gpt",
"value": "Let me confirm the details:\n- Action: Return delivered item(s)\n- Order: #A8832045\n- Item: Noise-Cancelling Headphones (item ID: 7712345001)\n- Payment method for refund: Original payment method (payment_method_id: cc_3049002)\n- Reason: they’re too tight\n- Total impact: Refund amount $229.99 to your original payment method (refund typically processes in 5–7 business days)\nPlease confirm with 'yes' to proceed."
},
{
"from": "human",
"value": "yes"
},
{
"from": "function_call",
"value": "{\"name\":\"return_delivered_order_items\",\"arguments\":{\"order_id\":\"#A8832045\",\"item_ids\":[\"7712345001\"],\"payment_method_id\":\"cc_3049002\"}}"
},
{
"from": "observation",
"value": "{\"order_id\":\"#A8832045\",\"user_id\":\"jamie_lee_2048\",\"address\":{\"address1\":\"742 Evergreen Terrace\",\"address2\":\"\",\"city\":\"Springfield\",\"country\":\"USA\",\"state\":\"IL\",\"zip\":\"62704\"},\"items\":[{\"name\":\"Noise-Cancelling Headphones\",\"product_id\":\"5023458901\",\"item_id\":\"7712345001\",\"price\":229.99,\"options\":{\"color\":\"black\"}},{\"name\":\"Laptop Sleeve\",\"product_id\":\"6023490021\",\"item_id\":\"7712345012\",\"price\":29.50,\"options\":{\"size\":\"13 inch\",\"color\":\"gray\"}}],\"fulfillments\":[{\"tracking_id\":[\"1Z999AA10123456784\"],\"item_ids\":[\"7712345001\",\"7712345012\"]}],\"status\":\"return requested\",\"payment_history\":[{\"transaction_type\":\"payment\",\"amount\":259.49,\"payment_method_id\":\"cc_3049002\"}],\"return_items\":[\"7712345001\"],\"return_payment_method_id\":\"cc_3049002\",\"return_refund_amount\":229.99}"
},
{
"from": "gpt",
"value": "Your return request has been submitted successfully.\n- Order: #A8832045\n- Item: Noise-Cancelling Headphones (item ID: 7712345001)\n- Refund: $229.99 to your original payment method (cc_3049002). Refund typically completes in 5–7 business days.\n- Status: return requested\nYou’ll receive an email with instructions on how and where to return the item. Is there anything else I can help you with?"
},
{
"from": "human",
"value": "Can you remind me of the original tracking number from that shipment?"
},
{
"from": "gpt",
"value": "Certainly. The original tracking number for order #A8832045 is 1Z999AA10123456784. If you need anything else, just 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": "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_-8410194491855867461
| 16 | 20 |
general
|
Hello, I recently received an electric kettle that I purchased from you, but I would like to arrange for an exchange.
|
[
{
"from": "human",
"value": "Hi, I need to exchange a couple of items from my delivered order."
},
{
"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 your email, you can provide your first name, last name, and zip code instead."
},
{
"from": "human",
"value": "My email is [email protected]."
},
{
"from": "function_call",
"value": "{\"name\": \"find_user_id_by_email\", \"arguments\": \"{\\\"email\\\": \\\"[email protected]\\\"}\"}"
},
{
"from": "observation",
"value": "nina_patel_4721"
},
{
"from": "gpt",
"value": "Thanks, your identity is verified. Please provide the order ID for the delivered order you want to exchange items from."
},
{
"from": "human",
"value": "The order ID is #R5592031."
},
{
"from": "function_call",
"value": "{\"name\": \"get_order_details\", \"arguments\": \"{\\\"order_id\\\": \\\"#R5592031\\\"}\"}"
},
{
"from": "observation",
"value": "{\"order_id\": \"#R5592031\", \"user_id\": \"nina_patel_4721\", \"address\": {\"address1\": \"58 Cedar Avenue\", \"address2\": \"\", \"city\": \"Jersey City\", \"country\": \"USA\", \"state\": \"NJ\", \"zip\": \"07305\"}, \"items\": [{\"name\": \"Running Shoes\", \"product_id\": \"1188003344\", \"item_id\": \"2211990088\", \"price\": 129.99, \"options\": {\"size\": \"9\", \"color\": \"blue\", \"width\": \"regular\"}}, {\"name\": \"Hoodie\", \"product_id\": \"5500228833\", \"item_id\": \"7700445566\", \"price\": 64.5, \"options\": {\"size\": \"M\", \"color\": \"grey\", \"fit\": \"regular\"}}, {\"name\": \"Bluetooth Speaker\", \"product_id\": \"6677889900\", \"item_id\": \"3399001122\", \"price\": 89.0, \"options\": {\"color\": \"black\", \"waterproof\": \"yes\", \"battery life\": \"12h\"}}], \"fulfillments\": [{\"status\": \"delivered\", \"delivered_at\": \"2025-08-21 14:05:00\"}], \"status\": \"delivered\", \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 283.49, \"payment_method_id\": \"credit_card_7834219\"}]}"
},
{
"from": "gpt",
"value": "I found your delivered order #R5592031. Here are the items:\n- Running Shoes (Item ID: 2211990088) – Size 9, Color blue, Width regular – $129.99\n- Hoodie (Item ID: 7700445566) – Size M, Color grey, Fit regular – $64.50\n- Bluetooth Speaker (Item ID: 3399001122) – Color black, Waterproof yes, Battery life 12h – $89.00\nPlease specify:\n- Which item(s) you want to exchange and their current item_id(s)\n- The new variant item_id(s) you want to exchange to\n- The payment method to use for any price difference (we will use your original payment method by default)\nNote: For exchanges, all items to be exchanged must be provided now because we can only submit one exchange request per order."
},
{
"from": "human",
"value": "I want to exchange the Running Shoes (item 2211990088) to size 10 black, new item id 2211990095. And the Hoodie (item 7700445566) to size L, same grey, new item id 7700445577. Please charge or refund the difference to the same card on the order."
},
{
"from": "function_call",
"value": "{\"name\": \"get_product_details\", \"arguments\": \"{\\\"product_id\\\": \\\"1188003344\\\"}\"}"
},
{
"from": "observation",
"value": "{\"name\": \"Running Shoes\", \"product_id\": \"1188003344\", \"variants\": {\"2211990088\": {\"item_id\": \"2211990088\", \"options\": {\"size\": \"9\", \"color\": \"blue\", \"width\": \"regular\"}, \"available\": true, \"price\": 129.99}, \"2211990095\": {\"item_id\": \"2211990095\", \"options\": {\"size\": \"10\", \"color\": \"black\", \"width\": \"regular\"}, \"available\": true, \"price\": 134.99}, \"2211990077\": {\"item_id\": \"2211990077\", \"options\": {\"size\": \"9\", \"color\": \"black\", \"width\": \"regular\"}, \"available\": true, \"price\": 129.99}, \"2211990103\": {\"item_id\": \"2211990103\", \"options\": {\"size\": \"10\", \"color\": \"blue\", \"width\": \"wide\"}, \"available\": true, \"price\": 139.99}}}"
},
{
"from": "function_call",
"value": "{\"name\": \"get_product_details\", \"arguments\": \"{\\\"product_id\\\": \\\"5500228833\\\"}\"}"
},
{
"from": "observation",
"value": "{\"name\": \"Hoodie\", \"product_id\": \"5500228833\", \"variants\": {\"7700445566\": {\"item_id\": \"7700445566\", \"options\": {\"size\": \"M\", \"color\": \"grey\", \"fit\": \"regular\"}, \"available\": true, \"price\": 64.5}, \"7700445577\": {\"item_id\": \"7700445577\", \"options\": {\"size\": \"L\", \"color\": \"grey\", \"fit\": \"regular\"}, \"available\": true, \"price\": 69.0}, \"7700445599\": {\"item_id\": \"7700445599\", \"options\": {\"size\": \"M\", \"color\": \"black\", \"fit\": \"slim\"}, \"available\": true, \"price\": 62.0}}}"
},
{
"from": "gpt",
"value": "Thanks. I’ve verified the requested variants:\n- Running Shoes new variant (2211990095): Size 10, Color black, Width regular, Price $134.99 – available\n- Hoodie new variant (7700445577): Size L, Color grey, Fit regular, Price $69.00 – available\nI’ll calculate the price differences now and summarize for confirmation."
},
{
"from": "function_call",
"value": "{\"name\": \"calculate\", \"arguments\": \"{\\\"expression\\\": \\\"134.99 - 129.99\\\"}\"}"
},
{
"from": "observation",
"value": "5"
},
{
"from": "function_call",
"value": "{\"name\": \"calculate\", \"arguments\": \"{\\\"expression\\\": \\\"69.00 - 64.50\\\"}\"}"
},
{
"from": "observation",
"value": "4.5"
},
{
"from": "function_call",
"value": "{\"name\": \"calculate\", \"arguments\": \"{\\\"expression\\\": \\\"5 + 4.5\\\"}\"}"
},
{
"from": "observation",
"value": "9.5"
},
{
"from": "gpt",
"value": "Calculation details:\n- Running Shoes difference: 134.99 - 129.99 = $5.00\n- Hoodie difference: 69.00 - 64.50 = $4.50\n- Total to be charged: 5.00 + 4.50 = $9.50\nBefore I proceed, please confirm you’ve provided all items you want to exchange in this order, since we can only submit one exchange request.\nLet me confirm the details:\n- Action: Exchange delivered items\n- Order: #R5592031\n- Item 1: Running Shoes (old item_id 2211990088) -> new item_id 2211990095 (Size 10, Color black, Width regular, Price $134.99)\n- Item 2: Hoodie (old item_id 7700445566) -> new item_id 7700445577 (Size L, Color grey, Fit regular, Price $69.00)\n- Payment method: credit_card_7834219 (original)\n- Total impact: You will be charged $9.50\nPlease confirm with 'yes' to proceed."
},
{
"from": "human",
"value": "Yes, please proceed."
},
{
"from": "function_call",
"value": "{\"name\": \"exchange_delivered_order_items\", \"arguments\": \"{\\\"order_id\\\": \\\"#R5592031\\\", \\\"item_ids\\\": [\\\"2211990088\\\", \\\"7700445566\\\"], \\\"new_item_ids\\\": [\\\"2211990095\\\", \\\"7700445577\\\"], \\\"payment_method_id\\\": \\\"credit_card_7834219\\\"}\"}"
},
{
"from": "observation",
"value": "{\"order_id\": \"#R5592031\", \"user_id\": \"nina_patel_4721\", \"address\": {\"address1\": \"58 Cedar Avenue\", \"address2\": \"\", \"city\": \"Jersey City\", \"country\": \"USA\", \"state\": \"NJ\", \"zip\": \"07305\"}, \"items\": [{\"name\": \"Running Shoes\", \"product_id\": \"1188003344\", \"item_id\": \"2211990088\", \"price\": 129.99, \"options\": {\"size\": \"9\", \"color\": \"blue\", \"width\": \"regular\"}}, {\"name\": \"Hoodie\", \"product_id\": \"5500228833\", \"item_id\": \"7700445566\", \"price\": 64.5, \"options\": {\"size\": \"M\", \"color\": \"grey\", \"fit\": \"regular\"}}, {\"name\": \"Bluetooth Speaker\", \"product_id\": \"6677889900\", \"item_id\": \"3399001122\", \"price\": 89.0, \"options\": {\"color\": \"black\", \"waterproof\": \"yes\", \"battery life\": \"12h\"}}], \"status\": \"exchange requested\", \"exchange_requests\": [{\"old_item_id\": \"2211990088\", \"new_item_id\": \"2211990095\"}, {\"old_item_id\": \"7700445566\", \"new_item_id\": \"7700445577\"}], \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 283.49, \"payment_method_id\": \"credit_card_7834219\"}, {\"transaction_type\": \"payment\", \"amount\": 9.5, \"payment_method_id\": \"credit_card_7834219\"}]}"
},
{
"from": "gpt",
"value": "Your exchange request has been submitted successfully.\nOrder #R5592031:\n- Exchanged items requested:\n- Running Shoes: old item_id 2211990088 -> new item_id 2211990095\n- Hoodie: old item_id 7700445566 -> new item_id 7700445577\n- Total charged to your original payment method (credit_card_7834219): $9.50\n- Order status: exchange requested\n- You will receive an email with instructions on returning the original items. There is no need to place a new order.\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": "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_3282441884308357696
| 20 | 27 |
general
|
Hi, I need some help with changing an item in my pending order.
|
[
{
"from": "human",
"value": "Hi, I’d like to cancel an order I placed earlier today."
},
{
"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.\nAlso, please share the order ID you want to cancel so I can check its status."
},
{
"from": "human",
"value": "My email is [email protected], and the order ID is #A9274015."
},
{
"from": "function_call",
"value": "{\"name\": \"find_user_id_by_email\", \"arguments\": \"{\\\"email\\\": \\\"[email protected]\\\"}\"}"
},
{
"from": "observation",
"value": "maria_garcia_1022"
},
{
"from": "function_call",
"value": "{\"name\": \"get_user_details\", \"arguments\": \"{\\\"user_id\\\": \\\"maria_garcia_1022\\\"}\"}"
},
{
"from": "observation",
"value": "{\"name\": {\"first_name\": \"Maria\", \"last_name\": \"Garcia\"}, \"address\": {\"address1\": \"123 Lakeview Dr\", \"address2\": \"Apt 4B\", \"city\": \"Miami\", \"country\": \"USA\", \"province\": \"FL\", \"zip\": \"33130\"}, \"email\": \"[email protected]\", \"payment_methods\": {\"gift_card_9021345\": {\"source\": \"gift_card\", \"balance\": 25.0, \"id\": \"gift_card_9021345\"}, \"visa_5541\": {\"source\": \"credit_card\", \"last4\": \"5541\", \"id\": \"visa_5541\"}, \"paypal_mg72\": {\"source\": \"paypal\", \"email\": \"[email protected]\", \"id\": \"paypal_mg72\"}}, \"orders\": [\"#A9274015\", \"#C8832140\"]}"
},
{
"from": "function_call",
"value": "{\"name\": \"get_order_details\", \"arguments\": \"{\\\"order_id\\\": \\\"#A9274015\\\"}\"}"
},
{
"from": "observation",
"value": "{\"order_id\": \"#A9274015\", \"user_id\": \"maria_garcia_1022\", \"address\": {\"address1\": \"123 Lakeview Dr\", \"address2\": \"Apt 4B\", \"city\": \"Miami\", \"country\": \"USA\", \"state\": \"FL\", \"zip\": \"33130\"}, \"items\": [{\"name\": \"Running Shoes\", \"product_id\": \"1100220033\", \"item_id\": \"7654321988\", \"price\": 89.99, \"options\": {\"size\": \"8\", \"color\": \"black\"}}, {\"name\": \"Yoga Mat\", \"product_id\": \"2200330044\", \"item_id\": \"6677001122\", \"price\": 29.5, \"options\": {\"color\": \"teal\", \"thickness\": \"6mm\"}}, {\"name\": \"Water Bottle\", \"product_id\": \"3300440055\", \"item_id\": \"5544332211\", \"price\": 18.75, \"options\": {\"color\": \"steel\", \"insulated\": \"yes\"}}], \"fulfillments\": [], \"status\": \"pending\", \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 138.24, \"payment_method_id\": \"visa_5541\"}]}"
},
{
"from": "gpt",
"value": "Thanks, Maria. I’ve verified your account and located order #A9274015. Its status is pending, so it’s eligible for cancellation.\nBefore I proceed, please confirm your cancellation reason. It must be one of the following:\n- no longer needed\n- ordered by mistake"
},
{
"from": "human",
"value": "The reason is \"ordered by mistake.\""
},
{
"from": "function_call",
"value": "{\"name\": \"calculate\", \"arguments\": \"{\\\"expression\\\": \\\"89.99 + 29.50 + 18.75\\\"}\"}"
},
{
"from": "observation",
"value": "138.24"
},
{
"from": "gpt",
"value": "Let me confirm the details:\n- Action: Cancel pending order\n- Order: #A9274015\n- Item: All items in the order (Running Shoes item_id 7654321988, Yoga Mat item_id 6677001122, Water Bottle item_id 5544332211)\n- Reason: ordered by mistake\n- Refund method: Original payment method (credit card ending in 5541). Refund will appear in 5–7 business days.\n- Total impact: Refund $138.24\nPlease confirm with 'yes' to proceed."
},
{
"from": "human",
"value": "Yes"
},
{
"from": "function_call",
"value": "{\"name\": \"cancel_pending_order\", \"arguments\": \"{\\\"order_id\\\": \\\"#A9274015\\\", \\\"reason\\\": \\\"ordered by mistake\\\"}\"}"
},
{
"from": "observation",
"value": "{\"order_id\": \"#A9274015\", \"user_id\": \"maria_garcia_1022\", \"address\": {\"address1\": \"123 Lakeview Dr\", \"address2\": \"Apt 4B\", \"city\": \"Miami\", \"country\": \"USA\", \"state\": \"FL\", \"zip\": \"33130\"}, \"items\": [{\"name\": \"Running Shoes\", \"product_id\": \"1100220033\", \"item_id\": \"7654321988\", \"price\": 89.99, \"options\": {\"size\": \"8\", \"color\": \"black\"}}, {\"name\": \"Yoga Mat\", \"product_id\": \"2200330044\", \"item_id\": \"6677001122\", \"price\": 29.5, \"options\": {\"color\": \"teal\", \"thickness\": \"6mm\"}}, {\"name\": \"Water Bottle\", \"product_id\": \"3300440055\", \"item_id\": \"5544332211\", \"price\": 18.75, \"options\": {\"color\": \"steel\", \"insulated\": \"yes\"}}], \"fulfillments\": [], \"status\": \"cancelled\", \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 138.24, \"payment_method_id\": \"visa_5541\"}], \"cancellation_reason\": \"ordered by mistake\"}"
},
{
"from": "gpt",
"value": "Your order #A9274015 has been cancelled successfully.\n- Status: cancelled\n- Refund amount: $138.24\n- Refund method: Your original credit card (ending in 5541)\n- Refund timeline: 5–7 business days\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": "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_4327091738523356229
| 20 | 18 |
general
|
Hi, I need to exchange an Air Purifier I received for a different model.
|
[
{
"from": "human",
"value": "Hi! I need to add one checked bag to my upcoming reservation P9XABC. Can you help?"
},
{
"from": "gpt",
"value": "I can help with that. To proceed, please provide:\n- Your user ID (to verify membership and eligibility)\n- Which saved payment method you'd like me to use if there’s any fee (e.g., the last four digits of a saved card)\nAs a reminder, we can only add checked bags (not remove). Once I verify your reservation and membership, I’ll confirm whether any fee applies before proceeding."
},
{
"from": "human",
"value": "My user ID is maria_lopez_9081. If there’s any charge, use my Visa ending in 1123."
},
{
"from": "function_call",
"value": "{\"name\":\"get_reservation_details\",\"arguments\":{\"reservation_id\":\"P9XABC\"}}"
},
{
"from": "observation",
"value": "{\"reservation_id\":\"P9XABC\",\"user_id\":\"maria_lopez_9081\",\"origin\":\"LAX\",\"destination\":\"SEA\",\"flight_type\":\"one_way\",\"cabin\":\"economy\",\"flights\":[{\"origin\":\"LAX\",\"destination\":\"SEA\",\"flight_number\":\"HAT501\",\"date\":\"2024-05-20\",\"price\":159}],\"passengers\":[{\"first_name\":\"Maria\",\"last_name\":\"Lopez\",\"dob\":\"1990-02-14\"}],\"payment_history\":[{\"payment_id\":\"credit_card_12345\",\"amount\":159}],\"created_at\":\"2024-05-10T11:30:00\",\"total_baggages\":0,\"nonfree_baggages\":0,\"insurance\":\"no\"}"
},
{
"from": "function_call",
"value": "{\"name\":\"get_user_details\",\"arguments\":{\"user_id\":\"maria_lopez_9081\"}}"
},
{
"from": "observation",
"value": "{\"name\":{\"first_name\":\"Maria\",\"last_name\":\"Lopez\"},\"address\":{\"address1\":\"88 Hillcrest Ave\",\"address2\":\"\",\"city\":\"Los Angeles\",\"country\":\"USA\",\"province\":\"CA\",\"zip\":\"90036\"},\"email\":\"[email protected]\",\"dob\":\"1990-02-14\",\"payment_methods\":{\"credit_card_9876\":{\"source\":\"credit_card\",\"brand\":\"visa\",\"last_four\":\"1123\",\"id\":\"credit_card_9876\"},\"credit_card_12345\":{\"source\":\"credit_card\",\"brand\":\"mastercard\",\"last_four\":\"4477\",\"id\":\"credit_card_12345\"}},\"saved_passengers\":[],\"membership\":\"regular\",\"reservations\":[\"P9XABC\",\"K2LMNO\"]}"
},
{
"from": "gpt",
"value": "Thanks, I’ve verified the details:\n- Reservation P9XABC belongs to user maria_lopez_9081\n- Cabin: economy; Passengers: 1 (Maria Lopez)\n- Current checked bags: 0\n- Membership: regular\n- Selected payment method if needed: Visa ending 1123 (ID: credit_card_9876)\nBaggage policy for regular members:\n- Economy: 1 free checked bag per passenger\n- Each extra bag costs $50\nYou’re requesting to add 1 checked bag for this reservation. Given your allowance (1 free) and current bags (0), the estimated fee is $0.\nAction to be performed if you confirm:\n- Add 1 checked bag to reservation P9XABC\n- Payment method on file: Visa ending 1123 (used only if a fee applies; current estimate $0)\n- Note: We can only add, not remove, checked bags\nPlease reply “yes” to proceed."
},
{
"from": "human",
"value": "Yes, please go ahead."
},
{
"from": "function_call",
"value": "{\"name\":\"update_reservation_baggages\",\"arguments\":{\"reservation_id\":\"P9XABC\",\"add_bags\":1,\"payment_id\":\"credit_card_9876\"}}"
},
{
"from": "observation",
"value": "{\"reservation_id\":\"P9XABC\",\"total_baggages\":1,\"nonfree_baggages\":0,\"charged_amount\":0,\"currency\":\"USD\",\"status\":\"success\"}"
},
{
"from": "gpt",
"value": "All set! I’ve added 1 checked bag to reservation P9XABC.\n- Total checked bags: 1\n- Non-free bags: 0\n- Charge: $0 (covered by your free allowance)\nIs there anything else I can assist 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_-7677014892851284859
| 12 | 12 |
general
|
Hello! I've noticed an error in my saved passenger information for a past reservation. Can you help me make a correction?
|
[
{
"from": "human",
"value": "Hello, I need to return a couple of items from my last delivery."
},
{
"from": "gpt",
"value": "I can help you with that! First, I need to authenticate your identity to locate your user ID. Could you please provide your email address? If you don't remember it, I can also look you up by your first name, last name, and zip code.\nOnce I have your user ID, I can assist with the return. Could you also share the order ID from which you want to return items?"
},
{
"from": "human",
"value": "My name is Daniela Lopez, and my zip code is 33133. The order ID is #R8831042."
},
{
"from": "function_call",
"value": "{\"name\": \"find_user_id_by_name_zip\", \"arguments\": \"{\\\"first_name\\\": \\\"Daniela\\\", \\\"last_name\\\": \\\"Lopez\\\", \\\"zip\\\": \\\"33133\\\"}\"}"
},
{
"from": "observation",
"value": "daniela_lopez_1041"
},
{
"from": "function_call",
"value": "{\"name\": \"get_user_details\", \"arguments\": \"{\\\"user_id\\\": \\\"daniela_lopez_1041\\\"}\"}"
},
{
"from": "observation",
"value": "{\"name\": {\"first_name\": \"Daniela\", \"last_name\": \"Lopez\"}, \"address\": {\"address1\": \"1450 Coral Way\", \"address2\": \"Apt 12C\", \"city\": \"Miami\", \"country\": \"USA\", \"province\": \"FL\", \"zip\": \"33133\"}, \"email\": \"[email protected]\", \"payment_methods\": {\"paypal_558877\": {\"source\": \"paypal\", \"id\": \"paypal_558877\", \"email\": \"[email protected]\"}, \"gift_card_330011\": {\"source\": \"gift_card\", \"id\": \"gift_card_330011\"}, \"credit_card_4411332\": {\"source\": \"credit_card\", \"brand\": \"visa\", \"last_four\": \"1120\", \"id\": \"credit_card_4411332\"}}, \"orders\": [\"#R8831042\", \"#P77192\"]}"
},
{
"from": "function_call",
"value": "{\"name\": \"get_order_details\", \"arguments\": \"{\\\"order_id\\\": \\\"#R8831042\\\"}\"}"
},
{
"from": "observation",
"value": "{\"order_id\": \"#R8831042\", \"user_id\": \"daniela_lopez_1041\", \"address\": {\"address1\": \"780 Ocean Drive\", \"address2\": \"Unit 5B\", \"city\": \"Miami Beach\", \"country\": \"USA\", \"state\": \"FL\", \"zip\": \"33139\"}, \"items\": [{\"name\": \"Running Shoes\", \"product_id\": \"5100001234\", \"item_id\": \"7000112233\", \"price\": 129.99, \"options\": {\"size\": \"9\", \"color\": \"blue\"}}, {\"name\": \"Wireless Earbuds\", \"product_id\": \"5200005678\", \"item_id\": \"7000223344\", \"price\": 89.95, \"options\": {\"color\": \"white\", \"feature\": \"noise-canceling\"}}, {\"name\": \"Stainless Steel Water Bottle\", \"product_id\": \"5300009876\", \"item_id\": \"7000334455\", \"price\": 24.50, \"options\": {\"color\": \"black\", \"capacity\": \"750ml\"}}], \"fulfillments\": [{\"status\": \"delivered\", \"delivered_at\": \"2025-08-15 14:22:00\"}], \"status\": \"delivered\", \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 244.44, \"payment_method_id\": \"paypal_558877\"}]}"
},
{
"from": "gpt",
"value": "Thanks, Daniela. I’ve located your delivered order #R8831042 with these items:\n1. Running Shoes (blue, size 9) - $129.99, item_id 7000112233\n2. Wireless Earbuds (white, noise-canceling) - $89.95, item_id 7000223344\n3. Stainless Steel Water Bottle (black, 750ml) - $24.50, item_id 7000334455\nTo proceed with a return, please let me know:\n- Which item(s) you want to return (you can reference the item IDs above)\n- A brief reason for each item’s return\n- Where you’d like the refund sent: your original payment method (PayPal ending in [email protected]) or your existing gift card (gift_card_330011)"
},
{
"from": "human",
"value": "I'd like to return the Wireless Earbuds (item_id 7000223344) because the fit was uncomfortable, and the Water Bottle (item_id 7000334455) because it arrived dented. Please refund to my PayPal."
},
{
"from": "function_call",
"value": "{\"name\": \"calculate\", \"arguments\": \"{\\\"expression\\\": \\\"89.95 + 24.50\\\"}\"}"
},
{
"from": "observation",
"value": "114.45"
},
{
"from": "gpt",
"value": "Let me confirm the details:\n- Action: Return items\n- Order: #R8831042\n- Item: Wireless Earbuds (item_id 7000223344), reason: fit uncomfortable\n- Item: Stainless Steel Water Bottle (item_id 7000334455), reason: arrived dented\n- Refund method: Original payment method (paypal_558877)\n- Total impact: $114.45 refund\nPlease confirm with 'yes' to proceed."
},
{
"from": "human",
"value": "Yes, please proceed."
},
{
"from": "function_call",
"value": "{\"name\": \"return_delivered_order_items\", \"arguments\": \"{\\\"order_id\\\": \\\"#R8831042\\\", \\\"item_ids\\\": [\\\"7000223344\\\", \\\"7000334455\\\"], \\\"payment_method_id\\\": \\\"paypal_558877\\\"}\"}"
},
{
"from": "observation",
"value": "{\"order_id\": \"#R8831042\", \"user_id\": \"daniela_lopez_1041\", \"address\": {\"address1\": \"780 Ocean Drive\", \"address2\": \"Unit 5B\", \"city\": \"Miami Beach\", \"country\": \"USA\", \"state\": \"FL\", \"zip\": \"33139\"}, \"items\": [{\"name\": \"Running Shoes\", \"product_id\": \"5100001234\", \"item_id\": \"7000112233\", \"price\": 129.99, \"options\": {\"size\": \"9\", \"color\": \"blue\"}}, {\"name\": \"Wireless Earbuds\", \"product_id\": \"5200005678\", \"item_id\": \"7000223344\", \"price\": 89.95, \"options\": {\"color\": \"white\", \"feature\": \"noise-canceling\"}}, {\"name\": \"Stainless Steel Water Bottle\", \"product_id\": \"5300009876\", \"item_id\": \"7000334455\", \"price\": 24.50, \"options\": {\"color\": \"black\", \"capacity\": \"750ml\"}}], \"fulfillments\": [{\"status\": \"delivered\", \"delivered_at\": \"2025-08-15 14:22:00\"}], \"status\": \"return requested\", \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 244.44, \"payment_method_id\": \"paypal_558877\"}]}"
},
{
"from": "gpt",
"value": "Your return request for order #R8831042 has been placed successfully. You’ll receive an email shortly with instructions on how and where to return the two items:\n- Wireless Earbuds (item_id 7000223344)\n- Stainless Steel Water Bottle (item_id 7000334455)\nThe refund of $114.45 will be sent to your original PayPal (paypal_558877) after the return is processed. The Running Shoes remain on your order and are unaffected.\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": "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_7208420533209540737
| 22 | 18 |
general
|
Hi there! I need to make some changes to my current order.
|
[
{
"from": "human",
"value": "Hi there, I received an order yesterday and I'd like to return one of the items. Can you help me with that?"
},
{
"from": "gpt",
"value": "I can help with that. First, I need to authenticate your account. Could you please provide your email address so I can 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": "marco_lee_4821"
},
{
"from": "gpt",
"value": "Thanks, I’ve located your account. To start the return, please provide:\n- The order ID\n- The item_id(s) you want to return and the reason for each\n- Where you’d like the refund sent: your original payment method or an existing gift card on your account"
},
{
"from": "human",
"value": "The order ID is #W8842331. I want to return item_id itm_hoodie_blue_m_7391 because it’s too big. Please refund to my original payment method."
},
{
"from": "function_call",
"value": "{\"name\":\"get_order_details\",\"arguments\":{\"order_id\":\"#W8842331\"}}"
},
{
"from": "observation",
"value": "{\"order_id\":\"#W8842331\",\"status\":\"delivered\",\"delivered_at\":\"2025-08-14 16:05:00\",\"items\":[{\"item_id\":\"itm_hoodie_blue_m_7391\",\"product_id\":\"P112\",\"product_name\":\"Performance Hoodie\",\"options\":{\"color\":\"Blue\",\"size\":\"M\"},\"unit_price\":59.99,\"tax\":4.80,\"quantity\":1},{\"item_id\":\"itm_shorts_black_l_5120\",\"product_id\":\"P109\",\"product_name\":\"Flex Training Shorts\",\"options\":{\"color\":\"Black\",\"size\":\"L\"},\"unit_price\":29.50,\"tax\":2.36,\"quantity\":1}],\"payment_method\":{\"source\":\"credit_card\",\"brand\":\"Visa\",\"last4\":\"2219\",\"id\":\"cc_2219\"},\"shipping_address\":{\"address1\":\"2140 Walnut Avenue\",\"address2\":\"Unit 3\",\"city\":\"Philadelphia\",\"state\":\"PA\",\"country\":\"USA\",\"zip\":\"19103\"},\"totals\":{\"subtotal\":89.49,\"tax\":7.16,\"shipping\":0.00,\"grand_total\":96.65}}"
},
{
"from": "gpt",
"value": "I’ve verified your order #W8842331 is delivered, and the item itm_hoodie_blue_m_7391 (Performance Hoodie, Blue, size M) is eligible for return. I’ll calculate your refund for that item."
},
{
"from": "function_call",
"value": "{\"name\":\"calculate\",\"arguments\":{\"expression\":\"59.99 + 4.80\"}}"
},
{
"from": "observation",
"value": "64.79"
},
{
"from": "gpt",
"value": "Let me confirm the details:\n- Action: Return delivered items\n- Order: #W8842331\n- Item: Performance Hoodie (Blue, size M), item_id itm_hoodie_blue_m_7391, reason: too big\n- Refund method: Original payment method (Visa •••• 2219)\n- Total impact: refund $64.79\nPlease confirm with 'yes' to proceed."
},
{
"from": "human",
"value": "yes"
},
{
"from": "function_call",
"value": "{\"name\":\"return_delivered_order_items\",\"arguments\":{\"order_id\":\"#W8842331\",\"items\":[\"itm_hoodie_blue_m_7391\"],\"refund_to\":\"original_payment_method\"}}"
},
{
"from": "observation",
"value": "{\"order_id\":\"#W8842331\",\"status\":\"return requested\",\"items_returned\":[\"itm_hoodie_blue_m_7391\"],\"refund_to\":\"original_payment_method\",\"message\":\"Return request created. Customer will receive email instructions.\"}"
},
{
"from": "gpt",
"value": "Your return request for item itm_hoodie_blue_m_7391 has been submitted for order #W8842331. Status is now “return requested.” You’ll receive an email with instructions on how to return the item. The refund of $64.79 will go back to your original payment method (Visa •••• 2219) after the return is processed. If there’s anything else I can help 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_-4301261315794566463
| 10 | 17 |
general
|
Hello! I recently moved and just noticed my account still has my old address listed on it. Can you assist me in updating it, please?
|
[
{
"from": "human",
"value": "Hi, I'm Carlos Diaz. I need to change the size of the hiking boots in my pending order to size 11 wide, and switch the jacket color to navy. Can you help?"
},
{
"from": "gpt",
"value": "I can help with that. First, I need to authenticate your identity. Please provide your email address. If you don’t recall it, you can provide your full name (Carlos Diaz) and your zip code instead.\nOnce authenticated, I’ll:\n1. Locate your pending order\n2. Verify the current items and requested variants (boots size 11 wide, jacket color navy)\n3. Calculate any price differences\n4. Process the modification in one update after your confirmation"
},
{
"from": "human",
"value": "My email is [email protected]."
},
{
"from": "function_call",
"value": "{\"name\":\"find_user_id_by_email\",\"arguments\":\"{\\\"email\\\": \\\"[email protected]\\\"}\"}"
},
{
"from": "observation",
"value": "carlos_diaz_1022"
},
{
"from": "gpt",
"value": "Thanks, Carlos. You’re authenticated as user ID carlos_diaz_1022.\nTo proceed, please share your order number. Also, please confirm:\n- The hiking boots you want are size 11 Wide\n- The jacket should be Navy, same size as currently on the order (please confirm the size)\nBy default, I’ll apply any price difference to your original payment method unless you prefer another existing method."
},
{
"from": "human",
"value": "The order number is #A902311. Yes, boots size 11 Wide, and jacket Navy in size M. You can use my original PayPal."
},
{
"from": "function_call",
"value": "{\"name\":\"get_order_details\",\"arguments\":\"{\\\"order_id\\\": \\\"#A902311\\\"}\"}"
},
{
"from": "observation",
"value": "{\"order_id\": \"#A902311\", \"user_id\": \"carlos_diaz_1022\", \"address\": {\"address1\": \"744 King Street\", \"address2\": \"\", \"city\": \"Denver\", \"country\": \"USA\", \"state\": \"CO\", \"zip\": \"80205\"}, \"items\": [{\"name\": \"TrailPro Hiking Boots\", \"product_id\": \"9088771122\", \"item_id\": \"7001122334\", \"price\": 119.99, \"options\": {\"size\": \"10\", \"width\": \"Regular\", \"color\": \"Brown\"}}, {\"name\": \"All-Weather Jacket\", \"product_id\": \"5533112244\", \"item_id\": \"8002233445\", \"price\": 89.50, \"options\": {\"color\": \"Forest Green\", \"size\": \"M\"}}, {\"name\": \"Insulated Water Bottle\", \"product_id\": \"1122334455\", \"item_id\": \"9003344556\", \"price\": 24.00, \"options\": {\"capacity\": \"24oz\", \"color\": \"Silver\"}}], \"fulfillments\": [], \"status\": \"pending\", \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 233.49, \"payment_method_id\": \"paypal_4455667\"}]}"
},
{
"from": "gpt",
"value": "I’ve found order #A902311, and it’s currently pending, so we can modify items. I’ll now check available variants for:\n- TrailPro Hiking Boots (size 11 Wide)\n- All-Weather Jacket (Navy, size M)"
},
{
"from": "function_call",
"value": "{\"name\":\"get_product_details\",\"arguments\":\"{\\\"product_id\\\": \\\"9088771122\\\"}\"}"
},
{
"from": "observation",
"value": "{\"name\": \"TrailPro Hiking Boots\", \"product_id\": \"9088771122\", \"variants\": {\"7001122334\": {\"item_id\": \"7001122334\", \"options\": {\"size\": \"10\", \"width\": \"Regular\", \"color\": \"Brown\"}, \"available\": true, \"price\": 119.99}, \"7004455667\": {\"item_id\": \"7004455667\", \"options\": {\"size\": \"10\", \"width\": \"Wide\", \"color\": \"Brown\"}, \"available\": true, \"price\": 119.99}, \"7005566778\": {\"item_id\": \"7005566778\", \"options\": {\"size\": \"11\", \"width\": \"Wide\", \"color\": \"Brown\"}, \"available\": true, \"price\": 129.99}, \"7006677889\": {\"item_id\": \"7006677889\", \"options\": {\"size\": \"11\", \"width\": \"Regular\", \"color\": \"Brown\"}, \"available\": true, \"price\": 124.99}}}"
},
{
"from": "gpt",
"value": "I’ll check the jacket variants next."
},
{
"from": "function_call",
"value": "{\"name\":\"get_product_details\",\"arguments\":\"{\\\"product_id\\\": \\\"5533112244\\\"}\"}"
},
{
"from": "observation",
"value": "{\"name\": \"All-Weather Jacket\", \"product_id\": \"5533112244\", \"variants\": {\"8002233445\": {\"item_id\": \"8002233445\", \"options\": {\"color\": \"Forest Green\", \"size\": \"M\"}, \"available\": true, \"price\": 89.50}, \"8005566777\": {\"item_id\": \"8005566777\", \"options\": {\"color\": \"Navy\", \"size\": \"S\"}, \"available\": true, \"price\": 92.00}, \"8006677889\": {\"item_id\": \"8006677889\", \"options\": {\"color\": \"Navy\", \"size\": \"M\"}, \"available\": true, \"price\": 94.00}, \"8007788990\": {\"item_id\": \"8007788990\", \"options\": {\"color\": \"Navy\", \"size\": \"L\"}, \"available\": true, \"price\": 94.00}}}"
},
{
"from": "gpt",
"value": "I found both requested variants available:\n- Boots new variant: item 7005566778 (size 11 Wide, Brown), price $129.99\n- Jacket new variant: item 8006677889 (Navy, size M), price $94.00\nI’ll calculate the price differences."
},
{
"from": "function_call",
"value": "{\"name\":\"calculate\",\"arguments\":\"129.99 - 119.99\"}"
},
{
"from": "observation",
"value": "10"
},
{
"from": "function_call",
"value": "{\"name\":\"calculate\",\"arguments\":\"94.00 - 89.50\"}"
},
{
"from": "observation",
"value": "4.5"
},
{
"from": "function_call",
"value": "{\"name\":\"calculate\",\"arguments\":\"10 + 4.5\"}"
},
{
"from": "observation",
"value": "14.5"
},
{
"from": "gpt",
"value": "Let me confirm the details:\n- Action: Modify items in pending order\n- Order: #A902311\n- Item: Replace TrailPro Hiking Boots item 7001122334 (size 10 Regular, $119.99) with item 7005566778 (size 11 Wide, $129.99)\n- Item: Replace All-Weather Jacket item 8002233445 (Forest Green M, $89.50) with item 8006677889 (Navy M, $94.00)\n- Additional: Price difference will be charged to your original payment method (paypal_4455667). After this change, the order will be marked as “pending (items modified)” and can’t be modified or cancelled further. Please confirm that these are all the items you want to modify in this order.\n- Total impact: $14.50 additional charge\nPlease confirm with 'yes' to proceed."
},
{
"from": "human",
"value": "Yes, please proceed."
},
{
"from": "function_call",
"value": "{\"name\":\"modify_pending_order_items\",\"arguments\":\"{\\\"order_id\\\": \\\"#A902311\\\", \\\"item_ids\\\": [\\\"7001122334\\\", \\\"8002233445\\\"], \\\"new_item_ids\\\": [\\\"7005566778\\\", \\\"8006677889\\\"], \\\"payment_method_id\\\": \\\"paypal_4455667\\\"}\"}"
},
{
"from": "observation",
"value": "{\"order_id\": \"#A902311\", \"user_id\": \"carlos_diaz_1022\", \"address\": {\"address1\": \"744 King Street\", \"address2\": \"\", \"city\": \"Denver\", \"country\": \"USA\", \"state\": \"CO\", \"zip\": \"80205\"}, \"items\": [{\"name\": \"TrailPro Hiking Boots\", \"product_id\": \"9088771122\", \"item_id\": \"7005566778\", \"price\": 129.99, \"options\": {\"size\": \"11\", \"width\": \"Wide\", \"color\": \"Brown\"}}, {\"name\": \"All-Weather Jacket\", \"product_id\": \"5533112244\", \"item_id\": \"8006677889\", \"price\": 94.00, \"options\": {\"color\": \"Navy\", \"size\": \"M\"}}, {\"name\": \"Insulated Water Bottle\", \"product_id\": \"1122334455\", \"item_id\": \"9003344556\", \"price\": 24.00, \"options\": {\"capacity\": \"24oz\", \"color\": \"Silver\"}}], \"fulfillments\": [], \"status\": \"pending (items modifed)\", \"payment_history\": [{\"transaction_type\": \"payment\", \"amount\": 233.49, \"payment_method_id\": \"paypal_4455667\"}], \"modified_items\": [\"7001122334\", \"8002233445\"], \"modified_new_items\": [\"7005566778\", \"8006677889\"], \"modification_payment_method_id\": \"paypal_4455667\", \"modification_price_difference\": 14.5}"
},
{
"from": "gpt",
"value": "Your order #A902311 has been updated successfully.\n- Boots changed to item 7005566778 (TrailPro Hiking Boots, size 11 Wide)\n- Jacket changed to item 8006677889 (All-Weather Jacket, Navy, size M)\n- Additional charge: $14.50 applied to your PayPal (paypal_4455667)\n- Order status: pending (items modified)\nNote: Further modifications or cancellations are no longer possible for this order. Is 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": "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_-8108529663441531503
| 16 | 27 |
general
|
Hi, I'm Mei Martin. I recently got my skateboard order, but I'd like to exchange it for the 34-inch bamboo variant with my custom design.
|
[{"from":"human","value":"Hi, I need to exchange a pair of running shoes I received for a different (...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_-685031959187860730
| 18 | 21 |
general
|
Hello! I need to update the delivery address for my pending order. Can you assist me with that?
|
[{"from":"human","value":"Hi, I want to return a couple of items from my recent order. Can you help?(...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_-5206109328216554060
| 18 | 18 |
general
|
Hello, I'd like to make some changes to my pending order. Can you assist me with that?
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 74