Fly Flight
Use the unified transport entrypoint in this skill to handle China domestic trip lookup for both flights and high-speed rail.
这是一个统一的中国境内出行查询 skill,同时支持航班和高铁。
它通过同一个 transport 入口按 mode 路由到底层 provider。
Requirements
Require the following runtime environment before using this skill:
- - INLINECODE0
- INLINECODE1
- Network access to Tongcheng public flight pages and official 12306 public endpoints
使用这个 skill 前,运行环境必须具备:
- - INLINECODE2
- INLINECODE3
- 能访问同程公开航班页面和 12306 官方公开接口的网络环境
These dependencies are required whether the skill is installed from GitHub or from ClawHub.
无论这个 skill 是从 GitHub 安装还是从 ClawHub 安装,这些依赖都必须满足。
Current implementation status:
- -
flight mode is implemented through Tongcheng public flight pages. - INLINECODE5 mode is implemented through official 12306 public high-speed rail query and public price endpoints.
Quick Start
Flight query:
CODEBLOCK0
High-speed rail query:
CODEBLOCK1
The legacy flight-only entrypoint remains available for backward compatibility:
CODEBLOCK2
Optional local HTTP mode:
CODEBLOCK3
Workflow
- 1. Determine transport mode.
Use
flight for flights, airports, airlines, or plane tickets.
Use
train for high-speed rail, rail tickets, stations, or train numbers.
If the user is ambiguous, infer conservatively from their wording or ask.
- 2. Route to the correct provider.
Use
scripts/transport_service.py as the shared entrypoint.
Flight mode delegates to
scripts/providers/flightpublic_service.py.
Train mode delegates to
scripts/providers/trainpublic_service.py.
- 3. Preserve a shared outer response shape.
Return
mode,
provider,
trip_type,
outbound, and optional
return.
Keep mode-specific fields inside each leg's
options.
- 4. Apply only mode-specific filters that make sense.
Flight filters: airline, direct-only, preferred airports.
Train filters: train type, seat type, preferred stations.
- 5. Summarize results with the mode label.
Clearly say whether the result is a flight result or a train result.
Treat public-source prices as reference prices that can differ from final checkout prices.
Output Rules
- - Prefer up to 5 options unless the user asked for more.
- State the exact travel date in
YYYY-MM-DD. - Keep the outer response consistent across modes.
- Do not force a single shared field schema for airports and stations; keep mode-specific details inside
options. - For round trips, clearly separate
outbound and return. - For train mode, explain that prices come from official public fare data and seat availability comes from public query results.
Resources
飞行航班
使用此技能中的统一交通入口,处理中国境内航班和高铁的出行查询。
这是一个统一的中国境内出行查询技能,同时支持航班和高铁。
它通过同一个交通入口按模式路由到底层提供商。
要求
使用此技能前,运行环境必须具备:
- - python3
- node
- 能访问同程公开航班页面和12306官方公开接口的网络环境
无论此技能是从GitHub安装还是从ClawHub安装,这些依赖都必须满足。
当前实现状态:
- - flight模式通过同程公开航班页面实现。
- train模式通过12306官方公开高铁查询和公开票价接口实现。
快速开始
航班查询:
bash
python3 {baseDir}/scripts/transport_service.py search \
--mode flight --from 北京 --to 上海 --date 2026-03-20 --sort-by price --pretty
高铁查询:
bash
python3 {baseDir}/scripts/transport_service.py search \
--mode train --from 北京 --to 上海 --date 2026-03-20 \
--seat-type second_class --sort-by price --pretty
为保持向后兼容,原有的仅航班入口仍然可用:
bash
python3 {baseDir}/scripts/domesticflightpublic_service.py search \
--from 北京 --to 上海 --date 2026-03-20 --sort-by price --pretty
可选的本地HTTP模式:
bash
python3 {baseDir}/scripts/transport_service.py serve --port 8766
工作流程
- 1. 确定交通模式。
对于航班、机场、航空公司或机票,使用flight。
对于高铁、火车票、车站或车次,使用train。
如果用户表述模糊,根据其措辞保守推断或进行询问。
- 2. 路由到正确的提供商。
使用
scripts/transport_service.py作为共享入口。
航班模式委托给
scripts/providers/flightpublic_service.py。
火车模式委托给
scripts/providers/trainpublic_service.py。
- 3. 保持共享的外部响应结构。
返回mode、provider、trip_type、outbound以及可选的return。
将模式特定字段保留在每个行程段的options内。
- 4. 仅应用有意义的模式特定筛选条件。
航班筛选条件:航空公司、仅直飞、首选机场。
火车筛选条件:列车类型、座位类型、首选车站。
- 5. 使用模式标签总结结果。
明确说明结果是航班结果还是火车结果。
将公开来源的价格视为参考价格,可能与最终结算价格存在差异。
输出规则
- - 除非用户要求更多,否则最多提供5个选项。
- 以YYYY-MM-DD格式注明确切的出行日期。
- 保持跨模式的外部响应一致。
- 不要强制为机场和车站设置单一的共享字段模式;将模式特定细节保留在options内。
- 对于往返行程,明确区分outbound和return。
- 对于火车模式,说明价格来自官方公开票价数据,座位余量来自公开查询结果。
资源