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

This commit is contained in:
2025-10-19 22:05:43 +02:00
parent 510aabcb0a
commit bfc0c9adae

View File

@@ -65,7 +65,8 @@ def get_landmarks(
@router.post("/get-nearby/landmarks/{lat}/{lon}")
def get_landmarks_nearby(
lat: float,
lon: 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 :