Jobs_Applier_AI_Agent_AIHawk icon indicating copy to clipboard operation
Jobs_Applier_AI_Agent_AIHawk copied to clipboard

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

Open gvermag22 opened this issue 1 year ago • 3 comments

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="[email protected]", 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 avatar Oct 10 '24 23:10 gvermag22

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

gvermag22 avatar Oct 10 '24 23:10 gvermag22

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

gvermag22 avatar Oct 10 '24 23:10 gvermag22

Hello, @feder-cr any thoughts on this

gvermag22 avatar Oct 13 '24 09:10 gvermag22

@gvermag22 were you able to find a solution?

distortment avatar Oct 25 '24 12:10 distortment

No

On Fri, Oct 25, 2024 at 5:34 AM distortment @.***> wrote:

@gvermag22 https://github.com/gvermag22 were you able to find a solution?

— Reply to this email directly, view it on GitHub https://github.com/feder-cr/Auto_Jobs_Applier_AIHawk/issues/511#issuecomment-2437662488, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQCIRBPWYFRIEC6DC7BVMQLZ5I3FVAVCNFSM6AAAAABPXZI6G2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZXGY3DENBYHA . You are receiving this because you were mentioned.Message ID: @.***>

gvermag22 avatar Oct 25 '24 15:10 gvermag22