|
import got from 'got'; |
|
|
|
async function NvidiaTogether(message) { |
|
const response = await got.post('https://api.together.xyz/v1/chat/completions', { |
|
headers: { |
|
'Authorization': 'Bearer ' + process.env['TOGETHER_API_KEY'], |
|
'Content-Type': 'application/json' |
|
}, |
|
json: { |
|
'model': 'nvidia/Llama-3.1-Nemotron-70B-Instruct-HF', |
|
'messages': [{'role': 'user', 'content': `${message}`}], |
|
'max_tokens': null, |
|
'temperature': 0.7, |
|
'top_p': 0.7, |
|
'top_k': 50, |
|
'repetition_penalty': 1, |
|
'stream': false |
|
} |
|
}); |
|
return await response.json(); |
|
} |