mirror of
https://github.com/thecyberlearn/quantumtaskai-caprover.git
synced 2026-08-18 08:52:57 +00:00
Fix groq initialization by using lazy loading
- Comment out global analyzer instance creation at import time - Create BrandPresenceAnalyzer only when analyze_brand_presence() is called - This prevents groq client initialization during Django import phase - Resolves TypeError with proxies argument on module import 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
332a61c060
commit
133b3f1d50
@ -191,8 +191,8 @@ IMPORTANT:
|
||||
}
|
||||
}
|
||||
|
||||
# Global analyzer instance
|
||||
analyzer = BrandPresenceAnalyzer()
|
||||
# Global analyzer instance - commented out to avoid import-time initialization
|
||||
# analyzer = BrandPresenceAnalyzer()
|
||||
|
||||
def analyze_brand_presence(brand_name: str, website_url: str) -> Dict[str, Any]:
|
||||
"""
|
||||
@ -205,4 +205,6 @@ def analyze_brand_presence(brand_name: str, website_url: str) -> Dict[str, Any]:
|
||||
Returns:
|
||||
Analysis results dictionary
|
||||
"""
|
||||
# Create analyzer instance when needed to avoid import-time initialization
|
||||
analyzer = BrandPresenceAnalyzer()
|
||||
return analyzer.analyze_brand_presence(brand_name, website_url)
|
||||
Loading…
Reference in New Issue
Block a user