This FastAPI service keeps tour dates clean and structured, pulling from text and images with OpenRouter’s AI. Optional Discord bot included. No more messy dates. 🦉🔥
- Text input: Format tour dates from text using GPT-4
- Image input: Extract and format tour dates from images using Claude-3
- Consistent output format: MM/DD City, ST @ Venue Name
- Discord bot integration: Use the service directly from Discord
- Docker
- OpenRouter API key
- Discord bot token (optional)
- Create a
.env
file with your API keys:
OPENROUTER_API_KEY=your_key_here
DISCORD_TOKEN=your_discord_token_here # Optional, for Discord bot
API_URL=http://localhost:4343 # URL where the API is running
- Build and run the Docker container:
docker build -t tour-date-drake .
docker run -p 4343:4343 --env-file .env tour-date-drake
The API will be available at http://localhost:4343
- Create a new Discord application at https://discord.com/developers/applications
- Create a bot for your application and copy the token
- Add the bot token to your
.env
file - Run the bot:
python bot_runner.py
/dates [text]
- Format tour dates from text/image [attachment]
- Extract tour dates from an uploaded image/imageurl [url]
- Extract tour dates from an image URL
curl -X POST "http://localhost:4343/format/text" \
-H "Content-Type: application/json" \
-d '{"text": "1/1 New York, NY @ Madison Square Garden"}'
curl -X POST "http://localhost:4343/format/image" \
-H "Content-Type: multipart/form-data" \
-F "file=@path/to/image.jpg"
Both endpoints return JSON in the format:
{
"formatted_dates": "MM/DD City, ST @ Venue Name\nMM/DD City, ST @ Venue Name"
}
Errors are returned as HTTP status codes with JSON details:
{
"detail": "Error message"
}