02ea026851
Remove spotify integration; add TASTE-FROM-SCREENSHOTS guide; ship Ozan settings.json and taste_seeds.json as Cursor examples plus new wandering dervish track. Co-authored-by: Cursor <cursoragent@cursor.com>
58 lines
1.5 KiB
Python
58 lines
1.5 KiB
Python
from __future__ import annotations
|
|
|
|
import argparse
|
|
import asyncio
|
|
|
|
import uvicorn
|
|
|
|
from ozan_radio.config import Config
|
|
from ozan_radio.dj import DeepSeekDJ
|
|
from ozan_radio.lyria import LyriaEngine
|
|
from ozan_radio.queue import RadioQueue
|
|
from ozan_radio.server import app
|
|
from ozan_radio.taste import load_taste_seeds
|
|
|
|
|
|
async def generate_one() -> None:
|
|
"""CLI: generate a single track and print the result."""
|
|
cfg = Config.from_env()
|
|
seeds = load_taste_seeds()
|
|
if seeds:
|
|
print(f"Taste seeds: {seeds.summary}\n")
|
|
else:
|
|
print("No taste_seeds.json — DJ uses settings.json only.\n")
|
|
|
|
q = RadioQueue(cfg.output_dir)
|
|
plan = await DeepSeekDJ(cfg).plan_next(q.recent_titles, seeds)
|
|
print(f"DJ: {plan.dj_line}")
|
|
print(f"Title: {plan.title}")
|
|
print(f"Prompt: {plan.lyria_prompt}\n")
|
|
print("Generating with Lyria 3…")
|
|
|
|
track = LyriaEngine(cfg).generate(plan)
|
|
q.add(track)
|
|
print(f"Saved: {track.audio_path}")
|
|
|
|
|
|
def main() -> None:
|
|
parser = argparse.ArgumentParser(description="Live Ozan Radio")
|
|
parser.add_argument(
|
|
"command",
|
|
nargs="?",
|
|
default="serve",
|
|
choices=["serve", "generate"],
|
|
help="serve = start radio server, generate = one-shot track",
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
if args.command == "generate":
|
|
asyncio.run(generate_one())
|
|
return
|
|
|
|
cfg = Config.from_env()
|
|
uvicorn.run(app, host=cfg.radio_host, port=cfg.radio_port, log_level="info")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|