no idea 0_0
All checks were successful
build-and-deploy / build-deploy (push) Successful in 31s

This commit is contained in:
androidlover5842
2026-01-31 02:19:23 +05:30
parent e0e7b63bf9
commit 607346905c

View File

@@ -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"])) {
results["vehicleNumber"] = llamaClient.ask(
imageUrl,
"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(
"hasAddress" to "POSTAL ADDRESS PRESENT? Answer YES or NO only.",
"hasDob" to "DOB? Reply YES or NO.",
@@ -261,24 +261,16 @@ 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 {
results["hasDrivingLicence"] = llamaClient.ask(
imageUrl,
"CONTAINS DRIVING LICENCE? Answer YES or NO only."
)
results["hasTransportDept"] = llamaClient.ask(
imageUrl,
"CONTAINS TRANSPORT DEPARTMENT? Answer YES or NO only."
)
val isDriving = isYes(results["hasDrivingLicence"]) || isYes(results["hasTransportDept"])
if (isDriving) {
results["hasDrivingLicence"] = llamaClient.ask(
imageUrl,
"CONTAINS DRIVING LICENCE? Answer YES or NO only."
)
results["hasTransportDept"] = llamaClient.ask(
imageUrl,
"CONTAINS TRANSPORT DEPARTMENT? Answer YES or NO only."
)
val isDriving = isYes(results["hasDrivingLicence"]) || isYes(results["hasTransportDept"])
if (isDriving) {
val drivingQuestions = linkedMapOf(
DocumentPrompts.NAME,
DocumentPrompts.DOB,
@@ -289,86 +281,86 @@ class GuestDocuments(
DocumentPrompts.GENDER,
DocumentPrompts.NATIONALITY
)
for ((key, question) in drivingQuestions) {
for ((key, question) in drivingQuestions) {
results[key] = llamaClient.ask(imageUrl, question)
}
} else {
results["hasElectionCommission"] = llamaClient.ask(
imageUrl,
"CONTAINS ELECTION COMMISSION OF INDIA? Answer YES or NO only."
)
if (isYes(results["hasElectionCommission"])) {
val voterQuestions = linkedMapOf(
DocumentPrompts.NAME,
DocumentPrompts.DOB,
"idNumber" to "VOTER ID NUMBER? Reply only number or NONE.",
DocumentPrompts.ADDRESS,
DocumentPrompts.PIN_CODE,
DocumentPrompts.CITY,
DocumentPrompts.GENDER,
DocumentPrompts.NATIONALITY
)
for ((key, question) in voterQuestions) {
results[key] = llamaClient.ask(imageUrl, question)
}
} else {
results["hasElectionCommission"] = llamaClient.ask(
results["hasIncomeTaxDept"] = llamaClient.ask(
imageUrl,
"CONTAINS ELECTION COMMISSION OF INDIA? Answer YES or NO only."
"CONTAINS INCOME TAX DEPARTMENT? Answer YES or NO only."
)
if (isYes(results["hasElectionCommission"])) {
val voterQuestions = linkedMapOf(
if (isYes(results["hasIncomeTaxDept"])) {
val panQuestions = linkedMapOf(
DocumentPrompts.NAME,
DocumentPrompts.DOB,
"idNumber" to "VOTER ID NUMBER? Reply only number or NONE.",
"idNumber" to "PAN NUMBER? Reply only number or NONE.",
DocumentPrompts.ADDRESS,
DocumentPrompts.PIN_CODE,
DocumentPrompts.CITY,
DocumentPrompts.GENDER,
DocumentPrompts.NATIONALITY
)
for ((key, question) in voterQuestions) {
for ((key, question) in panQuestions) {
results[key] = llamaClient.ask(imageUrl, question)
}
} else {
results["hasIncomeTaxDept"] = llamaClient.ask(
results["hasPassport"] = llamaClient.ask(
imageUrl,
"CONTAINS INCOME TAX DEPARTMENT? Answer YES or NO only."
"CONTAINS PASSPORT? Answer YES or NO only."
)
if (isYes(results["hasIncomeTaxDept"])) {
val panQuestions = linkedMapOf(
if (isYes(results["hasPassport"])) {
val passportQuestions = linkedMapOf(
DocumentPrompts.NAME,
DocumentPrompts.DOB,
"idNumber" to "PAN NUMBER? Reply only number or NONE.",
"idNumber" to "PASSPORT NUMBER? Reply only number or NONE.",
DocumentPrompts.ADDRESS,
DocumentPrompts.PIN_CODE,
DocumentPrompts.CITY,
DocumentPrompts.GENDER,
DocumentPrompts.NATIONALITY
)
for ((key, question) in panQuestions) {
for ((key, question) in passportQuestions) {
results[key] = llamaClient.ask(imageUrl, question)
}
} else {
results["hasPassport"] = llamaClient.ask(
imageUrl,
"CONTAINS PASSPORT? Answer YES or NO only."
val generalQuestions = linkedMapOf(
DocumentPrompts.NAME,
DocumentPrompts.DOB,
DocumentPrompts.ID_NUMBER,
DocumentPrompts.ADDRESS,
DocumentPrompts.VEHICLE_NUMBER,
DocumentPrompts.PIN_CODE,
DocumentPrompts.CITY,
DocumentPrompts.GENDER,
DocumentPrompts.NATIONALITY
)
if (isYes(results["hasPassport"])) {
val passportQuestions = linkedMapOf(
DocumentPrompts.NAME,
DocumentPrompts.DOB,
"idNumber" to "PASSPORT NUMBER? Reply only number or NONE.",
DocumentPrompts.ADDRESS,
DocumentPrompts.PIN_CODE,
DocumentPrompts.CITY,
DocumentPrompts.GENDER,
DocumentPrompts.NATIONALITY
)
for ((key, question) in passportQuestions) {
results[key] = llamaClient.ask(imageUrl, question)
}
} else {
val generalQuestions = linkedMapOf(
DocumentPrompts.NAME,
DocumentPrompts.DOB,
DocumentPrompts.ID_NUMBER,
DocumentPrompts.ADDRESS,
DocumentPrompts.VEHICLE_NUMBER,
DocumentPrompts.PIN_CODE,
DocumentPrompts.CITY,
DocumentPrompts.GENDER,
DocumentPrompts.NATIONALITY
)
for ((key, question) in generalQuestions) {
results[key] = llamaClient.ask(imageUrl, question)
}
for ((key, question) in generalQuestions) {
results[key] = llamaClient.ask(imageUrl, question)
}
}
}
}
}
}
results["docType"] = when {
isYes(results["hasCourt"]) ||
@@ -394,7 +386,7 @@ class GuestDocuments(
document.extractedAt = OffsetDateTime.now()
guestDocumentRepo.save(document)
guestDocumentEvents.emit(propertyId, guestId)
} }catch (_: Exception) {
} catch (_: Exception) {
// Keep upload successful even if AI extraction fails.
}
}