Carry OCR and missing-source warnings into analysis readiness

This commit is contained in:
2026-09-06 09:45:33 +03:00
parent 49965a2688
commit f073438922
12 changed files with 75 additions and 21 deletions
+3 -2
View File
@@ -59,12 +59,13 @@ export const AiSpecAnalyzerModal = () => {
try {
setProgress('Belge metni çıkarılıyor…');
const { extractText } = await import('../services/pdfText');
const { text, usedPages, pageCount } = await extractText(file);
const reading = await extractText(file);
const { text, usedPages, pageCount } = reading;
if (!text || text.length < 40) {
throw new Error('Belgeden metin çıkarılamadı. Taranmış (görüntü) PDF olabilir — metin tabanlı bir dosya deneyin.');
}
setProgress(`${usedPages}/${pageCount} sayfa okundu, ${derin ? 'derin analiz üretiliyor (1-2 dk sürebilir)…' : 'model analiz ediyor…'}`);
const r = await analyzeSpecPdfWithGemini({ text, fileName: file.name, tender: activeTenderDetail, mode: derin ? 'derin' : undefined });
const r = await analyzeSpecPdfWithGemini({ text, fileName: file.name, extraction:{ocr:reading.ocr,pageCount,usedPages,complete:reading.complete,fileName:file.name}, tender: activeTenderDetail, mode: derin ? 'derin' : undefined });
if (typeof r?.bidAnalysis?.recommendedBid === 'number') setCustomBid(r.bidAnalysis.recommendedBid);
confetti({ particleCount: 80, spread: 70 });
} catch (e) {