feat: scaffold FastAPI backend with ports-and-adapters layout
This commit is contained in:
parent
adcf4b9df6
commit
1f40d064ad
25 changed files with 973 additions and 22 deletions
12
backend/app/domain/profile.py
Normal file
12
backend/app/domain/profile.py
Normal 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])}."
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue