Skip to content

Commit

Permalink
Merge pull request #895 from AIHawk-FOSS/hotfix/v2024.11.18
Browse files Browse the repository at this point in the history
  • Loading branch information
surapuramakhil authored Nov 21, 2024
2 parents a87f134 + 6d6f1f1 commit 2b72062
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ langchain==0.2.11
langchain-anthropic
langchain-huggingface
langchain-community==0.2.10
langchain-core===0.2.36
langchain-core==0.2.36
langchain-google-genai==1.0.10
langchain-ollama==0.1.3
langchain-openai==0.1.17
Expand Down
10 changes: 8 additions & 2 deletions src/ai_hawk/llm/llm_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,14 @@ def is_job_suitable(self):
)
output = self._clean_llm_output(raw_output)
logger.debug(f"Job suitability output: {output}")
score = re.search(r"Score: (\d+)", output).group(1)
reasoning = re.search(r"Reasoning: (.+)", output, re.DOTALL).group(1)

try:
score = re.search(r"Score:\s*(\d+)", output, re.IGNORECASE).group(1)
reasoning = re.search(r"Reasoning:\s*(.+)", output, re.IGNORECASE | re.DOTALL).group(1)
except AttributeError:
logger.warning("Failed to extract score or reasoning from LLM. Proceeding with application, but job may or may not be suitable.")
return True

logger.info(f"Job suitability score: {score}")
if int(score) < JOB_SUITABILITY_SCORE:
logger.debug(f"Job is not suitable: {reasoning}")
Expand Down

0 comments on commit 2b72062

Please sign in to comment.