Jikkii commited on
Commit
f360e0e
·
1 Parent(s): 5c2808f
Files changed (2) hide show
  1. app.py +3 -3
  2. camptocamp_api.py +1 -1
app.py CHANGED
@@ -77,7 +77,7 @@ def simplify_outings_response(
77
  return results
78
 
79
 
80
- def get_recent_outings_by_location(
81
  location: str,
82
  start_date: Optional[str] = None,
83
  end_date: Optional[str] = None,
@@ -92,7 +92,7 @@ def get_recent_outings_by_location(
92
  return {"error": f"Could not resolve bounding box for location: {location}"}
93
  logger.info(f"BBox for '{location}': {bbox}")
94
  date_range = (start_date, end_date) if start_date and end_date else None
95
- result = c2c.get_recent_outings(bbox, date_range, activity, limit)
96
  logger.info(f"Returned {len(result.get('documents', []))} outings.")
97
  return simplify_outings_response(result, elevation_max_threshold=elevation_max_threshold)
98
 
@@ -150,7 +150,7 @@ with gr.Blocks(title="Camptocamp MCP Server") as demo:
150
  out = gr.JSON()
151
 
152
  gr.Button("Get Outings").click(
153
- get_recent_outings_by_location,
154
  inputs=[loc, start, end, act, limit, elev_slider],
155
  outputs=out
156
  )
 
77
  return results
78
 
79
 
80
+ def get_outings_by_location(
81
  location: str,
82
  start_date: Optional[str] = None,
83
  end_date: Optional[str] = None,
 
92
  return {"error": f"Could not resolve bounding box for location: {location}"}
93
  logger.info(f"BBox for '{location}': {bbox}")
94
  date_range = (start_date, end_date) if start_date and end_date else None
95
+ result = c2c.get_outings(bbox, date_range, activity, limit)
96
  logger.info(f"Returned {len(result.get('documents', []))} outings.")
97
  return simplify_outings_response(result, elevation_max_threshold=elevation_max_threshold)
98
 
 
150
  out = gr.JSON()
151
 
152
  gr.Button("Get Outings").click(
153
+ get_outings_by_location,
154
  inputs=[loc, start, end, act, limit, elev_slider],
155
  outputs=out
156
  )
camptocamp_api.py CHANGED
@@ -32,7 +32,7 @@ class CamptocampAPI:
32
  response.raise_for_status()
33
  return response.json()
34
 
35
- def get_recent_outings(
36
  self,
37
  bbox: Tuple[float, float, float, float],
38
  date_range: Optional[Tuple[str, str]] = None,
 
32
  response.raise_for_status()
33
  return response.json()
34
 
35
+ def get_outings(
36
  self,
37
  bbox: Tuple[float, float, float, float],
38
  date_range: Optional[Tuple[str, str]] = None,