Skip to content

dylantarre/tour-date-drake

Repository files navigation

Tour Date Drake

Drake Emoji

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. 🦉🔥

Features

  • 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

Requirements

  • Docker
  • OpenRouter API key
  • Discord bot token (optional)

Setup

  1. 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
  1. 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

Discord Bot Setup

  1. Create a new Discord application at https://discord.com/developers/applications
  2. Create a bot for your application and copy the token
  3. Add the bot token to your .env file
  4. Run the bot:
python bot_runner.py

Discord Commands

  • /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

API Endpoints

Format Text

curl -X POST "http://localhost:4343/format/text" \
     -H "Content-Type: application/json" \
     -d '{"text": "1/1 New York, NY @ Madison Square Garden"}'

Format Image

curl -X POST "http://localhost:4343/format/image" \
     -H "Content-Type: multipart/form-data" \
     -F "file=@path/to/image.jpg"

Response Format

Both endpoints return JSON in the format:

{
    "formatted_dates": "MM/DD City, ST @ Venue Name\nMM/DD City, ST @ Venue Name"
}

Error Handling

Errors are returned as HTTP status codes with JSON details:

{
    "detail": "Error message"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published