mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-22 06:02:07 +02:00
basic groq commit here
This commit is contained in:
parent
1c5810b684
commit
52bb0e009e
1 changed files with 29 additions and 0 deletions
29
src/models/groq.js
Normal file
29
src/models/groq.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
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();
|
Loading…
Add table
Reference in a new issue