MyCoverLetterAssistant is a project that allows users to generate personalized cover letters based on the content of two plain text files. By providing a work proposal file and a curriculum vitae file, users can leverage the power of ChatGPT to automatically generate professional and tailored cover letters that align with their profiles and desired job positions.
- Deivid Johan Botina Monsalve
- Diana Marcela Marín Castrillón
Specifications (click to expand)
The MyCoverLetterAssistant project has been tested on a Lenovo ThinkPad P16s Gen 1 with the following specifications:
- Operating System: Ubuntu 22.04.2 LTS
- Python version: 3.10.6
Setting up a Virtual Environment (click to expand)
Make sure you have downloaded the repository and you are in it.
To utilize the MyCoverLetterAssistant, it is highly recommended to create a virtual environment. You have two options to set up the virtual environment: either from scratch or by using the provided requirements.txt file. Follow the instructions below to proceed with your preferred method:
Installation from scratch (click to expand)
- Install pip
$ sudo apt-get install python3-pip
- Install the virtualenv package
$ sudo apt-get install virtualenv
- Create a virtual environment with a desired name, for example "venv".
$ virtualenv venv
- Activate the virtual environment you just created.
$ source venv/bin/activate
- Check your Python version
$venv$ python --version
- Install the openai library
$venv$ pip install openai==0.27.8
- Install the dotenv library
$venv$ pip install python-dotenv
- Install the docx library
$venv$ pip install --upgrade python-docx
Installation from requirements.txt file (click to expand)
- Install pip
$ sudo apt-get install python3-pip
- Install the virtualenv package
$ sudo apt-get install virtualenv
- Create a virtual environment with a desired name, for example "venv".
$ virtualenv venv
- Activate the virtual environment you just created.
$ source venv/bin/activate
- Check your Python version
$venv$ python --version
- Use pip and specify your requirements.txt file path
$venv$ pip install -r requirements.txt
Docker
In process...
Before using the MyCoverLetterAssistant, you need to set up the necessary API key from OpenAI. Follow the steps below to obtain your OPENAI_API_KEY
:
- Visit the OpenAI website and create an account if you don't have one.
- Navigate to the API section and generate an API key.
- Copy the generated API key.
Next, create a file called .env
in the root folder of this repository. Open the .env
file and paste your OPENAI_API_KEY
into it. Save the file.
Make sure to keep your API key confidential and do not share it publicly.
Warning: Using the OpenAI models for generating cover letters may incur costs based on your usage. Please consider the pricing and terms of use of the OpenAI API to understand the potential charges you may incur.
To generate a cover letter using the MyCoverLetterAssistant, you can run the main.py
script with the following arguments:
Argument | Short Flag | Type | Description | Default | Required |
---|---|---|---|---|---|
--path_cv_file |
-pcf |
str | Path to the file containing the CV | CV.txt |
False |
--path_proposal_file |
-ppf |
str | Path to the file containing the work proposal | Proposal.txt |
False |
--out_path |
-op |
str | Path where the cover letter will be saved | Current directory | False |
--out_format |
-of |
str | Output file format. Options: txt , docx |
txt |
False |
--out_language |
-ol |
str | Output language. Options: ENGLISH , SPANISH , etc. |
ENGLISH |
False |
--model |
-m |
str | LLM name. Options: gpt-3.5-turbo , gpt-4 |
gpt-3.5-turbo |
False |
--temperature |
-t |
float | Temperature for text generation | 0.0 |
False |
--max_tokens |
-mt |
int | Maximum number of tokens to generate | 500 |
False |
To generate a cover letter, run the following command:
$ python main.py --path_cv_file <path_to_cv_file> --path_proposal_file <path_to_proposal_file> --out_path <output_directory>
The generated cover letter will be saved in the specified --out_path directory with the default format (txt) and language (ENGLISH).
You can customize the behavior by providing values for the desired arguments. For example, to generate a cover letter in french with the docx format and with a maximum of 1000 tokens, use the following command:
$ python main.py --path_cv_file <path_to_cv_file> --path_proposal_file <path_to_proposal_file> --out_path <output_directory> --out_format docx --max_tokens 1000 --out_language FRENCH
Supported languages include: SPANISH, ENGLISH, FRENCH, GERMAN, PORTUGUESE, and ITALIAN.
MyCoverLetterAssistant is for didactic purposes only, and commercial use is not allowed.