尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗AI Travel Planner สำหรับวางแผนท่องเที่ยวในประเทศไทย โดยเน้น Road Trip
สร้าง AI ที่เข้าใจภาษาไทย ช่วยวางแผนการเดินทาง และทำงานร่วมกับข้อมูลสถานที่จริงได้
The AI can accept a travel request in Thai and return a structured sample itinerary.
GROQ_API_KEY=... in ai-engine/.env (never commit it), then install both packages:cd ai-engine && npm install
cd ../services/api && npm install
cd services/api
npm start
python -m http.server 8080
The page calls http://localhost:3000. Override it with window.TRAVEL_API_BASE_URL before script.js loads, or add ?api=http://host:port to the page URL.
When the page is opened from localhost, 127.0.0.1 or a file, it calls the API at http://localhost:3000. On any other host (for example a Vercel URL) it calls /api on the same domain.
Groq's free tier allows about 8,000 tokens per minute, which is roughly one plan per minute. When the quota is full the API answers 503 and the page asks the user to wait.
The repo deploys as one Vercel project: the root HTML/CSS/JS are served as static files, and every /api/* request goes to one serverless function (api/index.js) that runs the same Express app as services/api (services/api/app.js).
Files involved:
package.json (repo root): dependencies the function needs (express, cors, dotenv, groq-sdk).api/index.js: exports the Express app as the function.vercel.json: sends /api/* to the function, bundles data/places/**, places_bkk_cnx.json and ai-engine/system-prompt.md with it, and allows up to 60 s per request.Steps:
tanyimcoffee-hub/AFO_team_fatzone.GROQ_API_KEY with your Groq key. Optional: OSRM_URL to use your own routing server.main, either set it as the Production Branch in Settings → Git, or open the branch's Preview deployment.https://<your-project>.vercel.app/api/health, then open the site and create a plan.Notes:
GROQ_API_KEY in the code. If it is missing, /api/plan answers 503 with a clear message.OSRM_URL.To test the same setup locally, install the Vercel CLI and run vercel dev from the repo root (it needs GROQ_API_KEY in a root .env, which is git-ignored).
Repo root, sharing styles.css and script.js (the browser script; not to be confused with services/api/app.js):
index.html (landing): quick-start box (origin, destination, days) that opens the chat page, ready-made trip templates, auto-scrolling feature cards, a region picker for all 77 provinces and a per-province place explorer.plan.html (chat page): a large chat window (trip form, AI replies, reply box for follow-up questions) next to a large map. Links can prefill it, e.g. plan.html?origin=กรุงเทพมหานคร&destination=จันทบุรี&days=2&go=1 (go=1 sends to the AI right away; other params: budget, travelers, tripType, interest)./api/route, with total distance and driving time. If routing fails, it falls back to a dashed straight line and says so. If Leaflet cannot load, an illustrative SVG diagram is shown instead.services/api)| Method | Path | Notes |
|---|---|---|
| GET | /api/health | Status check |
| POST | /api/plan | Body: origin, destination (required), days, budgetTHB, interests[], tripType (one_way/round_trip), travelers (1–50), message (follow-up text, ≤1000 chars), history (≤20 × {role: user|assistant, content}). Returns data = AI response (reply, status, trip, itinerary; stops get lat/lon when known) and meta (places sent, provinces, approximate origin/destination points, attribution). |
| GET | /api/places | Query: province (Thai or English name), type, q, limit (1–200, default 50), offset. |
| GET | /api/places/provinces | All 77 provinces with counts per type. |
| POST | /api/route | Body: points (2–25 × {lat, lon} in driving order). Returns distanceKm, durationMin, legs, geometry ([lat, lon] list) and attribution. Uses the public OSRM demo server by default (free, no key, best effort); set OSRM_URL to use another OSRM server. 400 bad input, 422 no road route, 502 routing service unavailable. |
Errors are { success: false, error } with 400 (bad input), 404 (unknown province), 502/503 (AI quota or bad AI output) or 500.
Tests: npm test in services/api (store) and in ai-engine (validators).
See data/places/README.md. Starter data comes from OpenStreetMap (© OpenStreetMap contributors, ODbL) and is marked unverified. Travel Data team files in data/places/team/ (and the original places_bkk_cnx.json) override OSM rows.