feat(gtm): upgrade to google-genai, fix image gen & frontend crash

This commit is contained in:
2026-01-04 16:02:23 +00:00
parent bba45d83e0
commit c3c5773ecc
242 changed files with 6075 additions and 448 deletions

View File

@@ -54,15 +54,16 @@ The application will be available at `http://localhost:8080`.
## Current Status (Jan 2026) - GTM Architect & Core Updates
* **GTM Architect Fixed & Stabilized:** The "GTM Architect" service is now fully operational.
* **Prompt Engineering:** Switched from fragile f-strings to robust `"\n".join([...])` list construction for all system prompts. This eliminates syntax errors caused by mixed quotes and multi-line strings in Python.
* **AI Backend:** Migrated to `google.generativeai` via `helpers.call_gemini_flash` with JSON mode support.
* **Scraping:** Implemented robust URL scraping using `requests` and `BeautifulSoup` (with `html.parser` to avoid dependency issues).
* **Docker:** Container (`gtm-app`) updated with correct volume mounts for logs and config.
* **Market Intelligence Fixed:** Added `google-generativeai` to `market-intel.requirements.txt`. This was necessary because `helpers.py` (which is shared) now relies on this library for all AI operations.
* **Gemini Migration:** The codebase is moving towards `google-generativeai` as the primary driver. `helpers.py` now supports this natively.
* **Deployment:** To apply these fixes, a rebuild of the `gtm-app` container is required. A rebuild of `market-backend` is also required to pick up the new dependency.
* **GTM Architect (v2.2) - FULLY OPERATIONAL:**
* **Image Generation Fixed:** Successfully implemented a hybrid image generation pipeline.
* **Text-to-Image:** Uses `imagen-4.0-generate-001` for generic scenes.
* **Image-to-Image:** Uses `gemini-2.5-flash-image` with reference image upload for product-consistent visuals.
* **Prompt Engineering:** Strict prompts ensure the product design remains unaltered.
* **Library Upgrade:** Migrated core AI logic to `google-genai` (v1.x) to resolve deprecation warnings and access newer models. `Pillow` added for image processing.
* **Model Update:** Switched text generation to `gemini-2.0-flash` due to regional unavailability of 1.5.
* **Frontend Stability:** Fixed a critical React crash in Phase 3 by handling object-based role descriptions robustly.
* **Infrastructure:** Updated Docker configurations (`gtm-architect/requirements.txt`) to support new dependencies.
## Next Steps
* **Monitor Logs:** Check `Log_from_docker/` for detailed execution traces of the GTM Architect.
* **Feedback Loop:** Verify the quality of the generated GTM strategies and adjust prompts in `gtm_architect_orchestrator.py` if necessary.
* **Feedback Loop:** Verify the quality of the generated GTM strategies and adjust prompts in `gtm_architect_orchestrator.py` if necessary.