feder-cr / Auto_Jobs_Applier_AIHawk

Auto_Jobs_Applier_AIHawk is a tool that automates the jobs application process. Utilizing artificial intelligence, it enables users to apply for multiple job offers in an automated and personalized way.
MIT License
17.08k stars 2.47k forks source link

[BUG]: Runtime error: Error running the bot: PersonalInformation.__init__() got an unexpected keyword argument 'zip_code' #511

Open gvermag22 opened 7 hours ago

gvermag22 commented 7 hours ago

Describe the bug

No response

Steps to reproduce

Followed instructions on https://github.com/feder-cr/Auto_Jobs_Applier_AIHawk?tab=readme-ov-file to setup on macOS. Had to installed many PIP modules on the way to make it work. Ultimately, got this error while running the main.py

gauravverma@mac Auto_Jobs_Applier_AIHawk % python3 main.py
2024-10-10 16:08:25.006 | ERROR | main:main:213 - Runtime error: Error running the bot: PersonalInformation.init() got an unexpected keyword argument 'zip_code' 2024-10-10 16:08:25.006 | ERROR | main:main:215 - Refer to the configuration and troubleshooting guide: https://github.com/feder-cr/AIHawk_AIHawk_automatic_job_application/blob/main/readme.md#configuration

Perpelexity suggests there is mismatch in the names of variables or pameters in the code

The error you're encountering is a TypeError related to an unexpected keyword argument. Specifically, the error message indicates that the PersonalInformation class's __init__() method received an unexpected keyword argument 'zip_code'[1][3]. This type of error occurs when a function or method is called with an argument it wasn't designed to accept[1].

To resolve this issue, you should:

  1. Check the PersonalInformation class definition:

    • Ensure that the __init__() method of the PersonalInformation class is defined to accept a zip_code parameter.
    • If it's not meant to accept zip_code, remove this argument when creating an instance of PersonalInformation.
  2. Review your configuration:

    • Look at the configuration file or the part of your code where you're creating an instance of PersonalInformation.
    • Make sure the parameters you're passing match the expected arguments of the class.
  3. Update your code:

    • If zip_code is a required field, modify the PersonalInformation class to accept it.
    • If it's not required, remove it from where you're creating the PersonalInformation object.
  4. Check for version mismatches:

    • Ensure you're using the correct version of the AIHawk library that matches your code.
    • Sometimes, different versions of libraries can have different method signatures.
  5. Consult the documentation:

    • As suggested in the error message, refer to the configuration and troubleshooting guide at the provided GitHub link[4].

Here's an example of how the PersonalInformation class might be defined to accept zip_code:

class PersonalInformation:
    def __init__(self, name, email, phone, address, zip_code):
        self.name = name
        self.email = email
        self.phone = phone
        self.address = address
        self.zip_code = zip_code

If this is how your class is defined, ensure you're passing all these parameters when creating an instance:

personal_info = PersonalInformation(name="John Doe", email="john@example.com", phone="1234567890", address="123 Main St", zip_code="12345")

If you continue to face issues, consider reaching out to the maintainers of the AIHawk project for more specific guidance related to their implementation.

Citations: [1] https://www.askpython.com/python/examples/unexpected-keyword-argument-typeerror [2] https://stackoverflow.com/questions/72803759/unexpected-keyword-argument-simple-zipcode [3] https://stackoverflow.com/questions/57505839/why-am-i-getting-this-unexpected-keyword-argument-typeerror [4] https://www.reddit.com/r/learnmachinelearning/comments/x4byoy/typeerror_init_got_an_unexpected_keyword_argument/

Expected behavior

job application to happen

Actual behavior

runtime error

Branch

main

Branch name

No response

Python version

3.10

LLM Used

OpenAI

Model used

GPT-4o

Additional context

No response

gvermag22 commented 7 hours ago

Also the file https://github.com/feder-cr/AIHawk_AIHawk_automatic_job_application/blob/main/readme.md#configuration doesn't exist

gvermag22 commented 6 hours ago

also here are the modules I had to install, they should be included in the documentation:

pip3 install lib-resume-builder-AIHawk pip3 install loguru pip3 install levenshtein pip3 install levenshtein pip3 install inputimeout pip3 install reportlab