Refactor guest doc AI questions
All checks were successful
build-and-deploy / build-deploy (push) Successful in 31s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 31s
This commit is contained in:
@@ -211,32 +211,37 @@ class GuestDocuments(
|
||||
val imageUrl =
|
||||
"${aiBaseUrl}/properties/$propertyId/guests/$guestId/documents/${document.id}/file?token=$token"
|
||||
|
||||
val questions = linkedMapOf(
|
||||
"hasAadhar" to "CONTAINS AADHAAR? Answer YES or NO only.",
|
||||
"hasUidai" to "CONTAINS UIDAI? 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.",
|
||||
"hasElectionCommission" to "CONTAINS ELECTION COMMISSION OF INDIA? Answer YES or NO only.",
|
||||
"hasDrivingLicence" to "CONTAINS DRIVING LICENCE? Answer YES or NO only.",
|
||||
"hasPassport" to "CONTAINS PASSPORT? Answer YES or NO only.",
|
||||
"hasPolice" to "CONTAINS POLICE? Answer YES or NO only.",
|
||||
"hasCourt" to "CONTAINS 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.",
|
||||
"hasJudiciary" to "CONTAINS JUDICIARY? Answer YES or NO only.",
|
||||
"hasAddress" to "ADDRESS PRESENT? Answer YES or NO only.",
|
||||
"hasGender" to "GENDER PRESENT? Answer YES or NO only.",
|
||||
"hasNationality" to "NATIONALITY 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.",
|
||||
"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.",
|
||||
"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."
|
||||
)
|
||||
val results = linkedMapOf<String, String>()
|
||||
results["hasAadhar"] = llamaClient.ask(imageUrl, "CONTAINS AADHAAR? Answer YES or NO only.")
|
||||
results["hasUidai"] = llamaClient.ask(imageUrl, "CONTAINS UIDAI? Answer YES or NO only.")
|
||||
results["hasTransportDept"] = llamaClient.ask(imageUrl, "CONTAINS TRANSPORT DEPARTMENT? Answer YES or NO only.")
|
||||
results["hasIncomeTaxDept"] = llamaClient.ask(imageUrl, "CONTAINS INCOME TAX DEPARTMENT? Answer YES or NO only.")
|
||||
results["hasElectionCommission"] = llamaClient.ask(imageUrl, "CONTAINS ELECTION COMMISSION OF INDIA? Answer YES or NO only.")
|
||||
results["hasDrivingLicence"] = llamaClient.ask(imageUrl, "CONTAINS DRIVING LICENCE? Answer YES or NO only.")
|
||||
results["hasPassport"] = llamaClient.ask(imageUrl, "CONTAINS PASSPORT? Answer YES or NO only.")
|
||||
results["hasPolice"] = llamaClient.ask(imageUrl, "CONTAINS POLICE? Answer YES or NO only.")
|
||||
results["hasCourt"] = llamaClient.ask(imageUrl, "CONTAINS COURT? Answer YES or NO only.")
|
||||
results["hasHighCourt"] = llamaClient.ask(imageUrl, "CONTAINS HIGH COURT? Answer YES or NO only.")
|
||||
results["hasSupremeCourt"] = llamaClient.ask(imageUrl, "CONTAINS SUPREME COURT? Answer YES or NO only.")
|
||||
results["hasJudiciary"] = llamaClient.ask(imageUrl, "CONTAINS JUDICIARY? Answer YES or NO only.")
|
||||
results["hasAddress"] = llamaClient.ask(imageUrl, "ADDRESS PRESENT? Answer YES or NO only.")
|
||||
results["hasGender"] = llamaClient.ask(imageUrl, "GENDER PRESENT? Answer YES or NO only.")
|
||||
results["hasNationality"] = llamaClient.ask(imageUrl, "NATIONALITY PRESENT? Answer YES or NO only.")
|
||||
results["name"] = llamaClient.ask(imageUrl, "NAME? Reply only the name or NONE.")
|
||||
results["dob"] = llamaClient.ask(imageUrl, "DOB? Reply only date or NONE.")
|
||||
results["idNumber"] = llamaClient.ask(imageUrl, "ID NUMBER? Reply only number or NONE.")
|
||||
results["address"] = llamaClient.ask(imageUrl, "ADDRESS? Reply only address or NONE.")
|
||||
results["vehicleNumber"] = llamaClient.ask(imageUrl, "VEHICLE NUMBER? Reply only number or NONE.")
|
||||
results["isVehiclePhoto"] = llamaClient.ask(imageUrl, "IS THIS A VEHICLE PHOTO? Answer YES or NO only.")
|
||||
results["pinCode"] = llamaClient.ask(imageUrl, "PIN CODE? Reply only pin or NONE.")
|
||||
results["city"] = llamaClient.ask(imageUrl, "CITY? Reply only city or NONE.")
|
||||
results["gender"] = llamaClient.ask(imageUrl, "GENDER? Reply only MALE/FEMALE/OTHER or NONE.")
|
||||
results["nationality"] = llamaClient.ask(imageUrl, "NATIONALITY? Reply only nationality or NONE.")
|
||||
for ((key, question) in questions) {
|
||||
results[key] = llamaClient.ask(imageUrl, question)
|
||||
}
|
||||
|
||||
results["docType"] = when {
|
||||
results["hasCourt"].orEmpty().contains("YES", ignoreCase = true) ||
|
||||
|
||||
Reference in New Issue
Block a user