Download agent_manager.py from mgbam/AICEO: direct link, hf CLI and curl.
- Browser
- Download file 2.08 kB
-
https://huggingface.co/spaces/mgbam/AICEO/resolve/309404e1401bf41ba6104877bc7bfaeb2bec3196/agent_manager.py
- Command line
-
hf download hf://spaces/mgbam/AICEO@309404e1401bf41ba6104877bc7bfaeb2bec3196/agent_manager.py
-
curl -L -o agent_manager.py https://huggingface.co/spaces/mgbam/AICEO/resolve/309404e1401bf41ba6104877bc7bfaeb2bec3196/agent_manager.py
2.08 kB
| # agent_manager.py | |
| from strategy_agent import StrategyAgent | |
| from copy_agent import CopyAgent | |
| from ad_agent import AdAgent | |
| from email_agent import EmailAgent | |
| from shopify_client import create_shopify_product | |
| from memory.database import init_db, log_memory | |
| class AgentManager: | |
| def __init__(self, niche: str, business_type: str): | |
| self.niche = niche | |
| self.business_type = business_type | |
| self.strategy_agent = StrategyAgent() | |
| self.copy_agent = CopyAgent() | |
| self.ad_agent = AdAgent() | |
| self.email_agent = EmailAgent() | |
| # Ensure the DB/table exists | |
| init_db() | |
| def run_all(self) -> dict: | |
| summary = {} | |
| # 1) StrategyAgent | |
| strat = self.strategy_agent.run(self.niche, self.business_type) | |
| summary["strategy"] = strat | |
| log_memory("StrategyAgent", "run", strat) | |
| # 2) CopyAgent | |
| copy = self.copy_agent.run(self.niche, self.business_type) | |
| summary["copy"] = copy | |
| log_memory("CopyAgent", "run", copy) | |
| # 3) AdAgent | |
| ads = self.ad_agent.run(self.niche, self.business_type) | |
| summary["ads"] = ads | |
| log_memory("AdAgent", "run", ads) | |
| # 4) EmailAgent | |
| emails = self.email_agent.run(self.niche, self.business_type) | |
| summary["emails"] = emails | |
| log_memory("EmailAgent", "run", emails) | |
| # 5) Shopify Publishing | |
| try: | |
| title = f"{self.business_type} in {self.niche}" | |
| description = summary["copy"] | |
| price = "49.00" | |
| storefront_url = create_shopify_product( | |
| title=title, | |
| description=description, | |
| price=price, | |
| image_url=None | |
| ) | |
| summary["shopify_url"] = storefront_url | |
| log_memory("ShopifyClient", "create_product", storefront_url) | |
| except Exception as e: | |
| error_str = str(e) | |
| summary["shopify_error"] = error_str | |
| log_memory("ShopifyClient", "error", error_str) | |
| return summary | |