commit
cfbd77648d
7 changed files with 38 additions and 25 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
remote: [true/false]
|
remote: [true/false]
|
||||||
|
|
||||||
experienceLevel:
|
experience_level:
|
||||||
internship: [true/false]
|
internship: [true/false]
|
||||||
entry: [true/false]
|
entry: [true/false]
|
||||||
associate: [true/false]
|
associate: [true/false]
|
||||||
|
|
@ -31,7 +31,7 @@ locations:
|
||||||
- Country1
|
- Country1
|
||||||
- Country2
|
- Country2
|
||||||
|
|
||||||
applyOnceAtCompany: [true/false]
|
apply_once_at_company: [true/false]
|
||||||
|
|
||||||
distance: 100
|
distance: 100
|
||||||
|
|
||||||
|
|
@ -39,7 +39,7 @@ company_blacklist:
|
||||||
- Company1
|
- Company1
|
||||||
- Company2
|
- Company2
|
||||||
|
|
||||||
titleBlacklist:
|
title_blacklist:
|
||||||
- word1
|
- word1
|
||||||
- word2
|
- word2
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
remote: true
|
remote: true
|
||||||
|
|
||||||
experienceLevel:
|
experience_level:
|
||||||
internship: true
|
internship: true
|
||||||
entry: true
|
entry: true
|
||||||
associate: true
|
associate: true
|
||||||
|
|
@ -29,15 +29,21 @@ positions:
|
||||||
locations:
|
locations:
|
||||||
- USA
|
- USA
|
||||||
|
|
||||||
applyOnceAtCompany: [true/false]
|
apply_once_at_company: [true/false]
|
||||||
|
|
||||||
distance: 100
|
distance: 100
|
||||||
|
|
||||||
companyBlacklist:
|
company_blacklist:
|
||||||
- Noir
|
- Noir
|
||||||
- Crossover
|
- Crossover
|
||||||
|
|
||||||
titleBlacklist:
|
title_blacklist:
|
||||||
|
- word1
|
||||||
|
- word2
|
||||||
|
|
||||||
|
job_applicants_threshold:
|
||||||
|
min_applicants: 0
|
||||||
|
max_applicants: 100
|
||||||
|
|
||||||
llm_model_type: openai
|
llm_model_type: openai
|
||||||
llm_model: 'gpt-4o'
|
llm_model: 'gpt-4o'
|
||||||
|
|
|
||||||
4
main.py
4
main.py
|
|
@ -9,7 +9,7 @@ from selenium.webdriver.chrome.service import Service as ChromeService
|
||||||
from webdriver_manager.chrome import ChromeDriverManager
|
from webdriver_manager.chrome import ChromeDriverManager
|
||||||
from selenium.common.exceptions import WebDriverException, TimeoutException
|
from selenium.common.exceptions import WebDriverException, TimeoutException
|
||||||
from lib_resume_builder_AIHawk import Resume,StyleManager,FacadeManager,ResumeGenerator
|
from lib_resume_builder_AIHawk import Resume,StyleManager,FacadeManager,ResumeGenerator
|
||||||
from src.utils import chromeBrowserOptions
|
from src.utils import chrome_browser_options
|
||||||
from src.gpt import GPTAnswerer
|
from src.gpt import GPTAnswerer
|
||||||
from src.linkedIn_authenticator import LinkedInAuthenticator
|
from src.linkedIn_authenticator import LinkedInAuthenticator
|
||||||
from src.linkedIn_bot_facade import LinkedInBotFacade
|
from src.linkedIn_bot_facade import LinkedInBotFacade
|
||||||
|
|
@ -149,7 +149,7 @@ class FileManager:
|
||||||
|
|
||||||
def init_browser() -> webdriver.Chrome:
|
def init_browser() -> webdriver.Chrome:
|
||||||
try:
|
try:
|
||||||
options = chromeBrowserOptions()
|
options = chrome_browser_options()
|
||||||
service = ChromeService(ChromeDriverManager().install())
|
service = ChromeService(ChromeDriverManager().install())
|
||||||
return webdriver.Chrome(service=service, options=options)
|
return webdriver.Chrome(service=service, options=options)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
|
|
@ -14,3 +14,11 @@ click
|
||||||
git+https://github.com/feder-cr/lib_resume_builder_AIHawk.git
|
git+https://github.com/feder-cr/lib_resume_builder_AIHawk.git
|
||||||
linkedin-api
|
linkedin-api
|
||||||
pdfminer.six==20221105
|
pdfminer.six==20221105
|
||||||
|
inputimeout==1.0.4
|
||||||
|
langchain-ollama==0.1.3
|
||||||
|
langchain-anthropic==0.1.3
|
||||||
|
jsonschema==4.23.0
|
||||||
|
jsonschema-specifications==2023.12.1
|
||||||
|
httpx~=0.27.2
|
||||||
|
python-dotenv~=1.0.1
|
||||||
|
PyYAML~=6.0.2
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ class AIAdapter:
|
||||||
elif llm_model_type == "ollama":
|
elif llm_model_type == "ollama":
|
||||||
return OllamaModel(api_key, llm_model, llm_api_url)
|
return OllamaModel(api_key, llm_model, llm_api_url)
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unsupported model type: {model_type}")
|
raise ValueError(f"Unsupported model type: {llm_model_type}")
|
||||||
|
|
||||||
def invoke(self, prompt: str) -> str:
|
def invoke(self, prompt: str) -> str:
|
||||||
return self.model.invoke(prompt)
|
return self.model.invoke(prompt)
|
||||||
|
|
@ -204,7 +204,7 @@ class LoggerChatModel:
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
logger.debug("Attempting to call the LLM with messages")
|
logger.debug("Attempting to call the LLM with messages")
|
||||||
reply = self.llm(messages)
|
reply = self.llm.invoke(messages)
|
||||||
logger.debug("LLM response received: %s", reply)
|
logger.debug("LLM response received: %s", reply)
|
||||||
|
|
||||||
parsed_reply = self.parse_llmresult(reply)
|
parsed_reply = self.parse_llmresult(reply)
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,10 @@ class LinkedInJobManager:
|
||||||
def set_parameters(self, parameters):
|
def set_parameters(self, parameters):
|
||||||
logger.debug("Setting parameters for LinkedInJobManager")
|
logger.debug("Setting parameters for LinkedInJobManager")
|
||||||
self.company_blacklist = parameters.get('company_blacklist', []) or []
|
self.company_blacklist = parameters.get('company_blacklist', []) or []
|
||||||
self.title_blacklist = parameters.get('titleBlacklist', []) or []
|
self.title_blacklist = parameters.get('title_blacklist', []) or []
|
||||||
self.positions = parameters.get('positions', [])
|
self.positions = parameters.get('positions', [])
|
||||||
self.locations = parameters.get('locations', [])
|
self.locations = parameters.get('locations', [])
|
||||||
self.apply_once_at_company = parameters.get('applyOnceAtCompany', False)
|
self.apply_once_at_company = parameters.get('apply_once_at_company', False)
|
||||||
self.base_search_url = self.get_base_search_url(parameters)
|
self.base_search_url = self.get_base_search_url(parameters)
|
||||||
self.seen_jobs = []
|
self.seen_jobs = []
|
||||||
|
|
||||||
|
|
@ -120,8 +120,8 @@ class LinkedInJobManager:
|
||||||
if time_left > 0:
|
if time_left > 0:
|
||||||
try:
|
try:
|
||||||
user_input = inputimeout(
|
user_input = inputimeout(
|
||||||
prompt=f"Sleeping for {time_left} seconds. Press 'y' to skip waiting. Timeout 10 seconds : ",
|
prompt=f"Sleeping for {time_left} seconds. Press 'y' to skip waiting. Timeout 60 seconds : ",
|
||||||
timeout=10).strip().lower()
|
timeout=60).strip().lower()
|
||||||
except TimeoutOccurred:
|
except TimeoutOccurred:
|
||||||
user_input = '' # No input after timeout
|
user_input = '' # No input after timeout
|
||||||
if user_input == 'y':
|
if user_input == 'y':
|
||||||
|
|
@ -138,8 +138,8 @@ class LinkedInJobManager:
|
||||||
sleep_time = random.randint(5, 34)
|
sleep_time = random.randint(5, 34)
|
||||||
try:
|
try:
|
||||||
user_input = inputimeout(
|
user_input = inputimeout(
|
||||||
prompt=f"Sleeping for {sleep_time / 60} minutes. Press 'y' to skip waiting. Timeout 10 seconds : ",
|
prompt=f"Sleeping for {sleep_time / 60} minutes. Press 'y' to skip waiting. Timeout 60 seconds : ",
|
||||||
timeout=10).strip().lower()
|
timeout=60).strip().lower()
|
||||||
except TimeoutOccurred:
|
except TimeoutOccurred:
|
||||||
user_input = '' # No input after timeout
|
user_input = '' # No input after timeout
|
||||||
if user_input == 'y':
|
if user_input == 'y':
|
||||||
|
|
@ -160,8 +160,8 @@ class LinkedInJobManager:
|
||||||
if time_left > 0:
|
if time_left > 0:
|
||||||
try:
|
try:
|
||||||
user_input = inputimeout(
|
user_input = inputimeout(
|
||||||
prompt=f"Sleeping for {time_left} seconds. Press 'y' to skip waiting. Timeout 10 seconds : ",
|
prompt=f"Sleeping for {time_left} seconds. Press 'y' to skip waiting. Timeout 60 seconds : ",
|
||||||
timeout=10).strip().lower()
|
timeout=60).strip().lower()
|
||||||
except TimeoutOccurred:
|
except TimeoutOccurred:
|
||||||
user_input = '' # No input after timeout
|
user_input = '' # No input after timeout
|
||||||
if user_input == 'y':
|
if user_input == 'y':
|
||||||
|
|
@ -179,7 +179,7 @@ class LinkedInJobManager:
|
||||||
try:
|
try:
|
||||||
user_input = inputimeout(
|
user_input = inputimeout(
|
||||||
prompt=f"Sleeping for {sleep_time / 60} minutes. Press 'y' to skip waiting: ",
|
prompt=f"Sleeping for {sleep_time / 60} minutes. Press 'y' to skip waiting: ",
|
||||||
timeout=10).strip().lower()
|
timeout=60).strip().lower()
|
||||||
except TimeoutOccurred:
|
except TimeoutOccurred:
|
||||||
user_input = '' # No input after timeout
|
user_input = '' # No input after timeout
|
||||||
if user_input == 'y':
|
if user_input == 'y':
|
||||||
|
|
@ -370,7 +370,7 @@ class LinkedInJobManager:
|
||||||
url_parts = []
|
url_parts = []
|
||||||
if parameters['remote']:
|
if parameters['remote']:
|
||||||
url_parts.append("f_CF=f_WRA")
|
url_parts.append("f_CF=f_WRA")
|
||||||
experience_levels = [str(i + 1) for i, (level, v) in enumerate(parameters.get('experienceLevel', {}).items()) if
|
experience_levels = [str(i + 1) for i, (level, v) in enumerate(parameters.get('experience_level', {}).items()) if
|
||||||
v]
|
v]
|
||||||
if experience_levels:
|
if experience_levels:
|
||||||
url_parts.append(f"f_E={','.join(experience_levels)}")
|
url_parts.append(f"f_E={','.join(experience_levels)}")
|
||||||
|
|
@ -429,7 +429,6 @@ class LinkedInJobManager:
|
||||||
link_seen = link in self.seen_jobs
|
link_seen = link in self.seen_jobs
|
||||||
is_blacklisted = title_blacklisted or company_blacklisted or link_seen
|
is_blacklisted = title_blacklisted or company_blacklisted or link_seen
|
||||||
logger.debug("Job blacklisted status: %s", is_blacklisted)
|
logger.debug("Job blacklisted status: %s", is_blacklisted)
|
||||||
return is_blacklisted
|
|
||||||
|
|
||||||
return title_blacklisted or company_blacklisted or link_seen
|
return title_blacklisted or company_blacklisted or link_seen
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ from selenium import webdriver
|
||||||
log_file = "app_log.log"
|
log_file = "app_log.log"
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.DEBUG,
|
level=logging.INFO,
|
||||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||||
handlers=[
|
handlers=[
|
||||||
logging.FileHandler(log_file, mode='a', encoding='utf-8'),
|
logging.FileHandler(log_file, mode='a', encoding='utf-8'),
|
||||||
|
|
@ -22,7 +22,7 @@ file_handler = logging.FileHandler(log_file, mode='a', encoding='utf-8')
|
||||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||||
file_handler.setFormatter(formatter)
|
file_handler.setFormatter(formatter)
|
||||||
logger.addHandler(file_handler)
|
logger.addHandler(file_handler)
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
chromeProfilePath = os.path.join(os.getcwd(), "chrome_profile", "linkedin_profile")
|
chromeProfilePath = os.path.join(os.getcwd(), "chrome_profile", "linkedin_profile")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue