Files
pod_trend_agent/scripts/test_real_jp.py
T
3218485270 f493bde8a9 POD 趋势感知 Agent:缓存热点模式 + 三图合成 + 热点去重/风格去重 + review 兜底
- 缓存热点批量流程(有采集缓存不触发 Google)
- 简报不足直接从采集缓存生成(轻量补齐)
- 三图合成(模特/印花/底图)+ 底图压缩 <2MB
- 热点去重→风格去重自动切换 + 不适合类目 review 兜底
- 透明背景(background=transparent)+ 提示词清洗(敏感词/背景描述)
- 任务前 basemap 校验 + 模板国家校验 + 模特任务级分配
2026-08-22 14:14:01 +08:00

33 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
"""真实 API 全链路验证:JP JPTM001 黑色 × 1oss 真上传)。"""
import json
import sys
from pathlib import Path
BASE = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(BASE))
import yaml
from graph.product_batch import run_product_batch
config = yaml.safe_load(open(BASE / "dist_v2" / "config.yaml", encoding="utf-8"))
config["seed_provider"] = "openai"
config["llm_screen"]["provider"] = "openai"
config["compose"]["backend"] = "openai"
config["product"]["backend"] = "openai"
config["oss"]["enabled"] = True
config["seed_shot"]["count"] = 1
print("使用配置: llm_model =", config["llm_screen"].get("model"), "| img_model =", config["compose"].get("model"))
out = run_product_batch("JP", config, BASE, BASE / "dist_v2",
[{"spu": "JPTM001", "skus": "JPTM001-BL01"}], 1, log_q=None)
print("\n=== 结果 ===")
prods = out.get("product") or []
print("产品数:", len(prods))
for r in prods:
print(f" {r.get('spu_code')} | {r.get('sku_code')} | design={bool(r.get('design_path'))} "
f"| composite={bool(r.get('composite_path'))} | en_title={bool(r.get('en_title'))} "
f"| ja_title={bool(r.get('ja_title'))} | oss_code={r.get('oss_code')}")
print(" URLs:", {k: v[:60] for k, v in r.items() if k.endswith("_url")})
print("errors:", [e.get("message", "")[:100] for e in out.get("errors") or []])