47 lines
1.8 KiB
JavaScript
47 lines
1.8 KiB
JavaScript
import { createServer } from 'node:http';
|
|
|
|
async function test() {
|
|
const LLM_ENDPOINT = 'https://api.minimax.io/v1';
|
|
const LLM_API_KEY = process.env.MINIMAX_API_KEY;
|
|
const LLM_MODEL = 'MiniMax-M3';
|
|
|
|
const resp = await fetch(LLM_ENDPOINT + '/chat/completions', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
Authorization: `Bearer ${LLM_API_KEY}`
|
|
},
|
|
body: JSON.stringify({
|
|
model: LLM_MODEL,
|
|
max_tokens: 120,
|
|
messages: [
|
|
{ role: 'system', content: `You are a Suno style-prompt generator with permission to break conventions.
|
|
|
|
Output ONE short Suno style description.
|
|
|
|
Requirements:
|
|
- DELIBERATELY combine genres, eras, or instruments that don't normally mix.
|
|
- If the user provides a music idea, use it as a jumping-off point for an
|
|
unexpected, surprising twist on that idea.
|
|
- The combination should still be parseable by Suno: use real instrument and
|
|
genre names, include a BPM, mention a vocal style.
|
|
- Comma-separated keywords. No sentences, no bullet points, no labels.
|
|
- Maximum 25 words.
|
|
- Output ONLY the style description line — no quotes, no commentary, no prefix,
|
|
no trailing punctuation.
|
|
|
|
Examples of the expected output (do NOT copy these verbatim):
|
|
- gregorian chant trap, deep male choir, sub 808s, 140 BPM, dark reverb
|
|
- baroque chamber orchestra meets dubstep, cellos, glitch drops, 160 BPM
|
|
- lo-fi mariachi breakcore, trumpets, chopped breaks, 90 BPM, vinyl crackle
|
|
- medieval lute and drum & bass, fingerpicked strings, reese bass, 174 BPM
|
|
- tuvan throat singing over tropical house, guttural vocals, marimba, 120 BPM` },
|
|
{ role: 'user', content: 'Generate one style description now.' }
|
|
]
|
|
})
|
|
});
|
|
const data = await resp.json();
|
|
console.log(JSON.stringify(data.choices?.[0]?.message?.content));
|
|
}
|
|
test().catch(console.error);
|