feat: scaffold FastAPI backend with ports-and-adapters layout

This commit is contained in:
Justin Visser 2026-08-09 20:58:10 +02:00
parent adcf4b9df6
commit 1f40d064ad
25 changed files with 973 additions and 22 deletions

View file

@ -0,0 +1,12 @@
"""Taste-profile compression: raw listening data to a prompt-sized summary."""
from app.domain.models import TasteProfile
def compress_taste_profile(profile: TasteProfile, artist_limit: int = 15) -> str:
"""Render a profile as compact prompt text, bounded in size."""
return (
f"Top artists (long term): {', '.join(profile.top_artists_long_term[:artist_limit])}. "
f"Top artists (recent): {', '.join(profile.top_artists_short_term[:artist_limit])}. "
f"Recent favourite tracks: {', '.join(profile.top_tracks_short_term[:artist_limit])}."
)