-
Notifications
You must be signed in to change notification settings - Fork 32
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
Changed gpt prompt #154
Changed gpt prompt #154
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,19 +11,37 @@ def test_simple_gpt(): | |
""" | ||
Testing the simple_gpt function | ||
Calls the simple gpt and asks it to output | ||
"gpt works". If anything else is outputted, we can | ||
assume an error has occured | ||
the days of the week. If the output does not contain | ||
any day of the week, we assume the gpt is non-fucntional | ||
""" | ||
|
||
surf_summary = ( | ||
"Please respond with the exact phrase 'gpt works'. " | ||
"Do not include any additional text or context." | ||
) | ||
surf_summary = "" | ||
gpt_prompt = ( | ||
"""Please output the days of the week in English. What day | ||
is your favorite?""" | ||
) | ||
|
||
gpt_response = gpt.simple_gpt(surf_summary, gpt_prompt).lower() | ||
expected_response = set([ | ||
"monday", | ||
"tuesday", | ||
"wednesday", | ||
"thursday", | ||
"friday" | ||
"saturday", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (testing): Missing comma after 'friday' in the expected response set This syntax error will cause the test to fail. Add a comma after 'friday' to properly separate the list elements. |
||
"sunday", | ||
"一", | ||
"二", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (testing): The expected response set includes Chinese numerals which don't align with the test's purpose The test description mentions 'days of the week in English', but the expected response includes Chinese numerals ('一', '二', etc.). These should be removed to maintain consistency with the test's purpose. |
||
"三", | ||
"四", | ||
"五" | ||
]) | ||
|
||
# Can case the "gpt_response" string into a list, and | ||
# check for set intersection with the expected response set | ||
gpt_response_set = set(gpt_response.split()) | ||
|
||
gpt_prompt = "This is for testing purposes" | ||
gpt_response = gpt.simple_gpt(surf_summary, gpt_prompt) | ||
expected_response = "gpt works" | ||
|
||
assert ( | ||
gpt_response == expected_response | ||
gpt_response_set.intersection(expected_response) | ||
), f"Expected '{expected_response}', but got: {gpt_response}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (code-quality): Unwrap a constant iterable constructor (
unwrap-iterable-construction
)