File size: 576 Bytes
772a227 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import got from 'got';
async function CohereAI(message) {
const response = await got.post('https://api.cohere.com/v1/chat', {
headers: {
'Authorization': 'Bearer ' + process.env['COHERE_API_KEY'],
'Content-Type': 'application/json'
},
json: {
"model": "command-r-08-2024",
'message': `${message}`,
"temperature": 0.3,
"chat_history": [],
"prompt_truncation": "AUTO",
"stream": false
}
}).json();
return response;
}
export { CohereAI }; |