← 返回 Skills 市场
lbs-bmap

Baidu AI Map(百度地图官方AI SKills)

作者 baidu-maps · GitHub ↗ · v1.0.6 · MIT-0
cross-platform ✓ 安全检测通过
1306
总下载
232
收藏
2
当前安装
7
版本数
在 OpenClaw 中安装
/install baidu-ai-map
功能描述
百度地图 Agent Plan ,无需成为百度地图开发者,立即接入百度地图为 Agent 场景原生设计的地图能力,例如 AI 地点检索、AI 路线规划、地理编码与逆地理编码、天气查询等地图能力等开箱即用的工具。
使用说明 (SKILL.md)

百度地图服务 Agent Plan

提供大模型友好调用的地图工具skills/baidu-ai-map/SKILL.md,支持语义化 AI 搜索、语义化 AI 路线规划、地理编码与逆地理编码、天气查询。

使用准则

准则 1:API 端点

所有能力统一使用:

Base URL: https://api.map.baidu.com/

准则 2:SK 凭证安全处理

SK(Service Key)是调用所有 API 的必须凭证:

  1. 优先读取环境变量 BAIDU_MAP_AUTH_TOKEN
  2. 如果为空,提示用户前往 百度地图 Agent Plan 申请。
  3. 设置环境变量:
export BAIDU_MAP_AUTH_TOKEN="你的SK"

准则 3:统一鉴权方式(Header 传入)

调用所有 API 时,统一通过 Header 传入:

  • Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN

示例:

curl --get "https://api.map.baidu.com/agent_plan/v1/place" \
  -H "Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN" \
  --data-urlencode "user_raw_request=帮我找北京可带宠物的咖啡馆" \
  --data-urlencode "region=北京市"

全局参数与行为约束

  1. user_raw_request 必须是完整的用户需求,不可压缩为关键词。
  2. user_raw_request 出现“我附近”等非明确地点时,可根据上下文为用户推理为具体地点名称,但不可对坐标进行推理。
  3. user_raw_request 需保留定语/约束词,例如“评分最高”“最近”“最便宜”“3公里内”。
  4. 不得编造坐标;center / location / refer_pois 仅可来自用户明确提供或可信来源,当无可靠坐标时,必须先向用户澄清或先调用 geocoding / place 等工具获取。
  5. 统一使用 Header 鉴权:Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN
  6. 经纬度至少保留小数点后 6 位。
  7. 所有工具返回坐标类型统一为 gcj02
  8. 禁止使用 grep/sed/awk/jq/python脚本 正则裁剪响应后再推断字段,这会造成百度地图 Agent Plan 巨额的token消耗;短时间内遇到相同或高度相似请求时,应优先基于结果直接推理,避免重复发起请求。
  9. direction 可能返回两类结果:路线结果,或起终点澄清结果。当返回起终点澄清结果时,应先根据用户需求推理最合理候选;若仍无法唯一确定,应引导用户在候选中选择后再继续规划。

工具详解

1. Place(语义化AI地点检索)

API

GET /agent_plan/v1/place

参数输入(给模型)

Required:

  • user_raw_request: 用户原始需求,原样完整传入,不可压缩为关键词;保留约束词(如“评分最高”“最近”“3公里内”)
  • region: 城市或区域限制

