ts-api / pages /api /mistral.js
Shuddho's picture
Upload 42 files
d04e364 verified
raw
history blame contribute delete
539 Bytes
import axios from "axios";
export const config = {
"name": "mistral",
"url": "/api/mistral",
"description": "Get response from Mistral AI Model. Mistral AI is a very powerful AI that can do a lot of things.",
"query": "prompt",
"response": "text",
"testURL": "./api/mistral?prompt=hello"
}
const {mistral} = require('@shuddho11288/mistral-api')
export default async function handler(req, res) {
const prompt = req.query.prompt;
const response = await mistral(prompt);
res.status(200).json({...response});
}