team-4/backend/routes/get-new-suggest.ts
2025-08-02 13:28:10 +02:00

15 lines
471 B
TypeScript

import { searchSpotifyTracks } from "../spotify-api.ts";
import { GetNewSuggestInput, GetNewSuggestOutput } from "../types/api.ts";
import { generateVibes } from "../ai-suggestion.ts";
export async function getNewSuggestion(
params: GetNewSuggestInput,
): Promise<GetNewSuggestOutput> {
const ai_suggestion = await generateVibes(params);
const suggestionResults = await searchSpotifyTracks(
ai_suggestion.songs,
);
return { songs: suggestionResults };
}