Update monetization/affiliate_engine.py
Browse files
monetization/affiliate_engine.py
CHANGED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# affiliate_engine.py - Recommends monetizable robot gear and affiliate links
|
2 |
+
|
3 |
+
import random
|
4 |
+
|
5 |
+
# Static affiliate product catalog by robot app category
|
6 |
+
AFFILIATE_CATALOG = {
|
7 |
+
"educational": [
|
8 |
+
{"name": "Raspberry Pi 4 Kit", "url": "https://amzn.to/3EduBot"},
|
9 |
+
{"name": "Qobo Coding Robot", "url": "https://amzn.to/3KidsCode"}
|
10 |
+
],
|
11 |
+
"assistive": [
|
12 |
+
{"name": "Smart Sensor Kit", "url": "https://amzn.to/3AssistX"},
|
13 |
+
{"name": "OrCam MyEye Pro", "url": "https://amzn.to/OrCamEye"}
|
14 |
+
],
|
15 |
+
"retail": [
|
16 |
+
{"name": "Motion Detection Greeter Bot", "url": "https://amzn.to/RetailWave"},
|
17 |
+
{"name": "Pepper Robot", "url": "https://amzn.to/3RetailAI"}
|
18 |
+
],
|
19 |
+
"home automation": [
|
20 |
+
{"name": "Google Nest Hub", "url": "https://amzn.to/NestBot"},
|
21 |
+
{"name": "Arduino Smart Home Kit", "url": "https://amzn.to/ArduHome"}
|
22 |
+
],
|
23 |
+
"creative": [
|
24 |
+
{"name": "AI Art Robot Arm", "url": "https://amzn.to/CreativeArm"},
|
25 |
+
{"name": "Doodlebot Kit", "url": "https://amzn.to/DoodleAI"}
|
26 |
+
]
|
27 |
+
}
|
28 |
+
|
29 |
+
def get_affiliate_recommendations(intent_category: str) -> list:
|
30 |
+
items = AFFILIATE_CATALOG.get(intent_category, AFFILIATE_CATALOG["creative"])
|
31 |
+
return random.sample(items, k=min(2, len(items)))
|
32 |
+
|
33 |
+
# Example usage
|
34 |
+
if __name__ == "__main__":
|
35 |
+
print(get_affiliate_recommendations("educational"))
|