| # assets_manager.py - Fetches or generates assets like avatars, audio, visuals | |
| import os | |
| import random | |
| AVATAR_DIR = "assets/default_avatars" | |
| # For now, we use static files. Later this can connect to DALL·E, Gemini image gen, etc. | |
| CATEGORY_AVATARS = { | |
| "educational": ["teacher_bot.png", "friendly_helper.png"], | |
| "assistive": ["aid_bot.png"], | |
| "entertainment": ["party_bot.png"], | |
| "industrial": ["mech_bot.png"], | |
| "healthcare": ["nurse_bot.png"], | |
| "home automation": ["smart_home_avatar.png"], | |
| "retail": ["greeter_bot.png"], | |
| "creative": ["abstract_bot.png"] | |
| } | |
| def fetch_visual_assets(intent_category: str) -> dict: | |
| avatars = CATEGORY_AVATARS.get(intent_category, CATEGORY_AVATARS["creative"]) | |
| selected = random.choice(avatars) | |
| path = os.path.join(AVATAR_DIR, selected) | |
| return { | |
| "avatar_image": path, | |
| "tts_voice": "gpt-4o-mini-tts", | |
| "style": "friendly", | |
| "theme_color": "#4F46E5" # Default vibrant purple | |
| } | |
| # Example | |
| if __name__ == "__main__": | |
| print(fetch_visual_assets("retail")) | |