Auto-Commit: 2026-06-13 15:16:41
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user