Closed macnult closed 1 month ago
This pull request revises the GPT prompt in the test_gpt.py file to address a reported issue. The changes include updating the test prompt for more precise output and enhancing the assertion message for better error reporting.
No diagrams generated as the changes look simple and do not need a visual representation.
Change | Details | Files |
---|---|---|
Revised GPT prompt for more precise output |
|
tests/test_gpt.py |
Enhanced assertion message for better error reporting |
|
tests/test_gpt.py |
The test still passes/fails inconsistently. When it does fail, it returns the following:
assert gpt_response == expected_response, f"Expected '{expected_response}', but got: {gpt_response}" E AssertionError: Expected 'gpt works', but got: I'm here to help with any inquiries you may have. How can I assist you today? E assert "I'm here to ...st you today?" == 'gpt works' E E - gpt works E + I'm here to help with any inquiries you may have. How can I assist you today?
tests\test_gpt.py:22: AssertionError
The same thing happens with test_helper.py, although not as frequent. Locally I changed gpt_prompt in test_helper.py which helps during some tests, but isn't consistent to where I can call it resolved.
The test still passes/fails inconsistently. When it does fail, it returns the following:
assert gpt_response == expected_response, f"Expected '{expected_response}', but got: {gpt_response}" E AssertionError: Expected 'gpt works', but got: I'm here to help with any inquiries you may have. How can I assist you today? E assert "I'm here to ...st you today?" == 'gpt works' E E - gpt works E + I'm here to help with any inquiries you may have. How can I assist you today?
tests\test_gpt.py:22: AssertionError
The same thing happens with test_helper.py, although not as frequent. Locally I changed gpt_prompt in test_helper.py which helps during some tests, but isn't consistent to where I can call it resolved.
The test still passes/fails inconsistently. When it does fail, it returns the following:
assert gpt_response == expected_response, f"Expected '{expected_response}', but got: {gpt_response}" E AssertionError: Expected 'gpt works', but got: I'm here to help with any inquiries you may have. How can I assist you today? E assert "I'm here to ...st you today?" == 'gpt works' E E - gpt works E + I'm here to help with any inquiries you may have. How can I assist you today?
tests\test_gpt.py:22: AssertionError
The same thing happens with test_helper.py, although not as frequent. Locally I changed gpt_prompt in test_helper.py which helps during some tests, but isn't consistent to where I can call it resolved.
The gpt is definitely finicky, but your prompt seems to be the better choice. Might have to rethink this going forward but I'll merge your PR as its an improvement!
All modified and coverable lines are covered by tests :white_check_mark:
@macnult whoops, actually the linter failed. Can you run make lint
to fix the error?
@ryansurf Sure thing! Should be good to go now.
@all-contributors please add @macnult for code
@ryansurf
I've put up a pull request to add @macnult! :tada:
General:
Code:
[✓] Does your submission pass tests?
Documentation:
Revised the GPT prompt in response to this reported issue: https://github.com/ryansurf/cli-surf/issues/146 I also added to the assertion to see what's returned if the test fails.
Summary by Sourcery
Revise the GPT prompt in the test to ensure precise response matching and enhance the assertion to provide detailed feedback on test failures.
Enhancements:
Tests: