Carry OCR and missing-source warnings into analysis readiness
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user