Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,7 +39,7 @@ def problem_categorization(problem_description):
|
|
| 39 |
for department, terms in department_keywords.items():
|
| 40 |
if any(term in problem_description for term in terms):
|
| 41 |
return department
|
| 42 |
-
return "
|
| 43 |
|
| 44 |
# Define the chatbot model
|
| 45 |
# os.environ["GROQ_API_KEY"] = "GROQQQ"
|
|
@@ -86,6 +86,8 @@ Answer:You can check the PNR status of your train ticket by visiting https://www
|
|
| 86 |
|
| 87 |
replace /PNR/ with the pnr number if the user provided otherwise use PNR
|
| 88 |
|
|
|
|
|
|
|
| 89 |
|
| 90 |
Question: What should I do if my train is delayed?
|
| 91 |
Answer: We sincerely apologize for the inconvenience caused by the delay of your train. We understand how frustrating this situation can be. Please stay informed by checking the live train status through https://enquiry.indianrail.gov.in/mntes/ or mobile app. If the delay is significant and you decide not to continue your journey, you may be eligible for a full refund. Additionally, if the delay exceeds three hours, you can file for a refund even after the scheduled departure time. We deeply regret the disruption to your travel plans and appreciate your understanding. Please keep your ticket and PNR number handy if you need further assistance
|
|
@@ -137,7 +139,10 @@ def handle_input(image, text, session_id):
|
|
| 137 |
# Handle image input
|
| 138 |
image_desc = image_description(image)
|
| 139 |
category = problem_categorization(image_desc)
|
| 140 |
-
|
|
|
|
|
|
|
|
|
|
| 141 |
else:
|
| 142 |
# Handle text input
|
| 143 |
response = chain.invoke(
|
|
|
|
| 39 |
for department, terms in department_keywords.items():
|
| 40 |
if any(term in problem_description for term in terms):
|
| 41 |
return department
|
| 42 |
+
return "NA"
|
| 43 |
|
| 44 |
# Define the chatbot model
|
| 45 |
# os.environ["GROQ_API_KEY"] = "GROQQQ"
|
|
|
|
| 86 |
|
| 87 |
replace /PNR/ with the pnr number if the user provided otherwise use PNR
|
| 88 |
|
| 89 |
+
Question: How do i cancel my ticket?
|
| 90 |
+
Answer:Click on the "Cancel Ticket" option, and follow the prompts to complete the cancellation process.Please note that canceling a ticket is subject to IRCTC's cancellation policy and specific conditions.For more information on IRCTC's cancellation policy, please refer to: https://contents.irctc.co.in/en/CancellationRulesforIRCTCTrain.pdf You can also cancel your ticket by visiting the IRCTC e-Ticket Cancellation Website: https://contents.irctc.co.in/en/eticketCancel.html
|
| 91 |
|
| 92 |
Question: What should I do if my train is delayed?
|
| 93 |
Answer: We sincerely apologize for the inconvenience caused by the delay of your train. We understand how frustrating this situation can be. Please stay informed by checking the live train status through https://enquiry.indianrail.gov.in/mntes/ or mobile app. If the delay is significant and you decide not to continue your journey, you may be eligible for a full refund. Additionally, if the delay exceeds three hours, you can file for a refund even after the scheduled departure time. We deeply regret the disruption to your travel plans and appreciate your understanding. Please keep your ticket and PNR number handy if you need further assistance
|
|
|
|
| 139 |
# Handle image input
|
| 140 |
image_desc = image_description(image)
|
| 141 |
category = problem_categorization(image_desc)
|
| 142 |
+
if category=='NA':
|
| 143 |
+
response="Please upload a better image"
|
| 144 |
+
else:
|
| 145 |
+
response=f"Your request has been forwarded to the {category} department"
|
| 146 |
else:
|
| 147 |
# Handle text input
|
| 148 |
response = chain.invoke(
|