OnlyBiggg commited on
Commit
4348d23
·
1 Parent(s): 3804450
app/dialogflow/api/v1/dialogflow.py CHANGED
@@ -321,9 +321,8 @@ async def get_trip_list(request: Request) -> Response:
321
  # Danh sách chuyến xe khớp với văn phòng đón hoặc văn phòng trả
322
  data_by_office = dialog_service.get_all_trip_by_office(data, origin_id, dest_id)
323
  # Tìm 4 chuyến xe gần thời gian chỉ định nhất
324
- trip_surrounding_time = dialog_service.get_4_surrounding_trip(data_by_office, time, origin_id, dest_id)
325
 
326
- trips = []
327
  trip_dialogflow = []
328
 
329
  for trip in trip_surrounding_time:
@@ -344,7 +343,7 @@ async def get_trip_list(request: Request) -> Response:
344
  }
345
  parameters = {
346
  "trip_select": trip_dialogflow,
347
- "trips": trips,
348
  }
349
  return DialogFlowResponseAPI(text=text, payload=payload,parameters=parameters)
350
 
@@ -486,7 +485,7 @@ async def is_valid_select_trip(request: Request) -> Response:
486
  session_info = body.get("sessionInfo", {})
487
  parameters = session_info.get("parameters")
488
  trip_select: list[dict[str, any]] = parameters.get("trip_select")
489
- trips: list[dict[str, any]] = parameters.get("trip")
490
 
491
  if trip_select is None and trips is None:
492
  return DialogFlowResponseAPI()
 
321
  # Danh sách chuyến xe khớp với văn phòng đón hoặc văn phòng trả
322
  data_by_office = dialog_service.get_all_trip_by_office(data, origin_id, dest_id)
323
  # Tìm 4 chuyến xe gần thời gian chỉ định nhất
324
+ trip_surrounding_time = dialog_service.get_4_surrounding_trip(data_by_office, time)
325
 
 
326
  trip_dialogflow = []
327
 
328
  for trip in trip_surrounding_time:
 
343
  }
344
  parameters = {
345
  "trip_select": trip_dialogflow,
346
+ "trips": trip_surrounding_time,
347
  }
348
  return DialogFlowResponseAPI(text=text, payload=payload,parameters=parameters)
349
 
 
485
  session_info = body.get("sessionInfo", {})
486
  parameters = session_info.get("parameters")
487
  trip_select: list[dict[str, any]] = parameters.get("trip_select")
488
+ trips: list[dict[str, any]] = parameters.get("trips")
489
 
490
  if trip_select is None and trips is None:
491
  return DialogFlowResponseAPI()