-
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
Conversation
Reviewer's Guide by SourceryThe pull request modifies the GPT test implementation by changing the test strategy from expecting an exact response to checking for the presence of day names in the response. This makes the test more robust by allowing for variations in the GPT model's output while still verifying its functionality. Class diagram for updated test_gpt.pyclassDiagram
class TestGpt {
- surf_summary: str
- gpt_prompt: str
- gpt_response: str
- expected_response: set
- gpt_response_set: set
+ test_simple_gpt()
}
note for TestGpt "Updated test strategy to check for presence of day names in the response."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
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.
Hey @ryansurf - I've reviewed your changes - here's some feedback:
Overall Comments:
- The test has become overly complex - consider simplifying it to just check for the presence of all English days of the week since that's what the prompt asks for. The Chinese numerals in the expected set don't align with the English-specific prompt.
- There's a syntax error in the expected_response set - missing comma after 'friday'. This will cause the set to be malformed.
- The empty surf_summary parameter seems incorrect - if this is meant to provide context to the GPT model, it should contain relevant information.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 2 issues found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
tests/test_gpt.py
Outdated
expected_response = set([ | ||
"monday", | ||
"tuesday", | ||
"wednesday", | ||
"thursday", | ||
"friday" | ||
"saturday", | ||
"sunday", | ||
"一", | ||
"二", |
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 (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.
tests/test_gpt.py
Outdated
"friday" | ||
"saturday", |
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 (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.
) | ||
|
||
gpt_response = gpt.simple_gpt(surf_summary, gpt_prompt).lower() | ||
expected_response = set([ |
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
)
General:
Code:
test_gpt was failing. New prompt should work better
Summary by Sourcery
Bug Fixes: