diff --git a/test_minimax.mjs b/test_minimax.mjs new file mode 100644 index 0000000..049223a --- /dev/null +++ b/test_minimax.mjs @@ -0,0 +1,26 @@ +import { createServer } from 'node:http'; + +async function test() { + const LLM_ENDPOINT = 'https://api.minimax.io/v1'; + const LLM_API_KEY = 'sk-cp-UKWMS27cNQjuDxfHa14CsYKS1Q60ptZLhTtZYcB8iKgWJz9-C6st7jgmAsW7VTWQi83igf6mpc-6aIkt29wwWG_oCBYN0jITGAb06BA-MPjJgUEx7awu7zQ'; + 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.' }, + { 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); diff --git a/test_minimax_crazy.mjs b/test_minimax_crazy.mjs new file mode 100644 index 0000000..8d3998e --- /dev/null +++ b/test_minimax_crazy.mjs @@ -0,0 +1,46 @@ +import { createServer } from 'node:http'; + +async function test() { + const LLM_ENDPOINT = 'https://api.minimax.io/v1'; + const LLM_API_KEY = 'sk-cp-UKWMS27cNQjuDxfHa14CsYKS1Q60ptZLhTtZYcB8iKgWJz9-C6st7jgmAsW7VTWQi83igf6mpc-6aIkt29wwWG_oCBYN0jITGAb06BA-MPjJgUEx7awu7zQ'; + 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);