Skip to content

pull#11

Merged
indubrolk merged 3 commits into
indufrom
main
Jun 3, 2026
Merged

pull#11
indubrolk merged 3 commits into
indufrom
main

Conversation

@indubrolk

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 3, 2026 08:50
@netlify

netlify Bot commented Jun 3, 2026

Copy link
Copy Markdown

Deploy Preview for gpacal-cis ready!

Name Link
🔨 Latest commit 8db7ae2
🔍 Latest deploy log https://app.netlify.com/projects/gpacal-cis/deploys/6a1fead6abb9970008d007ad
😎 Deploy Preview https://deploy-preview-11--gpacal-cis.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@indubrolk indubrolk merged commit e7eaa89 into indu Jun 3, 2026
4 of 5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an optional Google Gemini-based PDF analysis path to the admin results “analyze” API, and updates the client-side PDF OCR hook to treat Gemini results as a successful “digital-like” parse when available. It also updates environment variable examples and cleans up a small README formatting artifact.

Changes:

  • Add a Gemini API (GEMINI_API_KEY) parsing attempt before the existing pdf-parse digital extraction fallback in /api/admin/results/analyze.
  • Update usePDFOCR to accept method: "gemini" as a successful server-side parse and reflect that in the progress message.
  • Document GEMINI_API_KEY in .env.example and remove an extra horizontal-rule line from README.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
README.md Removes an extra/errant separator line in the header area.
lib/hooks/usePDFOCR.ts Treats "gemini" as a successful analysis method and updates the success message.
app/api/admin/results/analyze/route.ts Adds Gemini API parsing path before pdf-parse, returning standardized results on success.
.env.example Adds GEMINI_API_KEY sample entry and related comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +98 to +103
const filteredResults = (parsedData.results || [])
.map((r: any) => ({
indexNumber: String(r.indexNumber).trim().toUpperCase(),
grade: String(r.grade).trim().toUpperCase(),
}))
.filter((r: any) => r.indexNumber && validGrades.has(r.grade));
Comment on lines +37 to +40
console.log("Attempting Gemini API PDF parsing...");
const base64Data = buffer.toString("base64");

const geminiUrl = `https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=${process.env.GEMINI_API_KEY}`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants