Skip to content

Commit

Permalink
Merge pull request #13 from mathanraj0601/feat/backend-validation
Browse files Browse the repository at this point in the history
Solve issue #3 : Added backend validation 
#3
  • Loading branch information
subh05sus authored Jan 3, 2024
2 parents d11c47a + 23bc615 commit b26e094
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY);
app.post("/userdata", async (req, res) => {
try {
const question = req.body.query;
if (!question || question.length === 0) {
return res.status(400).send("query is required provide a valid query");
}

async function main(ques) {
const model = genAI.getGenerativeModel({
Expand Down

0 comments on commit b26e094

Please sign in to comment.