Spaces:
Running
Running
SP3 generative song cards
Browse files
arc.py
CHANGED
|
@@ -350,6 +350,31 @@ def build_fragment_prompt() -> str:
|
|
| 350 |
return "\n\n".join([_FRAGMENT_PERSONA, _output_contract_block()])
|
| 351 |
|
| 352 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 353 |
# ---------------------------------------------------------------------------
|
| 354 |
# Trigger detection (server-side, no model). Advances the meter.
|
| 355 |
# ---------------------------------------------------------------------------
|
|
|
|
| 350 |
return "\n\n".join([_FRAGMENT_PERSONA, _output_contract_block()])
|
| 351 |
|
| 352 |
|
| 353 |
+
# ---------------------------------------------------------------------------
|
| 354 |
+
# Generative song card (SP3): the model writes only the creative title+artist
|
| 355 |
+
# into the JSON text field; the server assigns the (valid) musical params.
|
| 356 |
+
# ---------------------------------------------------------------------------
|
| 357 |
+
_SONG_CARD_PERSONA = (
|
| 358 |
+
"You are the music director of a 1970s late-night radio station, inventing FICTIONAL "
|
| 359 |
+
"records. Titles are evocative and a little melancholy; artists are fictional bands or "
|
| 360 |
+
"singers. Never use a real song or a real artist."
|
| 361 |
+
)
|
| 362 |
+
|
| 363 |
+
|
| 364 |
+
def build_song_card_prompt() -> str:
|
| 365 |
+
"""Card-specific contract: the `text` field carries '<title> by <artist>'."""
|
| 366 |
+
moods = ", ".join(MOODS)
|
| 367 |
+
return (
|
| 368 |
+
_SONG_CARD_PERSONA + "\n\n"
|
| 369 |
+
"Respond with ONE JSON object and nothing else, with exactly these keys:\n"
|
| 370 |
+
' "text": the record as "<title> by <artist>" -- nothing else, no quotes, no labels.\n'
|
| 371 |
+
' "mood": one of [' + moods + "].\n"
|
| 372 |
+
' "arc_cue": "none".\n'
|
| 373 |
+
'Example: {"text": "Tail Lights in the Rain by The Sleeping Overpass", '
|
| 374 |
+
'"mood": "nostalgic", "arc_cue": "none"}'
|
| 375 |
+
)
|
| 376 |
+
|
| 377 |
+
|
| 378 |
# ---------------------------------------------------------------------------
|
| 379 |
# Trigger detection (server-side, no model). Advances the meter.
|
| 380 |
# ---------------------------------------------------------------------------
|