Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Powered Cover Letter Generator

This project is an interactive web application built with Chainlit that helps users create professional, tailored cover letters. Users can upload their CV/resume, provide a job description, and receive a customized cover letter with the option to request revisions.

🌟 Features

  • Smart Document Processing: Supports both PDF and Word (.docx) file uploads for CV/resume
  • AI-Powered Generation: Creates personalized cover letters powered by OpenAI.
  • Interactive Revision System: Users can request up to 5 revisions with specific feedback (integrated feedback loop)
  • Multiple Output Formats: Provides both readable text output. Word document output to be added.
  • User-Friendly Interface: Step-by-step guidance through the cover letter creation process

🎯 Prerequisites

  • Python 3.8+
  • OpenAI API key

🚀 Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/cover-letter-generator.git
    cd cover-letter-generator
  2. Create a virtual environment (recommended):

    python -m venv venv
    # On Windows: venv\Scripts\activate
    # On Mac: source venv/bin/activate
  3. Install required packages:

    pip install -r requirements.txt
  4. Create a .env file in the project root and add your OpenAI API key:

    OPENAI_API_KEY=your_api_key_here
    

💻 Usage

  1. Start the application:

    # On Windows: py main.py
    # On Mac: python3 main.py
  2. Open your browser and navigate to the displayed URL (typically http://localhost:8000) - System may open the browser on its own.

  3. Follow the application workflow:

    • Paste the job description
    • Upload your CV/resume (PDF or Word format)
    • Review the generated cover letter
    • Request revisions if needed (up to 5)

🔧 How It Works

  1. Job Description Processing: The application validates the job description for minimum length requirements
  2. CV/Resume Extraction: Extracts text from uploaded PDF or Word documents
  3. AI Generation: Uses a carefully crafted prompt template to generate a professional cover letter that:
    • Matches job requirements
    • Highlights relevant skills and achievements
    • Maintains professional tone
    • Fits on one page
    • Includes strong opening and closing paragraphs
  4. Revision System: Allows targeted revisions based on user feedback while preserving the original structure

📦 Dependencies

  • chainlit: Web interface framework
  • langchain & langchain_openai: OpenAI integration and prompt management
  • pdfplumber: PDF text extraction
  • docx2txt: Word document text extraction
  • python-docx: Word document creation
  • python-dotenv: Environment variable management

⚙️ Configuration

The application uses a temperature of 0.6 for balanced creativity. These settings can be adjusted in the code:

llm = ChatOpenAI(
    model_name="gpt-3.5-turbo",
    temperature=0.6,
    openai_api_key=openai_api_key
)

⚠️ Limitations

  • Maximum 5 revisions per cover letter session
  • Supports only PDF and Word (.docx) formats for CV/resume
  • Job description must be at least 20 words
  • CV/resume must be at least 50 words

Acknowledgments

About

Generate a personalized cover letter for a job posting.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages