tour-parser
v1.0.0
Published
A small tool that extracts places from a travel paragraph using OpenAI and geocodes (Google Maps API) them with Google Maps Geocoding API.
Downloads
8
Readme
tour-parser
A small tool that extracts places from a travel paragraph using OpenAI and geocodes (Google Maps API) them with Google Maps Geocoding API.
Prerequisites
- Node.js 18+
- OpenAI API key
- Google Maps Geocoding API key
Setup
Install dependencies:
npm installCreate a
.envfile in the project root with:OPENAI_API_KEY=your_openai_api_key_here OPENAI_MODEL=gpt-4o-mini GOOGLE_API_KEY=your_google_maps_api_key_here
Run
Run with your own paragraph:
npm start -- "We started in Delhi, passed by Agra Fort, and visited Jaipur."Notes:
- The
--ensures the quoted string is passed tonode src/index.js. - You can also run directly:
node src/index.js "We started in Delhi, passed by Agra Fort, and visited Jaipur."
- The
Quick test (uses the sample from package.json):
npm run test
Output
The tool prints a JSON object like:
{
"tour_text": "We started in Delhi, passed by Agra Fort, and visited Jaipur.",
"places": [
{
"name": "Delhi",
"visited": true,
"passby": false,
"lat": 28.6139,
"lon": 77.209
}
],
"metadata": {
"model": "gpt-4o-mini",
"geocoder": "Google Maps Geocoding API",
"timestamp": "2025-01-01T12:00:00.000Z"
}
}Notes
- Make sure billing/quotas are enabled for both OpenAI and Google Maps APIs.
- if you find any error or issue DM to [email protected]
