Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes made. #473

Merged
merged 27 commits into from
Oct 13, 2024
Merged

Changes made. #473

merged 27 commits into from
Oct 13, 2024

Conversation

queukat
Copy link
Collaborator

@queukat queukat commented Oct 4, 2024

Improvements:
New Method for Handling Pop-ups:

Added a new method handle_safety_reminder_modal to handle safety reminder modals and ensure smooth form submission without interruptions.
Resume Handling Logic Updated:

Introduced a new method is_resume_already_uploaded to check if a specific resume is already uploaded, avoiding unnecessary re-uploads.
Enhanced the logic to skip resume re-upload if it is already present, improving performance and avoiding duplicate uploads.
Error Handling Enhanced:

Updated error handling in various methods to provide more meaningful error messages and reduce code redundancy.
Improved logging and exception management in critical sections to help with debugging.
Modular Code Structure:

Some methods have been slightly refactored and broken down into smaller functions, making the code more modular and easier to read.
Additions:
Safety Reminder Handling:

Added code to detect and click the “Continue applying” button on the job safety reminder modal if it appears, ensuring the application process is not blocked.
Resume Check Mechanism:

Implemented logic to verify if a resume with a specific filename is already uploaded before attempting to upload it again.
Improved Button Handling:

Added code to handle cases where the Easy Apply button might be hidden or hard to interact with by using multiple search strategies (ActionChains and JavaScript).
Minor Fixes:
Improved Focus Management:

Added a few additional lines to remove focus from irrelevant elements (e.g., URL bar) to reduce interaction errors when clicking buttons.
Refined Textbox Handling:

Updated logic for textbox handling to include automatic dropdown selection after filling in text fields, ensuring values are correctly recognized by the system.
General Code Cleanup:

Removed some redundant lines and unnecessary error logs to streamline the overall code structure.
These changes enhance stability, improve automation reliability, and add mechanisms for better handling of unexpected modals and resume management.

@queukat queukat changed the title Update job_application_profile.py DO NOT REVIEW OR TOUCH - WORK IN PROGRESS - NOT READY YET, DON'T EVEN THINK ABOUT IT Oct 4, 2024
@queukat queukat changed the title DO NOT REVIEW OR TOUCH - WORK IN PROGRESS - NOT READY YET, DON'T EVEN THINK ABOUT IT Changes made. Need to update the description. Oct 5, 2024
@queukat queukat marked this pull request as ready for review October 5, 2024 18:58
@queukat queukat changed the title Changes made. Need to update the description. Changes made. Oct 5, 2024
@queukat
Copy link
Collaborator Author

queukat commented Oct 5, 2024

@feder-cr After merging this PR, create a new release.


parameters['uploads'] = FileManager.file_paths_to_dict(resume, plain_text_resume_file)
parameters['outputFileDirectory'] = output_folder

create_and_run_bot(parameters, llm_api_key)
create_and_run_bot(email, password, parameters, llm_api_key)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main has too many unnecessary logs, and its making code unreadable. The raise error is sufficient in all the case.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use wrapper if we need to keep so many debug logs?

class LoggerWrapper:
    def __init__(self, logger):
        self.logger = logger
        self.debug_mode = os.environ.get('DEBUG', 'False').lower() == 'true'

    def debug(self, message, *args, **kwargs):
        if self.debug_mode:
            self.logger.debug(message, *args, **kwargs)

    def info(self, message, *args, **kwargs):
        self.logger.info(message, *args, **kwargs)

    def __getattr__(self, name):
        return getattr(self.logger, name)

def start(self):
logger.info("Starting Chrome browser to log in to AIHawk.")
logger.info("Starting Chrome browser to log in to LinkedIn.")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this log could be misleading, as the browser depends on the engine. Wouldn't it be better to change to browser?


# Ожидание появления поля для ввода email
logger.debug("Waiting for the email input field to be present...")
email_field = WebDriverWait(self.driver, 15).until(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, could you explain this section. Especially why wait for 15 sec? Is this manual input ?

required_keys = {
'remote': bool,
'experienceLevel': dict,
'experience_level': dict,
'jobTypes': dict,
'date': dict,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats this date? shouldn't it be in str, dict, tuple format?

phone: str
email: str
github: str
linkedin: str
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this field be optional?
or have default value of NA

  • github can be NA
  • linkedin can be NA as some users may not be interested to provide

@@ -124,7 +124,7 @@ def _create_model(self, config: dict, api_key: str) -> AIModel:
elif llm_model_type == "gemini":
return GeminiModel(api_key, llm_model)
elif llm_model_type == "huggingface":
return HuggingFaceModel(api_key, llm_model)
return HuggingFaceModel(api_key, llm_model)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be wrapper in function for python 3.10

match llm_model_type:
    case "openai":
        return OpenAIModel(api_key, llm_model)
    case "claude":
        return ClaudeModel(api_key, llm_model)
    case "ollama":
        return OllamaModel(llm_model, llm_api_url)
    case "gemini":
        return GeminiModel(api_key, llm_model)
    case "huggingface":
        return HuggingFaceModel(api_key, llm_model)
    case _:
        raise ValueError(f"Unsupported model type: {llm_model_type}")

Copy link

@nile649 nile649 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made comments which i thought could improve readability. No obvious issues found on first glance. Didn't try running locally.

@burn0ut7
Copy link

burn0ut7 commented Oct 8, 2024

Great work. All changes look good

@Axedyson
Copy link
Contributor

Axedyson commented Oct 8, 2024

@queukat Great work.

While you're at it could you fix this issue as part of this PR? I think it's very easily fixed by following the discussion.

@Axedyson
Copy link
Contributor

Axedyson commented Oct 8, 2024

@queukat Great work.

While you're at it could you fix this issue as part of this PR? I think it's very easily fixed by following the discussion.

Wait a minute, the utils.py file is not part of the source code in this repo :/

This is the utils file I'm talking about which is in another repo.

@feder-cr feder-cr merged commit e3cb3dc into AIHawk-FOSS:v4 Oct 13, 2024
1 check passed
@feder-cr
Copy link
Collaborator

@queukat can you merge with main? Because I want delete v4 for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants