Skip to content

♻️ cleanup and uniformize RAG search implementation with other SDKs - #458

Open
sebastianMindee wants to merge 2 commits into
mainfrom
fix-rag-search
Open

♻️ cleanup and uniformize RAG search implementation with other SDKs#458
sebastianMindee wants to merge 2 commits into
mainfrom
fix-rag-search

Conversation

@sebastianMindee

Copy link
Copy Markdown
Collaborator

Description

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires a change to the official Guide documentation.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-docs CLI subcommand and tests; wire it into the V2 CLI parser.
  • Uniformize model search CLI to use client.search(ModelSearchParameters(...)) instead of client.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.

Comment thread mindee/v2/search/rag_documents/rag_document_search_parameters.py
Comment on lines +34 to 37
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)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes let's start by implementing here.

Comment thread mindee/v2/parsing/search/search_response.py Outdated
Comment thread mindee/v2/search/models/model_search_response.py Outdated
Comment thread mindee/v2/parsing/search/pagination_metadata.py Outdated
Comment thread mindee/v2/parsing/search/search_model.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants