agent.tools.poi
POI 工具:营业时间 LLM 解析 + POI 查询 Function Calling。
Functions
|
根据高德行业分类和名称判定 POI 类型。 |
|
通过高德 API 查询 POI 的坐标、地址和营业时间。 |
|
LLM 解析高德 opentime2 营业时间。 |
Module Contents
- agent.tools.poi._classify_poi(poi_type: str, name: str) str
根据高德行业分类和名称判定 POI 类型。
- Args:
poi_type: 高德行业分类字符串(如 "住宿服务;宾馆酒店")。 name: POI 名称,辅助判定。
- Returns:
"hotel" | "spot" | "unknown"
- agent.tools.poi.poi_lookup(city: str, name: str) dict
通过高德 API 查询 POI 的坐标、地址和营业时间。
自动识别 POI 类型(酒店/景点),酒店默认时间窗为 0-1440(全天)。
- Args:
city: 所在城市。 name: POI 名称。
- Returns:
dict: { name, lon, lat, address, tw_start, tw_end, poi_type } poi_type 为 "hotel" | "spot" | "unknown"。 查询失败时返回 { error: str }。
- agent.tools.poi.parse_biz_hours(opentime2: str) tuple[int, int] | None
LLM 解析高德 opentime2 营业时间。
- Args:
opentime2: 高德 API 返回的原始 opentime2 字符串。
- Returns:
(start_min, end_min) 或 None(解析失败时)。