Skip to content

Commit

Permalink
Merge branch 'main' into fix/link-translation
Browse files Browse the repository at this point in the history
  • Loading branch information
kh4l1d64 authored Feb 26, 2024
2 parents 5f94617 + c988eaa commit 7930d31
Show file tree
Hide file tree
Showing 5 changed files with 783 additions and 37 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@fastify/helmet": "8.0.0",
"@fastify/multipart": "6.0.0",
"@fastify/static": "5.0.0",
"@nestjs/axios": "^3.0.1",
"@nestjs/cache-manager": "^2.1.0",
"@nestjs/common": "8.0.0",
"@nestjs/config": "1.1.6",
Expand Down
16 changes: 8 additions & 8 deletions src/common/kisanPortalErrors.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,40 +155,40 @@
"text":"Dear {{farmer_name}}, I checked your record and found that your Land details were not uploaded by the State/UT Government. I suggest you visit the Block/Tehsil/District Office and get it updated on the PM-KISAN portal",
"types":["payment"]
},
"Farmer Record has been rejected by PFMS / Bank": {
"Farmer Record has been rejected by PFMS / Bank": {
"text": "Dear {{farmer_name}}, I have checked your status and found that there is some issue with your bank account. Link your Aadhaar with your active bank account and enable it for DBT payment to continue to avail the benefits.",
"types":["payment"]
},
"Waiting for approval by state": {
"Waiting for approval by state": {
"text": "Dear {{farmer_name}}, I have checked your status and found that your PMKISAN account is being verified by the State. Please visit your nearest district/ block office and get your details updated on the PM KISAN portal.",
"types":["payment"]
},
"1st installment transaction failed to 15th installment transaction failed": {
"1st installment transaction failed to 15th installment transaction failed": {
"text": "Dear {{farmer_name}}, I have checked your status and found that there is some issue with your bank account. Link your Aadhaar with your active bank account and enable it for DBT payment to continue to avail the benefits.",
"types":["payment"]
},
"Farmer belongs to Exclusion category": {
"text": "Dear {{farmer_name}}, I have checked your status and found that you have been marked as ineligible by the State as you belong to Exclusion category as per PMKISAN scheme guidelines. If this status is not correct, please Visit your nearest district/ block office and get your details updated on the PM KISAN portal.",
"types":["payment"]
},
"Invalid account type. Account is not Saving or Jandhan": {
"Invalid account type. Account is not Saving or Jandhan": {
"text": "Dear {{farmer_name}}, I have checked your status and found that there is some issue with your bank account. Link your Aadhaar with your active bank account and enable it for DBT payment to continue to avail the benefits.",
"types":["payment"]
},
"Farmer marked as \"InEligible\"": {
"Farmer marked as \"InEligible\"": {
"text": "Dear {{farmer_name}}, I have checked your status and found that you have been marked as ineligible by the State as you belong to Exclusion category as per PMKISAN scheme guidelines. If this status is not correct, please Visit your nearest district/ block office and get your details updated on the PM KISAN portal.",
"types":["payment"]
},
"Temporary hold due to account revalidation": {
"Temporary hold due to account revalidation": {
"text": "Dear {{farmer_name}}, I have checked your status and found that there is some issue with your bank account. Link your Aadhaar with your active bank account and enable it for DBT payment to continue to avail the benefits.",
"types":["payment"]
},
"Exempted/Not given": {
"Exempted/Not given": {
"text": "Dear {{farmer_name}}, I have checked your status and found that you have been marked as ineligible by the State as you belong to Exclusion category as per PMKISAN scheme guidelines. If this status is not correct, please Visit your nearest district/ block office and get your details updated on the PM KISAN portal.",
"types":["payment"]
},
"No Errors": {
"text": "Dear {{farmer_name}}, I have checked your account and found that you received all the instalments till now from your PM KISAN registration date {{Reg_Date (DD-MM-YYYY)}}. You will receive your next instalment payment soon in your Aadhaar seeded bank account."
}

}
}
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function bootstrap() {
AppModule,
new FastifyAdapter({ bodyLimit: 10048576 })
);

/** Register Prismaservice LifeCycle hooks */
const prismaService: PrismaService = app.get(PrismaService);
prismaService.enableShutdownHooks(app);
Expand All @@ -39,7 +39,7 @@ async function bootstrap() {
},
});

process.on('exit', (code)=>{
process.on('exit', (code) => {
console.log(`Process is exiting with code: ${code}`);
})

Expand All @@ -55,7 +55,7 @@ async function bootstrap() {
await monitoringService.onExit();
process.exit(0);
});

process.on('SIGTERM', async () => {
console.log('Received SIGTERM signal. Gracefully shutting down...');
const monitoringService = app.get<MonitoringService>(MonitoringService);
Expand Down
17 changes: 4 additions & 13 deletions src/xstate/prompt/prompt.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,10 @@ export class PromptServices {
try{
let response: any = await this.aiToolsService.getResponseViaWadhwani(context.sessionId, context.userId, context.query)
if (response.error) throw new Error(`${response.error}, please try again.`)
// {
// "user_id": "19877818",
// "session_id": "123456",
// "query": "Installment not received",
// "query_intent": "Installment not received",
// "language": "English",
// "response": "Dear Beneficiary, You can check your status using Know Your Status (KYS) module at https://pmkisan.gov.in/BeneficiaryStatus_New.aspx. \nIf you are not satisfied with the status, please contact the PM Kisan officer Shri ABC on 9809898989 or you can also visit the Officer at PM Kisan Officer, 193310 village, 868 block, 965 sub-district, 123 district, 9, Pincode: . \nFor further assistant, please contact on the PM Kisan Samman Nidhi helpline number: 155261 / 011-24300606. The helpline is available on all working days from 9:30 AM to 6:00 PM."
// }
let intent;
if (response.query_intent == "Invalid") intent = "convo"
if (response.query_intent == "convo_starter") intent = "convo"
if (response.query_intent == "convo_ender") intent = "convo"
if (response.query_intent == "Installment not received") intent = "payment"
if (response == `"Invalid"`) return "convo"
if (response == `"convo_starter"`) return "convo"
if (response == `"convo_ender"`) return "convo"
if (response == `"Installment Not Received"`) return "payment"
else {
intent = "invalid"
}
Expand Down
Loading

0 comments on commit 7930d31

Please sign in to comment.