File size: 1,352 Bytes
a7d9947
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# affiliate_engine.py - Recommends monetizable robot gear and affiliate links

import random

# Static affiliate product catalog by robot app category
AFFILIATE_CATALOG = {
    "educational": [
        {"name": "Raspberry Pi 4 Kit", "url": "https://amzn.to/3EduBot"},
        {"name": "Qobo Coding Robot", "url": "https://amzn.to/3KidsCode"}
    ],
    "assistive": [
        {"name": "Smart Sensor Kit", "url": "https://amzn.to/3AssistX"},
        {"name": "OrCam MyEye Pro", "url": "https://amzn.to/OrCamEye"}
    ],
    "retail": [
        {"name": "Motion Detection Greeter Bot", "url": "https://amzn.to/RetailWave"},
        {"name": "Pepper Robot", "url": "https://amzn.to/3RetailAI"}
    ],
    "home automation": [
        {"name": "Google Nest Hub", "url": "https://amzn.to/NestBot"},
        {"name": "Arduino Smart Home Kit", "url": "https://amzn.to/ArduHome"}
    ],
    "creative": [
        {"name": "AI Art Robot Arm", "url": "https://amzn.to/CreativeArm"},
        {"name": "Doodlebot Kit", "url": "https://amzn.to/DoodleAI"}
    ]
}

def get_affiliate_recommendations(intent_category: str) -> list:
    items = AFFILIATE_CATALOG.get(intent_category, AFFILIATE_CATALOG["creative"])
    return random.sample(items, k=min(2, len(items)))

# Example usage
if __name__ == "__main__":
    print(get_affiliate_recommendations("educational"))