|
|
|
|
|
import random |
|
|
|
|
|
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))) |
|
|
|
|
|
if __name__ == "__main__": |
|
print(get_affiliate_recommendations("educational")) |
|
|