refactor: section the config and make prompts a module

This commit is contained in:
Justin Visser 2026-08-10 11:59:02 +02:00
parent 5c3ba8d6ec
commit e970bdf542
6 changed files with 205 additions and 44 deletions

View file

@ -5,6 +5,9 @@ from app.domain.models import CompressedTasteProfile, TasteProfile, Track
def compress_taste_profile(profile: TasteProfile) -> CompressedTasteProfile:
"""Build compact prompt text and the complete known track identifier set."""
# No genre section on purpose: Spotify deprecated the artist genres
# field for new apps, so there is no reliable genre source left in the
# API. Artist and track names are the genre evidence the model reads.
sections = (
_line("Short-term top artists", profile.short_term_artists),
_line("Long-term top artists", profile.long_term_artists),