Spaces:
Sleeping
Sleeping
OnlyBiggg
commited on
Commit
·
dddff76
1
Parent(s):
5f24f58
fix
Browse files
app/dialogflow/api/v1/dialogflow.py
CHANGED
|
@@ -403,7 +403,6 @@ async def time_trip(request: Request) -> Response:
|
|
| 403 |
route_id = int(raw_route_id) if raw_route_id else None
|
| 404 |
|
| 405 |
text = []
|
| 406 |
-
time_list = []
|
| 407 |
quick_time_reply = []
|
| 408 |
parameters = {}
|
| 409 |
|
|
@@ -522,7 +521,6 @@ async def is_valid_select_time(request: Request) -> Response:
|
|
| 522 |
return DialogFlowResponseAPI(text=text, parameters=parameters)
|
| 523 |
if is_has_time:
|
| 524 |
time_list = find_surrounding_times(time_list, time_select)
|
| 525 |
-
print(time_list)
|
| 526 |
parameters = {
|
| 527 |
"time_list": time_list,
|
| 528 |
"is_valid_time": False
|
|
|
|
| 403 |
route_id = int(raw_route_id) if raw_route_id else None
|
| 404 |
|
| 405 |
text = []
|
|
|
|
| 406 |
quick_time_reply = []
|
| 407 |
parameters = {}
|
| 408 |
|
|
|
|
| 521 |
return DialogFlowResponseAPI(text=text, parameters=parameters)
|
| 522 |
if is_has_time:
|
| 523 |
time_list = find_surrounding_times(time_list, time_select)
|
|
|
|
| 524 |
parameters = {
|
| 525 |
"time_list": time_list,
|
| 526 |
"is_valid_time": False
|
utils/format_data_dialog.py
CHANGED
|
@@ -11,11 +11,8 @@ def find_surrounding_times(time_list: list, time: str) -> list:
|
|
| 11 |
:param time: Time string to find the surrounding times for.
|
| 12 |
:return: List of surrounding times in "HH:mm" format.
|
| 13 |
"""
|
| 14 |
-
print(time_list)
|
| 15 |
times = [item["time"] for item in time_list]
|
| 16 |
-
print(times)
|
| 17 |
index = bisect_left(times, time)
|
| 18 |
-
print(index)
|
| 19 |
start = max(0, index - 2)
|
| 20 |
end = min(len(time_list), index + 2)
|
| 21 |
|
|
|
|
| 11 |
:param time: Time string to find the surrounding times for.
|
| 12 |
:return: List of surrounding times in "HH:mm" format.
|
| 13 |
"""
|
|
|
|
| 14 |
times = [item["time"] for item in time_list]
|
|
|
|
| 15 |
index = bisect_left(times, time)
|
|
|
|
| 16 |
start = max(0, index - 2)
|
| 17 |
end = min(len(time_list), index + 2)
|
| 18 |
|