diff --git a/config.py b/config.py index 79311ee..534ef7a 100644 --- a/config.py +++ b/config.py @@ -402,7 +402,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.713" +SYSTEM_VERSION = "V10.714" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/docs/AI_INTELLIGENCE_MODULE_SOT.md b/docs/AI_INTELLIGENCE_MODULE_SOT.md index 76e8c09..8b4a92b 100644 --- a/docs/AI_INTELLIGENCE_MODULE_SOT.md +++ b/docs/AI_INTELLIGENCE_MODULE_SOT.md @@ -2,7 +2,7 @@ > **最後更新**: 2026-06-26 (台北時間) > **狀態**: 🟢 四 AI Agent 自動化閉環已落地;LLM 路由紅線升級為 Ollama-first 三主機級聯;PChome 後台業績匯入韌性已補強;產品定位正名為「PChome 業績成長自動化作戰系統」;外部市場來源正規化層、自動同步、作戰清單與價格參考表優先讀取、CSV 備援預檢、前台操作入口、高可見頁面繁中化守門、比價/作戰 UI 工作台化、跨平台來源治理與商品身份 UI 契約已建立,GCP embedding 熔斷延後處理、110 proxy rescue 與 direct host health skip 已建立 -> **適用版本**: V10.713 +> **適用版本**: V10.714 --- @@ -798,3 +798,4 @@ POSTGRES_HOST=momo-db | 2026-06-26 | 前台不得用爬蟲當使用者主語 | V10.711 起 PChome、設定、舊入口、market intel 與任務確認文字統一使用「商品監控 / 資料擷取 / 監控來源」,不再把「爬蟲」當頁首、導覽、CTA 或提示主語;內部 route/key 可保留以降低部署風險。 | | 2026-06-26 | 匯入與設定頁不得回吐 raw 後端錯誤 | V10.712 起自動匯入與系統設定頁的未知錯誤 fallback 只顯示使用者可執行的下一步;Google Drive、格式、同步與資料處理異常可分類成營運文案,但不得把 SQL、snapshot、資料表欄位、driver error 或原始 exception 直接顯示在前台。 | | 2026-06-26 | 正式容器不得繼承互動式 Google Drive OAuth | V10.713 起 `momo-app`、`momo-scheduler`、`momo-telegram-bot` 的 `GOOGLE_DRIVE_ALLOW_INTERACTIVE_AUTH` 固定為 `false`,不再允許 `.env` 在主機重啟後把排程帶回瀏覽器 OAuth;人工授權只可用一次性腳本完成,正式匯入缺 token 時必須 fail-closed 並回可處理訊息。 | +| 2026-06-26 | AI 銷售建議商品區塊必須商品身份優先 | V10.714 起 `/ai_recommend` 熱銷商品參考改為商品卡,後端 bestseller API 回傳平台、商品 ID、賣場連結與圖片欄位;前端必須顯示縮圖、平台、商品 ID、價格與開賣場操作,缺圖/缺連結需顯示待補狀態,並把商品 ID / URL 帶入銷售建議上下文。 | diff --git a/services/momo_crawler.py b/services/momo_crawler.py index e3d2bac..f7f6509 100644 --- a/services/momo_crawler.py +++ b/services/momo_crawler.py @@ -773,11 +773,16 @@ def get_momo_bestsellers(category: str, limit: int = 5) -> Tuple[bool, str, List result = [] for p in products[:limit]: result.append({ + 'id': p.product_id, + 'product_id': p.product_id, + 'platform': 'momo', 'name': p.name, 'price': p.price, 'original_price': p.original_price, 'discount': p.discount, 'url': p.product_url, + 'product_url': p.product_url, + 'image_url': p.image_url, 'image': p.image_url }) return True, f"成功取得 {len(result)} 個熱銷商品", result diff --git a/services/pchome_crawler.py b/services/pchome_crawler.py index 6774926..bcd4f8a 100644 --- a/services/pchome_crawler.py +++ b/services/pchome_crawler.py @@ -563,11 +563,16 @@ def get_pchome_bestsellers(category: str, limit: int = 5) -> Tuple[bool, str, Li result = [] for p in products[:limit]: result.append({ + 'id': p.product_id, + 'product_id': p.product_id, + 'platform': 'pchome', 'name': p.name, 'price': p.price, 'original_price': p.original_price, 'discount': p.discount, 'url': p.product_url, + 'product_url': p.product_url, + 'image_url': p.image_url, 'image': p.image_url }) return True, f"成功取得 {len(result)} 個熱銷商品", result diff --git a/templates/ai_recommend.html b/templates/ai_recommend.html index c23878f..6f6f96d 100644 --- a/templates/ai_recommend.html +++ b/templates/ai_recommend.html @@ -61,7 +61,7 @@ @@ -277,14 +277,14 @@
熱銷商品參考
- 點選商品快速填入 + 商品 ID、圖片與賣場連結可一眼確認
- - + +