const { Chatbot, LLamaReplicateInput, SupportedChatModels } = require('intellinode'); | |
app.get('/llama/replica', async (req, res) => { | |
const chatbot = new Chatbot(process.env.REPLICATE_API_KEY, SupportedChatModels.REPLICATE); | |
const system = 'You are a helpful assistant.'; | |
const input = new LLamaReplicateInput(system); | |
input.addUserMessage(req.query.message); | |
const response = await chatbot.chat(input); | |
res.json({ response }); | |
}); |