Fix generation JSON/Lyria errors, add Winamp player, and ship Echoes of the Sahel.
Harden DeepSeek JSON parsing with retry, pre-sanitize Lyria prompts, and instrumental fallback. Add pure HTML Winamp skin at /winamp with playlist export support. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+23
-1
@@ -79,10 +79,32 @@ def test_build_lyria_prompt_hindi_language(sample_plan):
|
||||
def test_sanitize_for_retry_softens_griot():
|
||||
raw = "West African griot vocal sample over dub"
|
||||
soft = _sanitize_for_retry(raw)
|
||||
assert "griot" not in soft.lower() or "Sahel" in soft
|
||||
assert "griot" not in soft.lower()
|
||||
assert soft != raw
|
||||
|
||||
|
||||
def test_sanitize_for_retry_softens_throat_singing():
|
||||
raw = "Mongolian overtone throat singing over dub bass"
|
||||
soft = _sanitize_for_retry(raw)
|
||||
assert "throat singing" not in soft.lower()
|
||||
assert "wordless" in soft.lower()
|
||||
|
||||
|
||||
def test_sanitize_for_retry_softens_anatolian():
|
||||
raw = "Anatolian saz and ney with dub delay"
|
||||
soft = _sanitize_for_retry(raw)
|
||||
assert "anatolian" not in soft.lower()
|
||||
|
||||
|
||||
def test_instrumental_fallback_strips_vocals():
|
||||
from ozan_radio.lyria import _instrumental_fallback
|
||||
|
||||
raw = "88 BPM dub.\nWordless male baritone hum layer.\nSub bass pulse."
|
||||
out = _instrumental_fallback(raw)
|
||||
assert "baritone" not in out.lower()
|
||||
assert "Instrumental only" in out
|
||||
|
||||
|
||||
def test_response_parts_from_candidates():
|
||||
part = SimpleNamespace(text=None, inline_data=SimpleNamespace(data=b"audio"))
|
||||
content = SimpleNamespace(parts=[part])
|
||||
|
||||
Reference in New Issue
Block a user