Remove OpenAI fallback
All checks were successful
build-and-deploy / build-deploy (push) Successful in 32s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 32s
This commit is contained in:
@@ -13,7 +13,6 @@ import org.slf4j.LoggerFactory
|
||||
@org.springframework.stereotype.Component
|
||||
class DocumentExtractionService(
|
||||
private val llamaClient: LlamaClient,
|
||||
private val openAIVisionClient: OpenAIVisionClient,
|
||||
private val guestRepo: GuestRepo,
|
||||
private val guestVehicleRepo: GuestVehicleRepo,
|
||||
private val propertyRepo: PropertyRepo
|
||||
@@ -297,20 +296,8 @@ class DocumentExtractionService(
|
||||
return
|
||||
}
|
||||
|
||||
logger.info("Aadhaar retry failed; using OpenAI fallback")
|
||||
val fallback = openAIVisionClient.extractAadhaarNumber(
|
||||
publicImageUrl,
|
||||
document.storagePath,
|
||||
document.contentType
|
||||
) ?: ""
|
||||
val fallbackNormalized = normalizeDigits(cleanedValue(fallback))
|
||||
if (fallbackNormalized != null && isValidAadhaar(fallbackNormalized)) {
|
||||
results[key] = formatAadhaar(fallbackNormalized)
|
||||
} else {
|
||||
val len = fallbackNormalized?.length ?: 0
|
||||
logger.warn("OpenAI fallback failed to produce valid Aadhaar (digits={})", len)
|
||||
results[key] = "NONE"
|
||||
}
|
||||
logger.warn("Aadhaar retry failed; setting idNumber=NONE")
|
||||
results[key] = "NONE"
|
||||
}
|
||||
|
||||
private fun applyGuestUpdates(
|
||||
|
||||
Reference in New Issue
Block a user