Compare commits

...

2 Commits

Author SHA1 Message Date
androidlover5842
52d4c5a167 Fix Aadhaar question branching logic
All checks were successful
build-and-deploy / build-deploy (push) Successful in 32s
2026-01-31 01:29:09 +05:30
androidlover5842
d09c25d678 doc: improve questions 2026-01-31 01:27:12 +05:30

View File

@@ -218,19 +218,36 @@ class GuestDocuments(
if (hasAadhar) {
val aadharQuestions = linkedMapOf(
"hasAddress" to "ADDRESS PRESENT? Answer YES or NO only.",
"hasGender" to "GENDER PRESENT? Answer YES or NO only.",
"name" to "NAME? Reply only the name or NONE.",
"dob" to "DOB? Reply only date or NONE.",
"idNumber" to "ID NUMBER? Reply only number or NONE.",
"address" to "ADDRESS? Reply only address or NONE.",
"pinCode" to "PIN CODE? Reply only pin or NONE.",
"city" to "CITY? Reply only city or NONE.",
"gender" to "GENDER? Reply only MALE/FEMALE/OTHER or NONE.",
"nationality" to "NATIONALITY? Reply only nationality or NONE."
"hasDob" to "DOB? Reply YES or NO.",
"hasGenderMentioned" to "GENDER MENTIONED? Reply YES or NO."
)
for ((key, question) in aadharQuestions) {
results[key] = llamaClient.ask(imageUrl, question)
}
val hasAddress = isYes(results["hasAddress"])
if (hasAddress) {
val addressQuestions = linkedMapOf(
"pinCode" to "POSTAL ADDRESS PIN CODE (6 digit)? Reply only pin or NONE.",
"address" to "POSTAL ADDRESS ONLY (street/area/city/state). Ignore IDs, UUIDs, and codes. Reply only address or NONE."
)
for ((key, question) in addressQuestions) {
results[key] = llamaClient.ask(imageUrl, question)
}
}
val hasDob = isYes(results["hasDob"])
val hasGender = isYes(results["hasGenderMentioned"])
if (hasDob && hasGender) {
val aadharFrontQuestions = linkedMapOf(
"name" to "NAME? Reply only the name or NONE.",
"dob" to "DOB? Reply only date or NONE.",
"idNumber" to "ID NUMBER? Reply only number or NONE.",
"gender" to "GENDER? Reply only MALE/FEMALE/OTHER or NONE."
)
for ((key, question) in aadharFrontQuestions) {
results[key] = llamaClient.ask(imageUrl, question)
}
}
} else {
val generalQuestions = linkedMapOf(
"hasTransportDept" to "CONTAINS TRANSPORT DEPARTMENT? Answer YES or NO only.",
@@ -310,7 +327,6 @@ class GuestDocuments(
null
}
}
}
data class GuestDocumentResponse(