Branch non-Aadhaar questions by document type
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:
@@ -217,7 +217,7 @@ class GuestDocuments(
|
|||||||
val hasAadhar = isYes(results["hasAadhar"]) || isYes(results["hasUidai"])
|
val hasAadhar = isYes(results["hasAadhar"]) || isYes(results["hasUidai"])
|
||||||
if (hasAadhar) {
|
if (hasAadhar) {
|
||||||
val aadharQuestions = linkedMapOf(
|
val aadharQuestions = linkedMapOf(
|
||||||
"hasAddress" to "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.",
|
||||||
"hasGenderMentioned" to "GENDER MENTIONED? Reply YES or NO."
|
"hasGenderMentioned" to "GENDER MENTIONED? Reply YES or NO."
|
||||||
)
|
)
|
||||||
@@ -249,7 +249,7 @@ class GuestDocuments(
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
val generalQuestions = linkedMapOf(
|
val detectionQuestions = linkedMapOf(
|
||||||
"hasTransportDept" to "CONTAINS TRANSPORT DEPARTMENT? Answer YES or NO only.",
|
"hasTransportDept" to "CONTAINS TRANSPORT DEPARTMENT? Answer YES or NO only.",
|
||||||
"hasIncomeTaxDept" to "CONTAINS INCOME TAX DEPARTMENT? Answer YES or NO only.",
|
"hasIncomeTaxDept" to "CONTAINS INCOME TAX DEPARTMENT? Answer YES or NO only.",
|
||||||
"hasElectionCommission" to "CONTAINS ELECTION COMMISSION OF INDIA? Answer YES or NO only.",
|
"hasElectionCommission" to "CONTAINS ELECTION COMMISSION OF INDIA? Answer YES or NO only.",
|
||||||
@@ -260,13 +260,76 @@ class GuestDocuments(
|
|||||||
"hasHighCourt" to "CONTAINS HIGH COURT? Answer YES or NO only.",
|
"hasHighCourt" to "CONTAINS HIGH COURT? Answer YES or NO only.",
|
||||||
"hasSupremeCourt" to "CONTAINS SUPREME COURT? Answer YES or NO only.",
|
"hasSupremeCourt" to "CONTAINS SUPREME COURT? Answer YES or NO only.",
|
||||||
"hasJudiciary" to "CONTAINS JUDICIARY? Answer YES or NO only.",
|
"hasJudiciary" to "CONTAINS JUDICIARY? Answer YES or NO only.",
|
||||||
"hasNationality" to "NATIONALITY PRESENT? Answer YES or NO only.",
|
"isVehiclePhoto" to "IS THIS A VEHICLE PHOTO? Answer YES or NO only."
|
||||||
|
)
|
||||||
|
for ((key, question) in detectionQuestions) {
|
||||||
|
results[key] = llamaClient.ask(imageUrl, question)
|
||||||
|
}
|
||||||
|
|
||||||
|
val isDriving = isYes(results["hasDrivingLicence"]) || isYes(results["hasTransportDept"])
|
||||||
|
if (isDriving) {
|
||||||
|
val drivingQuestions = linkedMapOf(
|
||||||
|
"name" to "NAME? Reply only the name or NONE.",
|
||||||
|
"dob" to "DOB? Reply only date or NONE.",
|
||||||
|
"idNumber" to "DL NUMBER? Reply only number or NONE.",
|
||||||
|
"address" to "POSTAL ADDRESS ONLY (street/area/city/state). Ignore IDs, UUIDs, and codes. 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."
|
||||||
|
)
|
||||||
|
for ((key, question) in drivingQuestions) {
|
||||||
|
results[key] = llamaClient.ask(imageUrl, question)
|
||||||
|
}
|
||||||
|
} else if (isYes(results["hasElectionCommission"])) {
|
||||||
|
val voterQuestions = linkedMapOf(
|
||||||
|
"name" to "NAME? Reply only the name or NONE.",
|
||||||
|
"dob" to "DOB? Reply only date or NONE.",
|
||||||
|
"idNumber" to "VOTER ID NUMBER? Reply only number or NONE.",
|
||||||
|
"address" to "POSTAL ADDRESS ONLY (street/area/city/state). Ignore IDs, UUIDs, and codes. 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."
|
||||||
|
)
|
||||||
|
for ((key, question) in voterQuestions) {
|
||||||
|
results[key] = llamaClient.ask(imageUrl, question)
|
||||||
|
}
|
||||||
|
} else if (isYes(results["hasIncomeTaxDept"])) {
|
||||||
|
val panQuestions = linkedMapOf(
|
||||||
|
"name" to "NAME? Reply only the name or NONE.",
|
||||||
|
"dob" to "DOB? Reply only date or NONE.",
|
||||||
|
"idNumber" to "PAN NUMBER? Reply only number or NONE.",
|
||||||
|
"address" to "POSTAL ADDRESS ONLY (street/area/city/state). Ignore IDs, UUIDs, and codes. 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."
|
||||||
|
)
|
||||||
|
for ((key, question) in panQuestions) {
|
||||||
|
results[key] = llamaClient.ask(imageUrl, question)
|
||||||
|
}
|
||||||
|
} else if (isYes(results["hasPassport"])) {
|
||||||
|
val passportQuestions = linkedMapOf(
|
||||||
|
"name" to "NAME? Reply only the name or NONE.",
|
||||||
|
"dob" to "DOB? Reply only date or NONE.",
|
||||||
|
"idNumber" to "PASSPORT NUMBER? Reply only number or NONE.",
|
||||||
|
"address" to "POSTAL ADDRESS ONLY (street/area/city/state). Ignore IDs, UUIDs, and codes. 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."
|
||||||
|
)
|
||||||
|
for ((key, question) in passportQuestions) {
|
||||||
|
results[key] = llamaClient.ask(imageUrl, question)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
val generalQuestions = linkedMapOf(
|
||||||
"name" to "NAME? Reply only the name or NONE.",
|
"name" to "NAME? Reply only the name or NONE.",
|
||||||
"dob" to "DOB? Reply only date or NONE.",
|
"dob" to "DOB? Reply only date or NONE.",
|
||||||
"idNumber" to "ID NUMBER? Reply only number or NONE.",
|
"idNumber" to "ID NUMBER? Reply only number or NONE.",
|
||||||
"address" to "ADDRESS? Reply only address or NONE.",
|
"address" to "POSTAL ADDRESS ONLY (street/area/city/state). Ignore IDs, UUIDs, and codes. Reply only address or NONE.",
|
||||||
"vehicleNumber" to "VEHICLE NUMBER? Reply only number or NONE.",
|
"vehicleNumber" to "VEHICLE NUMBER? Reply only number or NONE.",
|
||||||
"isVehiclePhoto" to "IS THIS A VEHICLE PHOTO? Answer YES or NO only.",
|
|
||||||
"pinCode" to "PIN CODE? Reply only pin or NONE.",
|
"pinCode" to "PIN CODE? Reply only pin or NONE.",
|
||||||
"city" to "CITY? Reply only city or NONE.",
|
"city" to "CITY? Reply only city or NONE.",
|
||||||
"gender" to "GENDER? Reply only MALE/FEMALE/OTHER or NONE.",
|
"gender" to "GENDER? Reply only MALE/FEMALE/OTHER or NONE.",
|
||||||
@@ -276,6 +339,7 @@ class GuestDocuments(
|
|||||||
results[key] = llamaClient.ask(imageUrl, question)
|
results[key] = llamaClient.ask(imageUrl, question)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
results["docType"] = when {
|
results["docType"] = when {
|
||||||
isYes(results["hasCourt"]) ||
|
isYes(results["hasCourt"]) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user