Dropdown
Browse files
app.py
CHANGED
|
@@ -13,6 +13,14 @@ logger = logging.getLogger("CamptocampApp")
|
|
| 13 |
# Instantiate API client
|
| 14 |
c2c = CamptocampAPI(language="en")
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
def get_recent_outings_by_location(location: str, start_date: Optional[str] = None, end_date: Optional[str] = None, activity: Optional[str] = None, limit: int = 10) -> dict:
|
| 17 |
logger.info(f"[Outings] Resolving location: {location}")
|
| 18 |
bbox = c2c.get_bbox_from_location(location)
|
|
@@ -72,7 +80,7 @@ with gr.Blocks(title="Camptocamp MCP Server") as demo:
|
|
| 72 |
loc = gr.Textbox(label="Location (e.g. Chamonix, La Grave)")
|
| 73 |
start = gr.Textbox(label="Start Date (YYYY-MM-DD)")
|
| 74 |
end = gr.Textbox(label="End Date (YYYY-MM-DD)")
|
| 75 |
-
act = gr.
|
| 76 |
limit = gr.Number(label="Result Limit", value=5)
|
| 77 |
out = gr.JSON()
|
| 78 |
gr.Button("Get Outings").click(get_recent_outings_by_location,
|
|
@@ -81,7 +89,7 @@ with gr.Blocks(title="Camptocamp MCP Server") as demo:
|
|
| 81 |
|
| 82 |
with gr.Tab("🧗 Search Routes"):
|
| 83 |
rloc = gr.Textbox(label="Location (e.g. Alps)")
|
| 84 |
-
ract = gr.
|
| 85 |
rlim = gr.Number(label="Result Limit", value=5)
|
| 86 |
rout = gr.JSON()
|
| 87 |
gr.Button("Search Routes").click(search_routes_by_location,
|
|
|
|
| 13 |
# Instantiate API client
|
| 14 |
c2c = CamptocampAPI(language="en")
|
| 15 |
|
| 16 |
+
ACTIVITIES = [
|
| 17 |
+
"hiking", "snowshoeing", "skitouring", "snow_ice_mixed",
|
| 18 |
+
"rock_climbing", "ice_climbing", "mountaineering", "via_ferrata",
|
| 19 |
+
"paragliding", "bouldering", "multi_pitch",
|
| 20 |
+
"bike", "mountain_bike", "trail_running", "alpine_climbing"
|
| 21 |
+
]
|
| 22 |
+
|
| 23 |
+
|
| 24 |
def get_recent_outings_by_location(location: str, start_date: Optional[str] = None, end_date: Optional[str] = None, activity: Optional[str] = None, limit: int = 10) -> dict:
|
| 25 |
logger.info(f"[Outings] Resolving location: {location}")
|
| 26 |
bbox = c2c.get_bbox_from_location(location)
|
|
|
|
| 80 |
loc = gr.Textbox(label="Location (e.g. Chamonix, La Grave)")
|
| 81 |
start = gr.Textbox(label="Start Date (YYYY-MM-DD)")
|
| 82 |
end = gr.Textbox(label="End Date (YYYY-MM-DD)")
|
| 83 |
+
act = gr.Dropdown(label="Activity", choices=ACTIVITIES, allow_none=True, value="alpine_climbing")
|
| 84 |
limit = gr.Number(label="Result Limit", value=5)
|
| 85 |
out = gr.JSON()
|
| 86 |
gr.Button("Get Outings").click(get_recent_outings_by_location,
|
|
|
|
| 89 |
|
| 90 |
with gr.Tab("🧗 Search Routes"):
|
| 91 |
rloc = gr.Textbox(label="Location (e.g. Alps)")
|
| 92 |
+
ract = gr.Dropdown(label="Activity", choices=ACTIVITIES, value="alpine_climbing")
|
| 93 |
rlim = gr.Number(label="Result Limit", value=5)
|
| 94 |
rout = gr.JSON()
|
| 95 |
gr.Button("Search Routes").click(search_routes_by_location,
|