feat(competitor-analysis): Fix 404, SDK compatibility, and update docs
Resolved multiple issues preventing the 'competitor-analysis' app from running and serving its frontend:
1. **Fixed Python SyntaxError in Prompts:** Corrected unterminated string literals and ensure proper multi-line string formatting (using .format() instead of f-strings for complex prompts) in .
2. **Addressed Python SDK Compatibility (google-generativeai==0.3.0):**
* Removed for and by adapting the orchestrator to pass JSON schemas as direct Python dictionaries, as required by the older SDK version.
* Updated with detailed guidance on handling / imports and dictionary-based schema definitions for older SDKs.
3. **Corrected Frontend Build Dependencies:** Moved critical build dependencies (like , , ) from to in .
* Updated to include this pitfall, ensuring frontend build tools are installed in Docker.
4. **Updated Documentation:**
* : Added comprehensive lessons learned regarding dependencies, Python SDK versioning (specifically and imports for ), and robust multi-line prompt handling.
* : Integrated specific details of the encountered errors and their solutions, making the migration report a more complete historical record and guide.
These changes collectively fix the 404 error by ensuring the Python backend starts correctly and serves the frontend assets after a successful build.
This commit is contained in:
@@ -16,7 +16,8 @@ services:
|
||||
- dashboard
|
||||
- b2b-app
|
||||
- market-frontend
|
||||
- company-explorer # NEW
|
||||
- company-explorer
|
||||
- competitor-analysis
|
||||
|
||||
# --- DASHBOARD (Landing Page) ---
|
||||
dashboard:
|
||||
@@ -128,6 +129,23 @@ services:
|
||||
- PYTHONUNBUFFERED=1
|
||||
- DB_PATH=/app/gtm_projects.db
|
||||
|
||||
# --- COMPETITOR ANALYSIS AGENT ---
|
||||
competitor-analysis:
|
||||
build:
|
||||
context: ./competitor-analysis-app
|
||||
dockerfile: Dockerfile
|
||||
container_name: competitor-analysis
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
# Sideloading: Python Orchestrator
|
||||
- ./competitor-analysis-app/competitor_analysis_orchestrator.py:/app/competitor_analysis_orchestrator.py
|
||||
# Keys (passed via environment or file)
|
||||
- ./gemini_api_key.txt:/app/gemini_api_key.txt
|
||||
environment:
|
||||
- PYTHONUNBUFFERED=1
|
||||
- GEMINI_API_KEY_FILE=/app/gemini_api_key.txt
|
||||
# Port 8000 is internal only
|
||||
|
||||
# --- DUCKDNS UPDATER ---
|
||||
duckdns:
|
||||
image: lscr.io/linuxserver/duckdns:latest
|
||||
|
||||
Reference in New Issue
Block a user