Spaces:
Sleeping
Sleeping
jonathanjordan21
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -324,6 +324,10 @@ def respond(
|
|
324 |
# kode_mohon = detail_perhitungan.get(code)
|
325 |
# formula = kode_mohon.get("formula")
|
326 |
# description = inspect.getsource(formula).split(":", 2)[-1].strip()
|
|
|
|
|
|
|
|
|
327 |
|
328 |
out = ""
|
329 |
for plate in plates:
|
@@ -339,15 +343,13 @@ def respond(
|
|
339 |
|
340 |
if results:
|
341 |
out += "\n\n" + build_outputs(results, descriptions, result_details, plate)
|
342 |
-
elif descriptions:
|
343 |
-
prnt("ENTER DESC")
|
344 |
-
out += "\n\n" + build_output_formula(descriptions, result_details)
|
345 |
elif vehicle_tax_info.get(plate):
|
346 |
out += "\n\n" + build_output_vehicle(plate)
|
347 |
-
else:
|
348 |
-
# + request_details + f"\n\nConfidence score:\n{request_scores}"
|
349 |
-
out += "Request code number:\n" + request_numbers + "\n\nRequest detail:\n" + "\n\nPlate numbers: " + plate_numbers
|
350 |
|
|
|
|
|
|
|
|
|
351 |
|
352 |
return out
|
353 |
|
|
|
324 |
# kode_mohon = detail_perhitungan.get(code)
|
325 |
# formula = kode_mohon.get("formula")
|
326 |
# description = inspect.getsource(formula).split(":", 2)[-1].strip()
|
327 |
+
|
328 |
+
if len(request_numbers_copy) == 0 and len(plates) ==0:
|
329 |
+
# + request_details + f"\n\nConfidence score:\n{request_scores}"
|
330 |
+
return "Request code number:\n" + request_numbers + "\n\nRequest detail:\n" + "\n\nPlate numbers: " + plate_numbers
|
331 |
|
332 |
out = ""
|
333 |
for plate in plates:
|
|
|
343 |
|
344 |
if results:
|
345 |
out += "\n\n" + build_outputs(results, descriptions, result_details, plate)
|
|
|
|
|
|
|
346 |
elif vehicle_tax_info.get(plate):
|
347 |
out += "\n\n" + build_output_vehicle(plate)
|
|
|
|
|
|
|
348 |
|
349 |
+
if out == "":
|
350 |
+
for code in request_numbers_copy:
|
351 |
+
result, description, result_detail = get_calculation(code, "")
|
352 |
+
out += "\n\n" + build_output_formula([description], [result_detail])
|
353 |
|
354 |
return out
|
355 |
|