From c506b1da768049936546100dbc3ac2875b470139 Mon Sep 17 00:00:00 2001 From: ajaysi Date: Sat, 11 Oct 2025 17:59:46 +0530 Subject: [PATCH] Fix Step 3 router 404 and EXA_API_KEY deployment blocker - Move Step 3 router from optional to core routers in router_manager.py - Add direct import of step3_routes in app.py for visibility - Make ExaService initialization optional to prevent deployment failures - Fix 404 error on /api/onboarding/step3/discover-competitors endpoint --- backend/services/research/exa_service.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/backend/services/research/exa_service.py b/backend/services/research/exa_service.py index 8f7b2bb5..a0adaa5d 100644 --- a/backend/services/research/exa_service.py +++ b/backend/services/research/exa_service.py @@ -41,13 +41,19 @@ class ExaService: def __init__(self): """Initialize the Exa Service with API credentials.""" self.api_key = os.getenv("EXA_API_KEY") + self.exa = None + self.enabled = False if not self.api_key: - raise ValueError("Exa API key not configured. Please set EXA_API_KEY environment variable.") + logger.warning("EXA_API_KEY not configured; Exa service will be disabled") else: - self.exa = Exa(api_key=self.api_key) - self.enabled = True - logger.info("Exa Service initialized successfully") + try: + self.exa = Exa(api_key=self.api_key) + self.enabled = True + logger.info("Exa Service initialized successfully") + except Exception as e: + logger.error(f"Failed to initialize Exa service: {e}") + self.enabled = False async def discover_competitors( self,