This commit is contained in:
@@ -218,16 +218,16 @@ class GuestDocuments(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
results["hasAadhar"] = llamaClient.ask(imageUrl, "CONTAINS AADHAAR? Answer YES or NO only.")
|
|
||||||
results["hasUidai"] = llamaClient.ask(imageUrl, "CONTAINS UIDAI? Answer YES or NO only.")
|
|
||||||
val hasAadhar = isYes(results["hasAadhar"]) || isYes(results["hasUidai"])
|
|
||||||
if (isYes(results["isVehiclePhoto"])) {
|
if (isYes(results["isVehiclePhoto"])) {
|
||||||
results["vehicleNumber"] = llamaClient.ask(
|
results["vehicleNumber"] = llamaClient.ask(
|
||||||
imageUrl,
|
imageUrl,
|
||||||
"VEHICLE NUMBER PLATE? Reply only number or NONE."
|
"VEHICLE NUMBER PLATE? Reply only number or NONE."
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
else if (hasAadhar) {
|
results["hasAadhar"] = llamaClient.ask(imageUrl, "CONTAINS AADHAAR? Answer YES or NO only.")
|
||||||
|
results["hasUidai"] = llamaClient.ask(imageUrl, "CONTAINS UIDAI? Answer YES or NO only.")
|
||||||
|
val hasAadhar = isYes(results["hasAadhar"]) || isYes(results["hasUidai"])
|
||||||
|
if (hasAadhar) {
|
||||||
val aadharQuestions = linkedMapOf(
|
val aadharQuestions = linkedMapOf(
|
||||||
"hasAddress" to "POSTAL ADDRESS PRESENT? Answer YES or NO only.",
|
"hasAddress" to "POSTAL ADDRESS PRESENT? Answer YES or NO only.",
|
||||||
"hasDob" to "DOB? Reply YES or NO.",
|
"hasDob" to "DOB? Reply YES or NO.",
|
||||||
@@ -260,14 +260,6 @@ class GuestDocuments(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
if (isYes(results["isVehiclePhoto"])) {
|
|
||||||
val vehicleQuestions = linkedMapOf(
|
|
||||||
"vehicleNumber" to "VEHICLE NUMBER PLATE? Reply only number or NONE."
|
|
||||||
)
|
|
||||||
for ((key, question) in vehicleQuestions) {
|
|
||||||
results[key] = llamaClient.ask(imageUrl, question)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
results["hasDrivingLicence"] = llamaClient.ask(
|
results["hasDrivingLicence"] = llamaClient.ask(
|
||||||
imageUrl,
|
imageUrl,
|
||||||
@@ -394,7 +386,7 @@ class GuestDocuments(
|
|||||||
document.extractedAt = OffsetDateTime.now()
|
document.extractedAt = OffsetDateTime.now()
|
||||||
guestDocumentRepo.save(document)
|
guestDocumentRepo.save(document)
|
||||||
guestDocumentEvents.emit(propertyId, guestId)
|
guestDocumentEvents.emit(propertyId, guestId)
|
||||||
} }catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
// Keep upload successful even if AI extraction fails.
|
// Keep upload successful even if AI extraction fails.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user