added the option to enable/disable the cluster search in get-nearby endpoint
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 59s
Build and deploy the backend to staging / Deploy to staging (pull_request) Has been skipped
Run linting on the backend code / Build (pull_request) Successful in 2m7s
Run testing on the backend code / Build (pull_request) Failing after 56s
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 59s
Build and deploy the backend to staging / Deploy to staging (pull_request) Has been skipped
Run linting on the backend code / Build (pull_request) Successful in 2m7s
Run testing on the backend code / Build (pull_request) Failing after 56s
This commit is contained in:
@@ -64,9 +64,10 @@ def get_landmarks(
|
||||
|
||||
@router.post("/get-nearby/landmarks/{lat}/{lon}")
|
||||
def get_landmarks_nearby(
|
||||
lat: float,
|
||||
lon: float
|
||||
) -> list[Landmark] :
|
||||
lat: float,
|
||||
lon: float,
|
||||
allow_clusters: bool = False
|
||||
) -> list[Landmark] :
|
||||
"""
|
||||
Suggests nearby landmarks based on a given latitude and longitude.
|
||||
|
||||
@@ -76,6 +77,7 @@ def get_landmarks_nearby(
|
||||
Args:
|
||||
lat (float): Latitude of the user's current location.
|
||||
lon (float): Longitude of the user's current location.
|
||||
allow_clusters (bool): Whether or not to allow the search for shopping/historical clusters when looking for nearby landmarks.
|
||||
|
||||
Returns:
|
||||
list[Landmark]: A list of selected nearby landmarks.
|
||||
@@ -104,7 +106,7 @@ def get_landmarks_nearby(
|
||||
landmarks_around = manager.generate_landmarks_list(
|
||||
center_coordinates = (lat, lon),
|
||||
preferences = prefs,
|
||||
allow_clusters=False,
|
||||
allow_clusters=allow_clusters,
|
||||
)
|
||||
|
||||
if len(landmarks_around) == 0 :
|
||||
|
||||
Reference in New Issue
Block a user