Spaces:
Sleeping
Sleeping
Download backend/src/modules/recommendations/recommendations.controller.ts from kishankrish19/Chat: direct link, hf CLI and curl.
- Browser
- Download file 1.58 kB
-
https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/recommendations/recommendations.controller.ts
- Command line
-
hf download hf://spaces/kishankrish19/Chat/backend/src/modules/recommendations/recommendations.controller.ts
-
curl -L -o recommendations.controller.ts https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/recommendations/recommendations.controller.ts
1.58 kB
| import { Controller, Get, Param, UseGuards, Req } from '@nestjs/common'; | |
| import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger'; | |
| import { RecommendationsService } from './recommendations.service'; | |
| import { JwtAuthGuard } from '../auth/jwt-auth.guard'; | |
| ('Recommendation Engine') | |
| ('me/recommendations') | |
| export class RecommendationsController { | |
| constructor(private readonly recsService: RecommendationsService) {} | |
| ('home') | |
| (JwtAuthGuard) | |
| () | |
| ({ | |
| summary: 'Home feed shelves: Recently Played, Made For You, Popular Albums', | |
| }) | |
| getHomeShelves(() req: any) { | |
| return this.recsService.getHomeShelves(req.user.userId); | |
| } | |
| ('discover-weekly') | |
| (JwtAuthGuard) | |
| () | |
| ({ | |
| summary: 'Weekly personalized mix generated via pgvector similarity', | |
| }) | |
| getDiscoverWeekly(() req: any) { | |
| return this.recsService.getDiscoverWeekly(req.user.userId); | |
| } | |
| ('tracks/:id/related') | |
| ({ summary: 'Related tracks (Fans also like) via pgvector' }) | |
| getRelatedTracks(('id') id: string) { | |
| return this.recsService.getRelatedTracks(id); | |
| } | |
| ('radio/:seedType/:seedId') | |
| (JwtAuthGuard) | |
| () | |
| ({ | |
| summary: 'Infinite radio queue seeded from a track, artist, or playlist', | |
| }) | |
| getRadio( | |
| () req: any, | |
| ('seedType') seedType: string, | |
| ('seedId') seedId: string, | |
| ) { | |
| return this.recsService.getRadio(req.user.userId, seedType, seedId); | |
| } | |
| } | |