From fbedb0f2e38a86922c1bad22efa34b0d2b0df372 Mon Sep 17 00:00:00 2001 From: Luciano Sanchez Date: Mon, 20 Jul 2026 08:34:22 -0300 Subject: [PATCH] fix: route resume grading through AI Gateway to stop false 'future dates' flag (SIL-3430) The google() direct serving of gemini-2.5-flash intermittently flags past 'Present' start dates as being in the future, dragging excellent resumes down to grade C. The same model via the Vercel AI Gateway does not reproduce this (0 hallucinations across an isolated same-code A/B). Route grading through the gateway. Requires a paid AI_GATEWAY_API_KEY in prod. --- src/pages/api/grade.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/api/grade.ts b/src/pages/api/grade.ts index 8a6d125..7b5c150 100644 --- a/src/pages/api/grade.ts +++ b/src/pages/api/grade.ts @@ -5,7 +5,6 @@ import { ResponseSchema, sanitizeCompletion, } from "@/resume-checker/prompts/grade"; -import { google } from "@ai-sdk/google"; import { generateObject } from "ai"; import type { NextApiRequest, NextApiResponse } from "next"; import pdf from "pdf-parse"; @@ -54,7 +53,7 @@ export default async function handler( const parsed = await pdf(pdfBuffer); const completion = await generateObject({ - model: google("gemini-2.5-flash"), + model: "google/gemini-2.5-flash", temperature: 0, messages: messages(parsed, pdfBuffer), schema: ResponseSchema,