简介
Ride Receipts
原始描述
Build a local SQLite ride-history database from Gmail ride receipt emails using gog for fetch and OpenClaw Gateway /v1/responses for extraction. Use when you...
通过你的 Agent 添加
安装目录:ride-receipts-gateway-llm/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: ride-receipts-gateway-llm
description: Build a local SQLite ride-history database from Gmail ride receipt emails using gog for fetch and OpenClaw Gateway /v1/responses for extraction. Use when you want a portable Gateway-based pipeline that fetches taxi receipts into emails.json, iterates through each email with the Gateway-backed LLM, writes rides.json, and inserts the results into SQLite.
metadata:
openclaw:
requires:
bins:
- gog
- python3
config:
- gateway.port
- gateway.auth.token
- gateway.http.endpoints.responses.enabled
ride-receipts-gateway-llm
Build a ride-receipt pipeline that fetches Gmail receipts into one emails.json file, sends each email to the local OpenClaw Gateway /v1/responses endpoint for structured extraction, writes one rides.json array, and inserts the result into SQLite.
Before you start
- Require
gog CLI authenticated for the target Gmail account.
- Require a reachable local OpenClaw Gateway.
- Require Gateway auth token available via
OPENCLAW_GATEWAY_TOKEN or ~/.openclaw/openclaw.json.
- Require the Gateway HTTP Responses endpoint to be enabled.
- Ask the user for date scope: all-time, after a date, or between two dates.
- Treat receipt emails as sensitive financial/location data.
- Tell the user that
emails.json stores fetched receipt emails locally and may include full HTML receipt content.
- Before extraction, confirm the user is okay sending raw receipt email JSON/HTML to the active local/private Gateway-backed model.
- Prefer loopback or private Gateway targets. Only use a non-local Gateway when the user explicitly accepts that data flow.
Outputs
gog CLI authenticated for the target Gmail account.OPENCLAW_GATEWAY_TOKEN or ~/.openclaw/openclaw.json.emails.json stores fetched receipt emails locally and may include full HTML receipt content.Primary artifacts:
data/gateway-llm/emails.json— fetched receipt emails in one JSON array; may include full HTML receipt contentdata/gateway-llm/rides.json— extracted ride records in one JSON arraydata/gateway-llm/rides.sqlite— queryable SQLite database containing normalized ride fields plusextracted_ride_json, but not raw source email JSON
Pipeline
Run each step in order. Stop and report on failure.
1. Initialize DB
python3 skills/ride-receipts-gateway-llm/scripts/init_db.py \
--db ./data/gateway-llm/rides.sqlite \
--schema skills/ride-receipts-gateway-llm/references/schema_rides.sql
2. Fetch Gmail receipts into emails.json
python3 skills/ride-receipts-gateway-llm/scripts/fetch_emails_json.py \
--account <gmail-account> \
--after YYYY-MM-DD \
--before YYYY-MM-DD \
--max-per-provider 5000 \
--out ./data/gateway-llm/emails.json
python3 skills/ride-receipts-gateway-llm/scripts/init_db.py \
--db ./data/gateway-llm/rides.sqlite \
--schema skills/ride-receipts-gateway-llm/references/schema_rides.sql
emails.json
python3 skills/ride-receipts-gateway-llm/scripts/fetch_emails_json.py \
--account <gmail-account> \
--after YYYY-MM-DD \
--before YYYY-MM-DD \
--max-per-provider 5000 \
--out ./data/gateway-llm/emails.json
Notes:
- Omit
--after/--beforewhen not needed. - Supported provider queries live in
references/provider_queries.json. - Current coverage includes Uber, Bolt, Yandex, Lyft, Free Now, Curb, and Via.
3. Extract rides with Gateway /v1/responses into rides.json
OPENCLAW_GATEWAY_URL=http://127.0.0.1:18789 \
OPENCLAW_GATEWAY_TOKEN=... \
python3 skills/ride-receipts-gateway-llm/scripts/extract_rides_gateway.py \
--emails-json ./data/gateway-llm/emails.json \
--out ./data/gateway-llm/rides.json
OPENCLAW_GATEWAY_URL=http://127.0.0.1:18789 \
OPENCLAW_GATEWAY_TOKEN=... \
python3 skills/ride-receipts-gateway-llm/scripts/extract_rides_gateway.py \
--emails-json ./data/gateway-llm/emails.json \
--out ./data/gateway-llm/rides.json
Notes:
- The script iterates one email at a time.
- It sends raw email JSON to the Gateway
/v1/responsesendpoint. - By default it refuses non-local Gateway hosts for this sensitive data flow; override only with
OPENCLAW_ALLOW_NONLOCAL_GATEWAY=1when the user explicitly trusts that target. - It expects JSON-only output matching the current ride schema.
- It retries failed requests up to 3 times.
- It writes
rides.jsonafter each successful extraction, so progress is checkpointed. - If
rides.jsonalready exists, it skips emails whosegmail_message_idis already present there. - If rate limits become a problem, re-run with
--delay-ms <n>.
4. Insert rides.json into SQLite
python3 skills/ride-receipts-gateway-llm/scripts/insert_rides_json_sqlite.py \
--db ./data/gateway-llm/rides.sqlite \
--rides-json ./data/gateway-llm/rides.json
Constraints
- Use only the scripts bundled in this skill.
- Do not silently switch to direct provider APIs or embedded agent internals.
- Never hallucinate fields; use
null when unknown.
- Keep addresses and time strings verbatim.
- Keep user-facing output brief: counts, paths, and failures.
References
- Schema:
skills/ride-receipts-gateway-llm/references/schema_rides.sql
- Provider Gmail queries:
skills/ride-receipts-gateway-llm/references/provider_queries.json
python3 skills/ride-receipts-gateway-llm/scripts/insert_rides_json_sqlite.py \
--db ./data/gateway-llm/rides.sqlite \
--rides-json ./data/gateway-llm/rides.json
- Use only the scripts bundled in this skill.
- Do not silently switch to direct provider APIs or embedded agent internals.
- Never hallucinate fields; use
nullwhen unknown. - Keep addresses and time strings verbatim.
- Keep user-facing output brief: counts, paths, and failures.
References
- Schema:
skills/ride-receipts-gateway-llm/references/schema_rides.sql
- Provider Gmail queries:
skills/ride-receipts-gateway-llm/references/provider_queries.json
skills/ride-receipts-gateway-llm/references/schema_rides.sqlskills/ride-receipts-gateway-llm/references/provider_queries.json正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。