diff --git a/backend/app/api/endpoints/playlist_fix.py b/backend/app/api/endpoints/playlist_fix.py index 1771adb..fa48595 100644 --- a/backend/app/api/endpoints/playlist_fix.py +++ b/backend/app/api/endpoints/playlist_fix.py @@ -109,7 +109,7 @@ Return ONLY the JSON object.""" # Call Claude API client = anthropic.Anthropic(api_key=settings.ANTHROPIC_API_KEY) message = client.messages.create( - model="claude-haiku-4-5-20251001", + model="claude-sonnet-4-20250514", max_tokens=2000, messages=[{"role": "user", "content": prompt}], ) diff --git a/backend/app/api/endpoints/recommendations.py b/backend/app/api/endpoints/recommendations.py index 760a7d0..ea5d42d 100644 --- a/backend/app/api/endpoints/recommendations.py +++ b/backend/app/api/endpoints/recommendations.py @@ -127,7 +127,7 @@ Return ONLY the JSON object.""" client = anthropic.Anthropic(api_key=settings.ANTHROPIC_API_KEY) message = client.messages.create( - model="claude-haiku-4-5-20251001", + model="claude-sonnet-4-20250514", max_tokens=2000, messages=[{"role": "user", "content": prompt}], ) @@ -217,7 +217,7 @@ Return ONLY the JSON object.""" client = anthropic.Anthropic(api_key=settings.ANTHROPIC_API_KEY) message = client.messages.create( - model="claude-haiku-4-5-20251001", + model="claude-sonnet-4-20250514", max_tokens=2000, messages=[{"role": "user", "content": prompt}], ) @@ -313,7 +313,7 @@ Return ONLY the JSON object.""" client = anthropic.Anthropic(api_key=settings.ANTHROPIC_API_KEY) message = client.messages.create( - model="claude-haiku-4-5-20251001", + model="claude-sonnet-4-20250514", max_tokens=4000, messages=[{"role": "user", "content": prompt}], ) @@ -431,7 +431,7 @@ Only recommend real songs. Return ONLY the JSON array.""" client = anthropic.Anthropic(api_key=settings.ANTHROPIC_API_KEY) message = client.messages.create( - model="claude-haiku-4-5-20251001", + model="claude-sonnet-4-20250514", max_tokens=4000, messages=[{"role": "user", "content": prompt}], ) @@ -565,7 +565,7 @@ Only use real songs. Return ONLY the JSON.""" client = anthropic.Anthropic(api_key=settings.ANTHROPIC_API_KEY) message = client.messages.create( - model="claude-haiku-4-5-20251001", + model="claude-sonnet-4-20250514", max_tokens=4000, messages=[{"role": "user", "content": prompt}], ) diff --git a/backend/app/services/recommender.py b/backend/app/services/recommender.py index 5a464a1..4af5a8b 100644 --- a/backend/app/services/recommender.py +++ b/backend/app/services/recommender.py @@ -218,20 +218,22 @@ ALREADY RECOMMENDED BEFORE (do NOT repeat any of these — every recommendation {disliked_instruction} {exclude_instruction} -Respond with exactly {count} music recommendations as a JSON array. Only recommend songs that actually exist — do not invent or guess song titles. Each item should have: -- "title": song title -- "artist": artist name -- "album": album name (if known) +Respond with exactly {count} music recommendations as a JSON array. Each item should have: +- "title": the EXACT real song title as it appears on streaming platforms +- "artist": the EXACT real artist name +- "album": the real album name (if known) - "reason": A warm, personal 2-3 sentence explanation of WHY they'll love this track. Reference specific qualities from their taste profile. Be specific about sonic qualities, not generic. - "score": confidence score 0.0-1.0 +CRITICAL: Every song MUST be a real, verifiable song that exists on YouTube Music, Spotify, or Apple Music. Do NOT invent songs, guess titles, or combine wrong artists with wrong songs. If you are not 100% certain a song exists with that exact title by that exact artist, do NOT include it. It is better to recommend a well-known song you are certain about than to guess at an obscure one. + {focus_instruction} Return ONLY the JSON array, no other text.""" # Call Claude API client = anthropic.Anthropic(api_key=settings.ANTHROPIC_API_KEY) message = client.messages.create( - model="claude-haiku-4-5-20251001", + model="claude-sonnet-4-20250514", max_tokens=2000, messages=[{"role": "user", "content": prompt}], )