|
import axios from "axios"; |
|
const ENDPOINT = 'https://blackearthauction.com/Bard/api?req=' |
|
export const config = { |
|
"name" : "geminiweb", |
|
"url" : "/api/geminiweb", |
|
"description" : "Get response from Gemini AI. Gemini AI is a very powerful AI that can do a lot of things. It have access to real time internet! It can provide you with the latest news, weather, and more.", |
|
"query" : "prompt", |
|
"response" : "text", |
|
"testURL" : "./api/geminiweb?prompt=hello" |
|
} |
|
export default async function handler(req, res) { |
|
let prompt = req.query.prompt; |
|
let result = await axios.get(ENDPOINT + encodeURIComponent(prompt+' Tone of reply should be Professional')) |
|
console.log(result.data.response) |
|
|
|
result = result.data.response |
|
res.status(200).json({ |
|
reply: result |
|
}); |
|
|
|
|
|
} |
|
|