mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-29 19:44:53 +02:00
30 lines
582 B
JavaScript
30 lines
582 B
JavaScript
![]() |
const Groq = require('groq-sdk');
|
||
|
|
||
|
const groq = new Groq();
|
||
|
async function main() {
|
||
|
const chatCompletion = await groq.chat.completions.create({
|
||
|
"messages": [
|
||
|
{
|
||
|
"role": "system",
|
||
|
"content": "i like grapes"
|
||
|
},
|
||
|
{
|
||
|
"role": "user",
|
||
|
"content": ""
|
||
|
}
|
||
|
],
|
||
|
"model": "mixtral-8x7b-32768",
|
||
|
"temperature": 0.85,
|
||
|
"max_tokens": 8192,
|
||
|
"top_p": 1,
|
||
|
"stream": true,
|
||
|
"stop": null
|
||
|
});
|
||
|
|
||
|
for await (const chunk of chatCompletion) {
|
||
|
process.stdout.write(chunk.choices[0]?.delta?.content || '');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
main();
|