♻️ harmonize search classes - #215
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors V2 search response classes to align their namespaces/locations with other SDKs, and updates internal callers/tests/CLI to use the new namespaces.
Changes:
- Moved
ModelSearchResponseandRagDocumentSearchResponseintoMindee\V2\Search\...namespaces. - Updated unit/functional tests and CLI commands to import the new response classes.
- Kept a deprecated
Mindee\V2\Parsing\Search\SearchResponseas an alias to the new model search response.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/V2/Search/RagDocumentSearchTest.php | Updates test import to new RAG document search response namespace. |
| tests/V2/Search/RagDocumentSearchFunctional.php | Updates functional test imports to new RAG document search response namespace. |
| tests/V2/Search/ModelSearchTest.php | Updates test import to new model search response namespace. |
| tests/V2/Search/ModelSearchFunctional.php | Updates functional test imports to new model search response namespace. |
| src/V2/Search/RagDocuments/RagDocumentSearchResponse.php | Changes namespace for the RAG document search response class. |
| src/V2/Search/Models/ModelSearchResponse.php | Changes namespace for the model search response class. |
| src/V2/Parsing/Search/SearchResponse.php | Deprecation alias now extends the new model search response class. |
| src/V2/Client.php | Updates imports to use the new model search response namespace. |
| bin/V2/SearchRagDocumentsCommand.php | Updates CLI command imports to new RAG document search response namespace. |
| bin/V2/SearchModelsCommand.php | Updates CLI command imports to new model search response namespace. |
Suppressed comments (2)
src/V2/Search/Models/ModelSearchResponse.php:8
- Changing the namespace of ModelSearchResponse from Mindee\V2\Parsing\Search to Mindee\V2\Search\Models removes the old FQCN. With PSR-4 autoloading (composer.json maps "Mindee\" => "src"), any downstream code referencing Mindee\V2\Parsing\Search\ModelSearchResponse will now fail to autoload. If this is intended as a non-breaking refactor, add a deprecated compatibility class at src/V2/Parsing/Search/ModelSearchResponse.php that extends the new Mindee\V2\Search\Models\ModelSearchResponse (and update deprecated docs accordingly).
src/V2/Search/RagDocuments/RagDocumentSearchResponse.php:8 - Changing the namespace of RagDocumentSearchResponse from Mindee\V2\Parsing\Search to Mindee\V2\Search\RagDocuments removes the old FQCN. With PSR-4 autoloading, any client code still passing/using Mindee\V2\Parsing\Search\RagDocumentSearchResponse (e.g., as the $responseClass argument to Client::search) will now fail to autoload. Consider adding a deprecated compatibility class at src/V2/Parsing/Search/RagDocumentSearchResponse.php that extends the new class to keep this refactor non-breaking.
💡 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
Harmonize search response classes with other SDKs (feature not yet released)
Types of changes