fix issue with early returns in python sdk #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to the
python/src/reag/client.pyfile to improve the parallel processing of document batches and minor adjustments in thepython/tests/test_client.pyfile. The most important changes include adding asynchronous processing for document batches and reorganizing the return statement for clarity.Improvements to parallel processing:
python/src/reag/client.py: Added tasks for parallel processing within the batch and usedasyncio.gatherto process all documents in the batch concurrently. This change improves the efficiency of handling document batches.Code organization and readability:
python/src/reag/client.py: Moved the return statement outside the batch loop to ensure all results are returned after processing all batches. This change clarifies the flow of the function.Minor code adjustments:
python/tests/test_client.py: Fixed the import statement to correctly importReagClient,Document, andQueryResultfromreag.clientinstead ofsrc.reag.client.