Optional:

  • center: 检索中心点和排序参考点(lat,lng,gcj02)
  • sort: distancerelevance(默认 relevance

Rules:

  • sort=distance 时,center 必传
  • center 只能来自用户明确提供或可信来源,禁止推测/编造,可通过 geocoding / place 等工具获取
  • 经纬度至少保留小数点后 6 位

鉴权

  • GET:Header Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN

示例

# 1) 帮我查一下八达岭长城附近的五星级酒店
curl --get "https://api.map.baidu.com/agent_plan/v1/place" \
  -H "Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN" \
  --data-urlencode "user_raw_request=帮我查一下八达岭长城附近的五星级酒店" \
  --data-urlencode "region=延庆区" \
  --data-urlencode "sort=relevance"

# 2) 离我最近的火锅店(distance 排序)
curl --get "https://api.map.baidu.com/agent_plan/v1/place" \
  -H "Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN" \
  --data-urlencode "user_raw_request=离我最近的火锅店" \
  --data-urlencode "region=北京市" \
  --data-urlencode "center=40.056800,116.308300" \
  --data-urlencode "sort=distance"

2. Direction(语义化AI路线规划)

API

GET /agent_plan/v1/direction

参数输入

Required:

  • user_raw_request: 用户原始需求,包含起点和终点;保留路线约束词,需要推理并改写用户原始的交通方式
  • location: 用户当前位置坐标(lat,lng,gcj02)

Optional:

  • refer_pois: 地点精确映射,格式 地点名称:uid,纬度,经度;地点名称:uid,纬度,经度

Rules:

  • 当前仅支持驾车、步行、骑行、公交路线规划。user_raw_request 中出现其他交通方式时,需要改写到这四种交通方式
  • location 当起点有歧义(如同名地标、模糊起点)时,路线规划服务会基于当前位置推理最合理的起点位置
  • refer_pois 默认不传,用于同名地点消歧,仅在 user_raw_request 中明确有歧义地点时传入
  • refer_pois / location 的经纬度至少保留小数点后 6 位,禁止推测/编造,可通过 geocoding / place 等工具获取

鉴权

  • GET:Header Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN

示例

# 1) 帮我规划从故宫到颐和园的驾车路线
curl --get "https://api.map.baidu.com/agent_plan/v1/direction" \
  -H "Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN" \
  --data-urlencode "user_raw_request=帮我规划从故宫到颐和园的驾车路线" \
  --data-urlencode "location=39.914590,116.403770"

# 2) “我家”别名映射
curl --get "https://api.map.baidu.com/agent_plan/v1/direction" \
  -H "Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN" \
  --data-urlencode "user_raw_request=步行去我家附近最近的中餐厅" \
  --data-urlencode "location=40.056800,116.308300" \
  --data-urlencode "refer_pois=我家:fbc88a21464370106e3e1b52,40.092180,116.345310"

# 2) 交通方式推理改写:从王府井打车去三里屯要多久
curl --get "https://api.map.baidu.com/agent_plan/v1/direction" \
  -H "Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN" \
  --data-urlencode "user_raw_request=从王府井驾车去三里屯要多久" \
  --data-urlencode "location=39.914590,116.403770"

3. Geocoding(地理编码)

API

GET /agent_plan/v1/geocoding

参数输入

Required:

  • address: 要解析的完整地址

Optional:

  • region: 城市/区域提示(减少歧义)

Rules:

  • 地址越完整,解析越稳定

鉴权

  • GET:Header Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN

示例

curl --get "https://api.map.baidu.com/agent_plan/v1/geocoding" \
  -H "Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN" \
  --data-urlencode "address=北京市海淀区上地十街10号百度大厦" \
  --data-urlencode "region=北京市"

4. Reverse Geocoding(逆地理编码)

API

GET /agent_plan/v1/reverse_geocoding

参数输入

Required:

  • location: lat,lng 格式坐标(gcj02)

Rules:

  • 经纬度至少保留小数点后 6 位

鉴权

  • GET:Header Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN

示例

curl --get "https://api.map.baidu.com/agent_plan/v1/reverse_geocoding" \
  -H "Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN" \
  --data-urlencode "location=40.056800,116.308300"

5. Weather(天气查询)

API

GET /agent_plan/v1/weather

参数输入

Optional:

  • region: 行政区划名称
  • location: lat,lng 格式坐标(gcj02)

Rules:

  • regionlocation 至少传一个
  • location 传入时,经纬度至少保留小数点后 6 位

鉴权

  • GET:Header Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN

示例

# 1) 按坐标查询天气
curl --get "https://api.map.baidu.com/agent_plan/v1/weather" \
  -H "Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN" \
  --data-urlencode "location=38.766230,116.432130"

错误处理

  1. 如果缺少 token,提示用户执行:
    申请地址:https://lbs.baidu.com/apiconsole/agentplan
    export BAIDU_MAP_AUTH_TOKEN="\x3CYOUR_BAIDU_MAP_AUTH_TOKEN>"
  2. 如果提示参数错误,重新阅读本Skills查阅如何传参
安全使用建议
This skill appears coherent for using Baidu Map Agent Plan APIs, but consider these practical precautions before installing: (1) Verify the skill source/owner (registry shows an owner ID but 'Source: unknown') and, if possible, confirm the repository/homepage are legitimate; (2) Only provide a BAIDU_MAP_AUTH_TOKEN you control and that has minimal necessary permissions; treat it like any API secret and rotate/revoke it if needed; (3) Be aware the skill will send user-supplied locations and queries to api.map.baidu.com — if your use involves sensitive location data, verify compliance/privacy implications before enabling; (4) Limit autonomous invocation or require user confirmation in agents with broad network access if you are concerned about unattended requests; (5) If you need higher assurance, ask the publisher for provenance (official Baidu account or verified repo) or request a signed/verified release.
功能分析
Type: OpenClaw Skill Name: baidu-ai-map Version: 1.0.6 The baidu-ai-map skill bundle is a legitimate integration for Baidu Maps services, providing tools for AI-based location search, routing, geocoding, and weather. It uses standard environment variables (BAIDU_MAP_AUTH_TOKEN) for authentication and communicates exclusively with the official Baidu API endpoint (api.map.baidu.com) via curl. No evidence of malicious intent, data exfiltration, or prompt injection was found in SKILL.md or _meta.json.
能力评估
Purpose & Capability
Name/description, declared base URL, required binary (curl) and required env var (BAIDU_MAP_AUTH_TOKEN) all align with a map/API integration. The requested token and HTTP calls are proportionate to the stated mapping features (place search, directions, geocoding, weather).
Instruction Scope
SKILL.md contains explicit curl examples and rules limited to calling Baidu map endpoints and reading BAIDU_MAP_AUTH_TOKEN. It does not instruct the agent to read unrelated files, other environment variables, or to exfiltrate data to unexpected endpoints. Behavior constraints (e.g., not fabricating coordinates) are documented.
Install Mechanism
This is an instruction-only skill with no install spec and no code files, so nothing is written to disk. That is lowest-risk and appropriate for the described functionality.
Credentials
Only a single credential (BAIDU_MAP_AUTH_TOKEN) is required and is clearly the service key used for API requests. No unrelated credentials or config paths are requested.
Persistence & Privilege
Skill does not request always: true and is user-invocable. It does not instruct modification of other skills or system-wide settings. Autonomous invocation is allowed by default (platform behavior) but is not combined with other risky privileges here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install baidu-ai-map
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /baidu-ai-map 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.6
- Updated the description to clarify that no Baidu developer status is required and added emphasis on agent-native design and ease of access to map tools. - Minor language adjustments for improved clarity and conciseness in the overview. - No changes to core functionality or API usage.
v1.0.5
- Direction(路线规划)接口由 POST 请求方式调整为 GET 请求方式,示例同步更新。 - 错误处理指引简化,对参数错误的提示更加明确。 - 技能描述微调,保持与实际能力一致;移除细节无关表述。 - 版本号保持 1.0.0(无功能代码变更,仅文档更新)。
v1.0.4
Version 1.0.4 - Updated documentation with stricter parameter sourcing rules: coordinates such as `center`, `location`, and `refer_pois` must not be invented—must prompt or fetch from reliable tools if not specified by user. - Clarified that when handling "我附近" and similar vague terms, only the place name (not coordinates) may be inferred from context. - Explicitly stated that usage of `center` in place search must come from user, geocoding, or place tools. - Removed mention of handling ambiguous `region` in error handling: user should be prompted to clarify missing required parameters only. - No code changes; documentation and constraints improved for reliability and compliance.
v1.0.3
- Changed API authentication from query parameter to HTTP header: all API calls now require Authorization: Bearer $BAIDU_MAP_AUTH_TOKEN in the header. - Updated usage examples and guidelines to match the new authentication method. - Clarified in global rules that authentication is required via request header instead of using query parameters. - No changes to functional scope or endpoints.
v1.0.2
- Update skill description for clarity and to emphasize official AI map capabilities. - No changes to functionality, APIs, usage guidelines, or parameters. - Documentation content, structure, and rules remain the same.
v1.0.1
- Repository URL updated to https://github.com/baidu-maps/map-skills. - Clarified that user_raw_request may require reasoning and rewriting for directions, including adjusting traffic mode to only supported types. - Added new rules restricting use of command-line tools and scripts (grep, sed, awk, jq, python, etc.) for parsing responses to prevent excessive token consumption. - Specified requirements for avoiding duplicate requests when handling similar queries. - Expanded guidance for handling ambiguous start/end points in direction planning, including candidate selection and user prompts.
v1.0.0
First release of baidu-ai-map. - Provides direct access to Baidu Map’s place, direction, geocoding, reverse geocoding, and weather APIs. - Supports natural language search, route planning, geocoding, and weather queries. - Requires environment variable BAIDU_MAP_AUTH_TOKEN for authentication. - All API requests use query parameter baidu_map_auth_token for token passing. - Includes clear rules for parameter use, coordinate formats, and error handling.
元数据
Slug baidu-ai-map
版本 1.0.6
许可证 MIT-0
累计安装 2
当前安装数 2
历史版本数 7
常见问题

Baidu AI Map(百度地图官方AI SKills) 是什么?

百度地图 Agent Plan ,无需成为百度地图开发者,立即接入百度地图为 Agent 场景原生设计的地图能力,例如 AI 地点检索、AI 路线规划、地理编码与逆地理编码、天气查询等地图能力等开箱即用的工具。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1306 次。

如何安装 Baidu AI Map(百度地图官方AI SKills)?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install baidu-ai-map」即可一键安装,无需额外配置。

Baidu AI Map(百度地图官方AI SKills) 是免费的吗?

是的,Baidu AI Map(百度地图官方AI SKills) 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Baidu AI Map(百度地图官方AI SKills) 支持哪些平台?

Baidu AI Map(百度地图官方AI SKills) 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Baidu AI Map(百度地图官方AI SKills)?

由 baidu-maps(@lbs-bmap)开发并维护,当前版本 v1.0.6。

💬 留言讨论