Skip to content
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

refactor: extracted chat and step from cli.py into new chat.py #158

Merged
merged 2 commits into from
Oct 6, 2024

Conversation

ErikBjare
Copy link
Owner

@ErikBjare ErikBjare commented Oct 6, 2024

Important

Refactor chat and step functions into chat.py and move interrupt handling to interrupt.py for better code organization.

  • Refactoring:
    • Extracted chat and step functions from cli.py to chat.py.
    • Moved interrupt handling logic to new interrupt.py.
  • Imports:
    • Updated imports in cli.py to reflect new file structure.
  • Tests:
    • Updated test_server.py to import init from init.py instead of cli.py.

This description was created by Ellipsis for cafed49. It will automatically update as commits are pushed.

gptme/chat.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to cafed49 in 13 seconds

More details
  • Looked at 936 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. gptme/chat.py:32
  • Draft comment:
    The TODO comment suggests moving this function to a separate file. Since this refactoring already moved it to chat.py, consider updating or removing this comment.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The refactoring seems to have been done correctly, but there are some minor issues with the code style and consistency.
2. gptme/chat.py:251
  • Draft comment:
    The regex pattern uses backticks incorrectly for escaping. Use triple backticks for code blocks in markdown, not single backticks.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The refactoring seems to have been done correctly, but there are some minor issues with the code style and consistency.
3. gptme/chat.py:302
  • Draft comment:
    The backticks used here for code blocks are incorrect. Use triple backticks for markdown code blocks.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The refactoring seems to have been done correctly, but there are some minor issues with the code style and consistency.
4. gptme/chat.py:347
  • Draft comment:
    The backticks used here for code blocks are incorrect. Use triple backticks for markdown code blocks.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The refactoring seems to have been done correctly, but there are some minor issues with the code style and consistency.

Workflow ID: wflow_UWBV2mMHKFM8YuK1


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2024

Codecov Report

Attention: Patch coverage is 87.35632% with 22 lines in your changes missing coverage. Please review.

Project coverage is 80.46%. Comparing base (1a7e4ef) to head (352f1be).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
gptme/chat.py 86.62% 21 Missing ⚠️
gptme/config.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #158      +/-   ##
==========================================
+ Coverage   80.37%   80.46%   +0.09%     
==========================================
  Files          54       56       +2     
  Lines        3281     3297      +16     
==========================================
+ Hits         2637     2653      +16     
  Misses        644      644              
Flag Coverage Δ
anthropic/claude-3-haiku-20240307 79.40% <87.35%> (+0.10%) ⬆️
openai/gpt-4o-mini 79.19% <87.35%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ErikBjare ErikBjare merged commit 5081c89 into master Oct 6, 2024
7 checks passed
@ErikBjare ErikBjare deleted the dev/refactor-cli-file branch October 6, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants