Compare commits
2 Commits
3d1bf64790
...
52d4c5a167
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52d4c5a167 | ||
|
|
d09c25d678 |
@@ -218,19 +218,36 @@ class GuestDocuments(
|
|||||||
if (hasAadhar) {
|
if (hasAadhar) {
|
||||||
val aadharQuestions = linkedMapOf(
|
val aadharQuestions = linkedMapOf(
|
||||||
"hasAddress" to "ADDRESS PRESENT? Answer YES or NO only.",
|
"hasAddress" to "ADDRESS PRESENT? Answer YES or NO only.",
|
||||||
"hasGender" to "GENDER PRESENT? Answer YES or NO only.",
|
"hasDob" to "DOB? Reply YES or NO.",
|
||||||
"name" to "NAME? Reply only the name or NONE.",
|
"hasGenderMentioned" to "GENDER MENTIONED? Reply YES or NO."
|
||||||
"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."
|
|
||||||
)
|
)
|
||||||
for ((key, question) in aadharQuestions) {
|
for ((key, question) in aadharQuestions) {
|
||||||
results[key] = llamaClient.ask(imageUrl, question)
|
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 {
|
} else {
|
||||||
val generalQuestions = linkedMapOf(
|
val generalQuestions = linkedMapOf(
|
||||||
"hasTransportDept" to "CONTAINS TRANSPORT DEPARTMENT? Answer YES or NO only.",
|
"hasTransportDept" to "CONTAINS TRANSPORT DEPARTMENT? Answer YES or NO only.",
|
||||||
@@ -310,7 +327,6 @@ class GuestDocuments(
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data class GuestDocumentResponse(
|
data class GuestDocumentResponse(
|
||||||
|
|||||||
Reference in New Issue
Block a user