Trip Assistant Skill
A conversational AI assistant for booking and querying flights, trains, and hotels. The assistant communicates in natural language and handles complex travel queries including date parsing, multi-city trips, and comparisons.
When to Use
Activate this skill when the user:
- - Asks about flights: 机票, 航班, 飞机, 坐飞机, 飞到, 航空
- Asks about trains: 火车, 高铁, 动车, 列车, 火车票, 高铁票
- Asks about hotels: 酒店, 住宿, 宾馆, 旅馆, 住哪里
- Asks for travel planning: 出行规划, 怎么去, 旅行安排, 最快怎么到
How to Use
Run the query script, passing the user's complete natural language query:
CODEBLOCK0
Key notes:
- - Replace
SKILL_DIR with the absolute path to this skill's directory - The
--query value should be the user's full original message (do not rewrite or simplify) - The script outputs the assistant's reply to stdout; pass it back to the user verbatim
- If the script returns a connection error, inform the user the service is unavailable and ask them to check that the FastAPI server is running (
uvicorn booking_assitant.fastapi_serve:app --host 0.0.0.0 --port 8763)
Configuration
| Parameter | CLI Flag | Environment Variable | Default |
|---|
| User ID | INLINECODE3 | INLINECODE4 | INLINECODE5 |
| Environment |
--env |
BOOKING_API_ENV |
prod |
| API Base URL |
--base-url |
BOOKING_API_BASE_URL |
http://host.docker.internal:8763 |
Environments:
- -
prod — Production data - INLINECODE13 — Test/staging data
Examples
Query flight
User: "帮我查一下明天北京到上海的机票"
CODEBLOCK1
Query train
User: "3月10日从上海去杭州有哪些高铁?"
CODEBLOCK2
Query hotel
User: "查一下北京王府井附近明天的酒店"
CODEBLOCK3
Error Handling
| Exit Code | Meaning | Action |
|---|
| 0 | Success | Display output to user |
| 1 (connection error) |
FastAPI server not reachable | Ask user to start the server |
| 1 (HTTP error) | API returned error | Display the error message |
| 1 (timeout) | Request timed out | Suggest retrying |
旅行助手技能
一个用于查询和预订航班、火车及酒店的自然语言对话式AI助手。该助手使用自然语言进行交流,能够处理复杂的旅行查询,包括日期解析、多城市行程和比价。
使用场景
当用户出现以下情况时激活此技能:
- - 询问航班:机票、航班、飞机、坐飞机、飞到、航空
- 询问火车:火车、高铁、动车、列车、火车票、高铁票
- 询问酒店:酒店、住宿、宾馆、旅馆、住哪里
- 寻求出行规划:出行规划、怎么去、旅行安排、最快怎么到
使用方法
运行查询脚本,传入用户的完整自然语言查询:
bash
python SKILL_DIR/scripts/query.py \
--query <用户查询> \
--user-id ${BOOKINGAPIUSER_ID:-624e5b8b3f4a2f4ec566e3d3} \
--env ${BOOKINGAPIENV:-prod} \
--base-url ${BOOKINGAPIBASE_URL:-http://host.docker.internal:8763}
关键说明:
- - 将 SKILLDIR 替换为此技能目录的绝对路径
- --query 值应为用户的完整原始消息(不要改写或简化)
- 脚本将助手的回复输出到标准输出;请原样返回给用户
- 如果脚本返回连接错误,请告知用户服务不可用,并请他们检查FastAPI服务器是否正在运行(uvicorn bookingassistant.fastapi_serve:app --host 0.0.0.0 --port 8763)
配置参数
| 参数 | 命令行标志 | 环境变量 | 默认值 |
|---|
| 用户ID | --user-id | BOOKINGAPIUSERID | 624e5b8b3f4a2f4ec566e3d3 |
| 环境 |
--env | BOOKINGAPI_ENV | prod |
| API基础URL | --base-url | BOOKING
APIBASE_URL | http://host.docker.internal:8763 |
环境说明:
- - prod — 生产数据
- fat — 测试/预发布数据
示例
查询航班
用户:帮我查一下明天北京到上海的机票
bash
python ~/.claude/skills/trip-assistant/scripts/query.py \
--query 帮我查一下明天北京到上海的机票 \
--user-id user123 \
--env prod
查询火车
用户:3月10日从上海去杭州有哪些高铁?
bash
python ~/.claude/skills/trip-assistant/scripts/query.py \
--query 3月10日从上海去杭州有哪些高铁? \
--user-id user123 \
--env prod
查询酒店
用户:查一下北京王府井附近明天的酒店
bash
python ~/.claude/skills/trip-assistant/scripts/query.py \
--query 查一下北京王府井附近明天的酒店 \
--user-id user123 \
--env prod
错误处理
| 退出码 | 含义 | 处理方式 |
|---|
| 0 | 成功 | 向用户显示输出 |
| 1(连接错误) |
FastAPI服务器无法访问 | 请用户启动服务器 |
| 1(HTTP错误) | API返回错误 | 显示错误消息 |
| 1(超时) | 请求超时 | 建议重试 |