Spaces:
Sleeping
Sleeping
Download backend/src/modules/recommendations/recommendations.service.ts from kishankrish19/Chat: direct link, hf CLI and curl.
- Browser
- Download file 2.3 kB
-
https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/recommendations/recommendations.service.ts
- Command line
-
hf download hf://spaces/kishankrish19/Chat/backend/src/modules/recommendations/recommendations.service.ts
-
curl -L -o recommendations.service.ts https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/recommendations/recommendations.service.ts
2.3 kB
| import { Injectable } from '@nestjs/common'; | |
| () | |
| export class RecommendationsService { | |
| getHomeShelves(userId: string) { | |
| return { | |
| recently_played: [ | |
| { | |
| id: 'track-001', | |
| title: 'Singara Siriye', | |
| artist: 'Vijay Prakash', | |
| cover: | |
| 'https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?w=300', | |
| }, | |
| { | |
| id: 'track-002', | |
| title: 'Kesariya', | |
| artist: 'Arijit Singh', | |
| cover: | |
| 'https://images.unsplash.com/photo-1470225620780-dba8ba36b745?w=300', | |
| }, | |
| ], | |
| made_for_you: [ | |
| { | |
| id: 'mix-1', | |
| title: 'Discover Weekly', | |
| desc: 'Your weekly mix of fresh music.', | |
| cover: | |
| 'https://images.unsplash.com/photo-1518609878373-06d740f60d8b?w=400', | |
| }, | |
| { | |
| id: 'mix-2', | |
| title: 'Daily Mix 1', | |
| desc: 'Arijit Singh, Pritam', | |
| cover: | |
| 'https://images.unsplash.com/photo-1459749411175-04bf5292ceea?w=400', | |
| }, | |
| ], | |
| popular_albums: [ | |
| { | |
| id: 'alb-001', | |
| title: 'Kantara', | |
| artist: 'B. Ajaneesh Loknath', | |
| cover: | |
| 'https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?w=400', | |
| }, | |
| ], | |
| }; | |
| } | |
| getDiscoverWeekly(userId: string) { | |
| return { | |
| playlist_name: 'Discover Weekly', | |
| description: | |
| 'Your personalized mix generated using pgvector cosine similarity.', | |
| tracks: [ | |
| { | |
| id: 'track-003', | |
| title: 'Arabic Kuthu', | |
| artist: 'Anirudh Ravichander', | |
| }, | |
| { id: 'track-004', title: 'Naatu Naatu', artist: 'Rahul Sipligunj' }, | |
| ], | |
| }; | |
| } | |
| getRelatedTracks(trackId: string) { | |
| return [ | |
| { id: 'track-002', title: 'Kesariya', similarity_score: 0.94 }, | |
| { id: 'track-004', title: 'Naatu Naatu', similarity_score: 0.88 }, | |
| ]; | |
| } | |
| getRadio(userId: string, seedType: string, seedId: string) { | |
| return { | |
| seed_type: seedType, | |
| seed_id: seedId, | |
| radio_queue: [ | |
| { id: 'track-001', title: 'Singara Siriye' }, | |
| { id: 'track-003', title: 'Arabic Kuthu' }, | |
| { id: 'track-004', title: 'Naatu Naatu' }, | |
| ], | |
| }; | |
| } | |
| } | |