♻️ cleanup and uniformize RAG search implementation with other SDKs - #458
♻️ cleanup and uniformize RAG search implementation with other SDKs#458sebastianMindee wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors and aligns the V2 “search” surface with other SDKs by moving CLI search commands onto the generic Client.search(BaseSearchParameters) entrypoint, and by adding a dedicated CLI subcommand for searching RAG documents. It also updates related parsing/search model classes and extends the Sphinx docs to cover the new search modules.
Changes:
- Add
search-rag-docsCLI subcommand and tests; wire it into the V2 CLI parser. - Uniformize model search CLI to use
client.search(ModelSearchParameters(...))instead ofclient.search_models(...). - Clean up/clarify search response/metadata/string rendering and add/adjust V2 docs sections.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/v2/test_cli.py | Registers and tests the new search-rag-docs CLI subcommand. |
| mindee/v2/search/rag_documents/rag_document_search_response.py | Tweaks RAG document search response formatting/docstrings. |
| mindee/v2/search/rag_documents/rag_document_search_parameters.py | Adds model_id validation and adjusts request parameter emission. |
| mindee/v2/search/models/model_search_response.py | Updates model search response docstrings/formatting. |
| mindee/v2/search/models/model_search_parameters.py | Makes request parameter emission skip falsy values. |
| mindee/v2/product/extraction/params/extraction_parameters.py | Fixes erroneous double assignments in request parameter building. |
| mindee/v2/parsing/search/search_response.py | Adjusts SearchResponse compatibility surface. |
| mindee/v2/parsing/search/search_models.py | Updates list string formatting (removes webhooks count line). |
| mindee/v2/parsing/search/search_model.py | Adds string helpers for search model formatting. |
| mindee/v2/parsing/search/pagination_metadata.py | Updates pagination metadata docstrings. |
| mindee/v2/parsing/search/model_webhook.py | Docstring clarification. |
| mindee/v2/parsing/search/base_search_response.py | Docstring clarification for body rendering. |
| mindee/v2/parsing/inference/rag_metadata.py | Adds missing field docstring. |
| mindee/v2/parsing/inference/inference_active_options.py | Refines option docstrings for clarity. |
| mindee/v2/commands/search_rag_documents_command.py | New CLI command implementation for RAG document search. |
| mindee/v2/commands/search_models_command.py | Uses client.search(ModelSearchParameters(...)) for uniform search handling. |
| mindee/v2/commands/cli_parser.py | Wires in search-rag-docs and refactors dispatch into _execute_command. |
| mindee/v2/commands/init.py | Exports SearchRagDocumentsCommand. |
| mindee/v2/client_options/base_search_parameters.py | Changes page/per_page serialization behavior for invalid values. |
| mindee/cli.py | Updates top-level CLI docstring to mention search-rag-docs. |
| docs/v2/search.rst | New V2 search documentation page. |
| docs/v2/parsing/search.rst | Documents Search RAG Document(s) parsing models. |
| docs/v2/mindee_http.rst | Removes response validation module section. |
| docs/v2/index.rst | Adds the new search docs page to the V2 index. |
| docs/v2/client_options.rst | Splits product vs search base parameter docs and updates references. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if self.page is not None and self.page > 0: | ||
| data["page"] = str(self.page) | ||
| if self.per_page is not None: | ||
| if self.per_page is not None and self.per_page > 0: | ||
| data["per_page"] = str(self.per_page) |
There was a problem hiding this comment.
fair point @ianardee but it's present in none of the other lib, do I start by implementing it here or do we not care about it?
There was a problem hiding this comment.
yes let's start by implementing here.
Description
Types of changes