basic groq commit here

This commit is contained in:
Copper 2024-06-18 17:56:04 -07:00 committed by GitHub
parent 1c5810b684
commit 52bb0e009e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

29
src/models/groq.js Normal file
View 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();