Skip to content

Commit

Permalink
Merge pull request #32 from Windsooon/add-threshold
Browse files Browse the repository at this point in the history
add threshold feature
  • Loading branch information
Windsooon authored Dec 23, 2023
2 parents 0a1495d + e6b4845 commit fa70e5d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Configure logging
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')

def process_email(email_path, model):
def process_email(email_path):
'''
Process the emails at the given path and return the results.
Expand Down Expand Up @@ -55,8 +55,8 @@ def export_to_csv(data, filename):
for row in data:
writer.writerow(row)

def main(email_path, output_csv, model):
result = process_email(email_path, model)
def main(email_path, output_csv):
result = process_email(email_path)
if result:
export_to_csv(result, output_csv)
logging.info(f"Processed emails successfully and exported to CSV at {output_csv}.")
Expand Down
4 changes: 2 additions & 2 deletions src/JobTracker/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def get_cost(self, mails):

def gen_prompt(self, info):
"""Generate a prompt for the chatbot."""
return ('If this is a mail from a company I applied to or interviewed with before, '
'use get_mail_info to get information, here is the mail body: ' + info)
return (f'If this email has a {THRESHOLD}% confidence level that it is from a company I applied to or interviewed with before, '
f'use get_mail_info to get information, otherwise just ignore it. Here is the mail body: {info}')

def get_content(self, info):
"""Get content from the chatbot based on the provided information."""
Expand Down
2 changes: 1 addition & 1 deletion src/JobTracker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
MODEL = 'gpt-4-1106-preview'
LLAMA_URL = "http://127.0.0.1:11434/api/generate"
LLAMA_MODEL = "llama2"
THRESHOLD = 30
THRESHOLD = 80
FIX_ANSWER = False

PRICE = {
Expand Down

0 comments on commit fa70e5d

Please sign in to comment.