Files
beige/backend/alembic/versions/021_text_candidate_strategy.py
yangqianqian ff21116ff8 A8: 文案按A/B/C三套正交叙事生成,避免套路化重复
- constants: 新增 TEXT_NARRATIVE_BY_STRATEGY(A痛点/B场景/C成分),与图片侧同轴
- build_prompt: 加 strategy_narrative 参数并注入 prompt
- text_variants: 全链路透传(含优化轮)
- run_text_generation: 改循环三套,text_count均摊(divmod余前补),跨套去重,打_strategy标记
- TextCandidate: 加 strategy String(4) 字段 + 迁移021(已upgrade head)
- packaging: 打包按strategy精准配对文图(texts_by_strategy映射+三层兜底)
- SSE text_candidate 事件携带 strategy

独立agent交叉验证7改造点全过,边界(text_count<3/无别名/不截断)无must-fix

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 10:00:47 +08:00

31 lines
961 B
Python
Raw Permalink 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.
"""021 text_candidates 表加 strategy 正交叙事套字段A8 三套不同角度文案)
Revision ID: 021
Revises: 020
Create Date: 2026-06-18
A8(倩倩姐2026-06-18拍板「方向对按这个写」):文案按 A/B/C 三套正交叙事
分别生成(A痛点先行/B场景先行/C成分背书先行),与图片侧 strategy 同轴。
text_candidates 加 strategy 字段记录每条属哪套,供前端分组展示 + 打包按套精准
匹配文图(不再靠脆弱 idx 对应)。旧数据 strategy=NULL 不影响展示。
"""
from alembic import op
import sqlalchemy as sa
revision = "021"
down_revision = "020"
branch_labels = None
depends_on = None
def upgrade():
op.add_column(
"text_candidates",
sa.Column("strategy", sa.String(length=4), nullable=True,
comment="A/B/C 正交叙事套(A痛点/B场景/C成分),与图片侧同轴"),
)
def downgrade():
op.drop_column("text_candidates", "strategy")