♻️ rework product base classes - #456
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the Mindee V2 “product” base classes by renaming/reshaping the shared response and parameters abstractions, and propagating those new names through products, commands, and the HTTP/client layers.
Changes:
- Replace
BaseResponsewithBaseInferenceResponseacross V2 inference responses and parsing exports. - Replace
BaseParameterswithBaseProductParametersand renameget_form_data()toget_request_parameters()across products/commands/HTTP. - Update V2 client + HTTP request plumbing and related unit tests to use the new base types.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/v2/test_base_classes.py | Updates base-class test to use BaseInferenceResponse. |
| pyproject.toml | Removes an extra blank line. |
| mindee/v2/product/split/split_response.py | Switches split response base class to BaseInferenceResponse. |
| mindee/v2/product/split/params/split_parameters.py | Switches split params base class to BaseProductParameters. |
| mindee/v2/product/ocr/params/ocr_parameters.py | Switches OCR params base class to BaseProductParameters. |
| mindee/v2/product/ocr/ocr_response.py | Switches OCR response base class to BaseInferenceResponse. |
| mindee/v2/product/extraction/params/extraction_parameters.py | Renames parameter serialization method and updates base class. |
| mindee/v2/product/extraction/extraction_response.py | Switches extraction response base class to BaseInferenceResponse. |
| mindee/v2/product/crop/params/crop_parameters.py | Switches crop params base class to BaseProductParameters. |
| mindee/v2/product/crop/crop_response.py | Switches crop response base class to BaseInferenceResponse. |
| mindee/v2/product/classification/params/classification_parameters.py | Switches classification params base class to BaseProductParameters. |
| mindee/v2/product/classification/classification_response.py | Switches classification response base class to BaseInferenceResponse. |
| mindee/v2/parsing/inference/base_inference_response.py | Renames the V2 inference response base class to BaseInferenceResponse. |
| mindee/v2/parsing/init.py | Updates public parsing exports to reference BaseInferenceResponse. |
| mindee/v2/mindee_http/mindee_api_v2.py | Updates HTTP layer to accept BaseProductParameters and BaseInferenceResponse. |
| mindee/v2/commands/split_command.py | Updates command parameter base type to BaseProductParameters. |
| mindee/v2/commands/ocr_command.py | Updates command parameter base type to BaseProductParameters. |
| mindee/v2/commands/extraction_command.py | Updates command parameter base type to BaseProductParameters. |
| mindee/v2/commands/crop_command.py | Updates command parameter base type to BaseProductParameters. |
| mindee/v2/commands/classification_command.py | Updates command parameter base type to BaseProductParameters. |
| mindee/v2/commands/base_inference_command.py | Updates abstract command contract to return BaseProductParameters. |
| mindee/v2/client.py | Updates client method signatures/typevars to use the new base types. |
| mindee/v2/client_options/base_product_parameters.py | Renames the base parameters class and request-parameter method. |
Suppressed comments (2)
mindee/v2/parsing/inference/base_inference_response.py:12
- The
inferenceattribute docstring is now misleading: this base class is used by multiple products, not just the split utility. Please update it to a product-agnostic description (and add a period).
mindee/v2/client_options/base_product_parameters.py:50 BaseParameters.get_form_data()appears to have been renamed toBaseProductParameters.get_request_parameters(). If users may rely on the old class/method names, consider providing backward-compatible aliases (get_form_data()delegating toget_request_parameters(), andBaseParametersas an alias ofBaseProductParameters) to avoid an unintended breaking change.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Types of changes