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 }; |