wwzeng1 / privateGPT

Interact with your documents using the power of GPT, 100% privately, no data leaks
https://docs.privategpt.dev
Apache License 2.0
0 stars 0 forks source link

Refactor retrieve_relevant function in chunks_service.py #3

Closed sweep-nightly[bot] closed 11 months ago

sweep-nightly[bot] commented 11 months ago

Description

This PR refactors the retrieve_relevant function in chunks_service.py to improve modularity and readability. The function was quite large and complex, so it has been broken down into smaller subfunctions to reduce complexity. Additionally, unit tests have been added to ensure the correctness of the refactored code.

Summary of Changes

Please review and merge this PR. Thank you!

Fixes #1.


πŸŽ‰ Latest improvements to Sweep:


πŸ’‘ To get Sweep to edit this pull request, you can:

sweep-nightly[bot] commented 11 months ago

Sandbox Executions

pre-commit install 1/2 βœ“
pre-commit installed at .git/hooks/pre-commit
pre-commit installed at .git/hooks/pre-push
poetry install 2/2 ❌ (`1`)
The currently activated Python version 3.10.12 is not supported by the project (>=3.11,<3.12).
Trying to find and use a compatible version. 
Poetry was unable to find a compatible version. If you have one, you can explicitly use it via the "env use" command.

pre-commit install 1/2 βœ“
pre-commit installed at .git/hooks/pre-commit
pre-commit installed at .git/hooks/pre-push
poetry install 2/2 ❌ (`1`)
The currently activated Python version 3.10.12 is not supported by the project (>=3.11,<3.12).
Trying to find and use a compatible version. 
Poetry was unable to find a compatible version. If you have one, you can explicitly use it via the "env use" command.

pre-commit install 1/2 βœ“
pre-commit installed at .git/hooks/pre-commit
pre-commit installed at .git/hooks/pre-push
poetry install 2/2 ❌ (`1`)
The currently activated Python version 3.10.12 is not supported by the project (>=3.11,<3.12).
Trying to find and use a compatible version. 
Poetry was unable to find a compatible version. If you have one, you can explicitly use it via the "env use" command.

sweep-nightly[bot] commented 11 months ago

Apply Sweep Rules to your PR?