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: moved more core files to util module #312

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

ErikBjare
Copy link
Owner

@ErikBjare ErikBjare commented Dec 8, 2024

Important

Refactor by moving context.py, export.py, and reduce.py to util module and updating import paths in various files.

  • Refactor:
    • Move context.py, export.py, and reduce.py to util module.
    • Update import paths in chat.py, commands.py, and logmanager.py to reflect new locations.
  • Imports:
    • Change import of use_fresh_context in chat.py and logmanager.py.
    • Change import of export_chat_to_html in commands.py.
    • Change import of limit_log and reduce_log in logmanager.py.
  • Tests:
    • Update import of reduce_log and truncate_msg in test_reduce.py.

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

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 113d2c1 in 11 seconds

More details
  • Looked at 131 lines of code in 7 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. gptme/chat.py:10
  • Draft comment:
    Remove the unused import statement for use_fresh_context since it has been moved to the util module.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The import statement for use_fresh_context has been moved to the util module, but the import statement in gptme/chat.py was not removed. This is a minor issue but should be corrected for consistency and to avoid confusion.

Workflow ID: wflow_NJzAYJxMY6gFdMfC


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

@ErikBjare ErikBjare force-pushed the dev/refactor-more-to-util branch from 113d2c1 to 8ad8f59 Compare December 8, 2024 18:02
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! Incremental review on 8ad8f59 in 24 seconds

More details
  • Looked at 169 lines of code in 9 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. gptme/util/export.py:2
  • Draft comment:
    The import json is unused and can be removed to clean up the code. This is also applicable to other files where unused imports are present.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The import statements in the files have been updated to reflect the new module structure. However, there are some unused imports that should be removed to clean up the code.
2. gptme/util/interrupt.py:5
  • Draft comment:
    The import os is unused and can be removed to clean up the code. This is also applicable to other files where unused imports are present.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The import statements in the files have been updated to reflect the new module structure. However, there are some unused imports that should be removed to clean up the code.
3. gptme/util/reduce.py:8
  • Draft comment:
    The import logging is unused and can be removed to clean up the code. This is also applicable to other files where unused imports are present.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The import statements in the files have been updated to reflect the new module structure. However, there are some unused imports that should be removed to clean up the code.

Workflow ID: wflow_8gSH8j9TMi4Egx7G


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

@ErikBjare ErikBjare force-pushed the dev/refactor-more-to-util branch from 8ad8f59 to 2912086 Compare December 8, 2024 18:04
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! Incremental review on 2912086 in 33 seconds

More details
  • Looked at 212 lines of code in 11 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. tests/test_context.py:5
  • Draft comment:
    Update import to reflect new module structure.
from gptme.util.context import append_file_content, file_to_display_path, gather_fresh_context, get_mentioned_files
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. tests/test_reduce.py:4
  • Draft comment:
    Update import to reflect new module structure.
from gptme.util.reduce import reduce_log, truncate_msg
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_jLrnKaIZ4T0jNyb0


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

@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.96%. Comparing base (4ff383a) to head (2912086).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #312   +/-   ##
=======================================
  Coverage   73.96%   73.96%           
=======================================
  Files          68       68           
  Lines        4948     4948           
=======================================
  Hits         3660     3660           
  Misses       1288     1288           
Flag Coverage Δ
anthropic/claude-3-haiku-20240307 71.96% <100.00%> (-0.09%) ⬇️
openai/gpt-4o-mini 70.79% <100.00%> (+0.08%) ⬆️

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 0ee07cf into master Dec 8, 2024
7 checks passed
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