곡 스타일 전곡 고정 + 팀당 1곡만 노출

- 스타일은 레퍼런스 확정본(brass fanfare·drum corps·128bpm·live stadium)
  으로 고정, LLM 은 제목·가사만 작성
- Suno 생성 2트랙 중 첫 트랙만 API 노출

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jwkim 2026-08-25 10:23:51 +09:00
parent 3a5fc36ee8
commit dbc26a4150
2 changed files with 7 additions and 7 deletions

View File

@ -25,7 +25,8 @@ def _song_out(s: Song) -> dict:
"teamName": s.team_name,
"title": s.title,
"lyrics": s.lyrics,
"tracks": s.tracks or [],
# Suno 는 생성당 2트랙을 주지만 노출은 팀당 1곡만 (첫 트랙)
"tracks": (s.tracks or [])[:1],
}

View File

@ -30,11 +30,12 @@ KST = timezone(timedelta(hours=9))
MAX_ATTEMPTS = 3
GENERATE_TIMEOUT_MIN = 30 # Suno 작업이 이 시간 넘게 미완이면 실패 처리
# 스타일 폴백 — LLM 이 style 을 못 주면 이 기본값 사용 (야구장 웅장 앤섬 컨셉)
# 곡 스타일 — 전 곡 고정 (야구장 웅장 앤섬 컨셉, 레퍼런스 확정본).
# LLM 은 가사·제목만 쓰고 스타일은 변주하지 않는다.
DEFAULT_STYLE = (
"Korean baseball stadium cheer anthem, powerful brass fanfare, thumping "
"drum corps, group chant call-and-response, gang vocals, energetic crowd "
"shouting, 128bpm, live stadium atmosphere"
"drum corps, group chant call-and-response, gang vocals, energetic male "
"crowd shouting, 128bpm, live stadium atmosphere"
)
# LLM 에게 주는 형식 레퍼런스 (가사 구조·스타일 문구의 톤)
@ -355,8 +356,6 @@ def _lyrics_prompt(team_name: str, context: str, league: str = "kbo") -> str:
f"[가사 형식 레퍼런스 — 구조와 톤만 참고, 내용은 오늘 경기에 맞게 새로 쓸 것]\n{_REFERENCE}\n\n"
"다음 키를 가진 JSON 객체 하나만 출력하라:\n"
' "title": 곡 제목 (한국어, 25자 이내, 오늘 경기 느낌이 나게),\n'
' "style": 음악 생성기용 영어 스타일 설명 한 줄 — 예: '
f'"{DEFAULT_STYLE}" 처럼 웅장한 야구장 앤섬 계열로, 곡마다 악기·bpm 등을 변주,\n'
' "lyrics": 위 형식의 전체 가사\n'
)
@ -429,7 +428,7 @@ async def _start_one(db, m: Match, side: str, lineups: dict | None) -> bool:
piece = await write_lyrics(name, context, m.league)
title = str(piece.get("title") or f"{name} 오늘의 응원가").strip()[:40]
style = str(piece.get("style") or DEFAULT_STYLE).strip()
style = DEFAULT_STYLE # 전 곡 고정 스타일 — LLM 변주 없음
lyrics = str(piece.get("lyrics") or "").strip()
if not lyrics:
raise RuntimeError("LLM 가사 비어있음")