// When copying the code to the same file, ensure removing the repeated imports | |
const { Chatbot, LLamaSageInput, SupportedChatModels } = require('intellinode'); | |
app.get('/llama/aws', async (req, res) => { | |
const chatbot = new Chatbot(null, SupportedChatModels.SAGEMAKER, {url: process.env.AWS_API_URL}); | |
const system = 'You are a helpful assistant.'; | |
const input = new LLamaSageInput(system); | |
input.addUserMessage(req.query.message); | |
const response = await chatbot.chat(input); | |
res.json({ response }); | |
}); |