Spaces:
Sleeping
Sleeping
Update modules/amazon.js
Browse files- modules/amazon.js +45 -0
modules/amazon.js
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* AMAZON ELECTRONICS VENDOR
|
| 3 |
+
* Demonstrates routing based on specific items (iPhone vs Mac).
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
module.exports = {
|
| 7 |
+
agent_id: 'amazon.anp',
|
| 8 |
+
display_name: 'Amazon Electronics',
|
| 9 |
+
categories: ['electronics', 'hardware', 'retail'],
|
| 10 |
+
capabilities: ['price_flex', 'bundle_shipping'],
|
| 11 |
+
|
| 12 |
+
getItemConstraints: (item_intent) => {
|
| 13 |
+
const intent = (item_intent || '').toLowerCase();
|
| 14 |
+
|
| 15 |
+
if (intent.includes('iphone 15')) {
|
| 16 |
+
return {
|
| 17 |
+
id: 'Apple iPhone 15 Pro (256GB)',
|
| 18 |
+
list_price: 1099.00,
|
| 19 |
+
floor_price: 950.00, // Tight margin on Apple products
|
| 20 |
+
context: `You are an Amazon B2B sales agent.
|
| 21 |
+
The buyer wants an iPhone 15 Pro. Apple products have strict pricing margins.
|
| 22 |
+
You can offer free expedited shipping to sweeten the deal, but rarely drop the price by more than $50 unless the buyer is extremely persistent.`
|
| 23 |
+
};
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
if (intent.includes('macbook')) {
|
| 27 |
+
return {
|
| 28 |
+
id: 'Apple MacBook Pro M3 (14-inch)',
|
| 29 |
+
list_price: 1599.00,
|
| 30 |
+
floor_price: 1300.00, // Higher margin, more room to negotiate
|
| 31 |
+
context: `You are an Amazon B2B sales agent.
|
| 32 |
+
The buyer wants a MacBook Pro M3. You have authorization to drop the price down to the floor limit to secure the sale.
|
| 33 |
+
Make incremental drops of $50-$100.`
|
| 34 |
+
};
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
// Default Amazon item if specific product isn't matched
|
| 38 |
+
return {
|
| 39 |
+
id: item_intent || 'Amazon Basics Item',
|
| 40 |
+
list_price: 50.00,
|
| 41 |
+
floor_price: 40.00,
|
| 42 |
+
context: `You are an Amazon sales agent. Offer small volume discounts.`
|
| 43 |
+
};
|
| 44 |
+
}
|
| 45 |
+
};
|