Add settings.json taste profile — ethnic world dubtronica.

DJ and chat read listener preferences from settings.json on every request.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-07 14:19:38 +01:00
parent b8ff25f370
commit feb8731366
6 changed files with 144 additions and 8 deletions
+15 -4
View File
@@ -8,6 +8,7 @@ import httpx
from ozan_radio.config import Config
from ozan_radio.spotify import TasteProfile
from ozan_radio.settings import ListenerSettings, load_settings
from ozan_radio.taste import TasteSeeds
CHAT_SYSTEM = """You are the on-air DJ for Live Ozan Radio. Chat with the listener in a warm,
@@ -32,8 +33,8 @@ Your job:
2. Pick a mood, tempo, and genre blend that feels like a natural next track.
3. Write a Lyria prompt that produces a 12 minute instrumental or vocal track.
4. Keep variety — don't repeat the same vibe twice in a row.
5. Favor warm, groove-forward, slightly eclectic picks (Ozan's lane).
6. West African / Sahel / desert blues / griot energy is on-brand (think Baaba Maal warmth).
5. Follow settings.json taste profile when provided — it overrides generic defaults.
6. Stay in the listener's lane unless they ask for something else in chat.
Respond with JSON only:
{
@@ -66,6 +67,12 @@ class DeepSeekDJ:
def __init__(self, config: Config) -> None:
self._config = config
self._settings = load_settings()
def _taste_block(self) -> str:
if self._settings:
return self._settings.dj_context()
return "No settings.json — freestyle eclectic world groove."
async def _completion(self, messages: list[dict], *, json_mode: bool = False) -> str:
self._config.require_deepseek()
@@ -98,7 +105,8 @@ class DeepSeekDJ:
if now_playing:
context.append(f"Currently playing: {now_playing}")
messages = [{"role": "system", "content": CHAT_SYSTEM}]
chat_system = f"{CHAT_SYSTEM}\n\nStation taste:\n{self._taste_block()}"
messages = [{"role": "system", "content": chat_system}]
for turn in history[-8:]:
role = "assistant" if turn["role"] == "dj" else turn["role"]
messages.append({"role": role, "content": turn["content"]})
@@ -120,7 +128,10 @@ class DeepSeekDJ:
) -> TrackPlan:
self._config.require_deepseek()
user_parts = ["Plan the next generated track for Live Ozan Radio."]
user_parts = [
"Plan the next generated track for Live Ozan Radio.",
f"Station taste:\n{self._taste_block()}",
]
if taste:
user_parts.append(f"Spotify taste: {taste.summary}")
if taste.top_genres: