Skip to content

Commit

Permalink
add threshold to test_gen_prompt function
Browse files Browse the repository at this point in the history
  • Loading branch information
Windsooon committed Dec 26, 2023
1 parent 71b1776 commit 36150aa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ class TestChatBot(unittest.TestCase):
def test_gen_prompt(self, mock_model_list):
mock_model_list.return_value = MODEL_LIST_RETURN
chat_bot = ChatGPT()
info = "test email body"
expected_prompt = '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
self.assertEqual(chat_bot.gen_prompt(info), expected_prompt)
info = "This is a test email body."
expected_threshold = 80 # Replace with the actual threshold value used in your method
expected_output = (
f'If this email has a {expected_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}')
self.assertEqual(chat_bot.gen_prompt(info), expected_output)


class TestChatGPT(unittest.TestCase):
Expand Down

0 comments on commit 36150aa

Please sign in to comment.