Skip to content

✨ add RAG search API - #270

Merged
sebastianMindee merged 10 commits into
mainfrom
add-rag-search-api
Sep 2, 2026
Merged

✨ add RAG search API#270
sebastianMindee merged 10 commits into
mainfrom
add-rag-search-api

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 introduces a new V2 “search” surface in the Ruby SDK, adding typed parameter/response objects for model search and RAG document search, and wiring them through a generic V2::Client#search / HTTP::MindeeApiV2#req_search flow. It also refactors V2 inference parameter base classes from Mindee::Input::BaseParameters to Mindee::V2::ClientOptions::BaseParameters and updates related RBS signatures and product parameter classes accordingly.

Changes:

  • Add V2 search API plumbing (req_search, client.search) with dedicated parameters/responses for models and RAG documents.
  • Introduce shared parsing/search base response + new parsing structures for RAG documents, plus pagination metadata extension.
  • Move/rename V2 base parameter types under Mindee::V2::ClientOptions and update product params + RBS to match.

Reviewed changes

Copilot reviewed 50 out of 50 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
spec/v2/search/rag_document_search_spec.rb Adds local deserialization spec coverage for RAG document search responses.
spec/v2/search/rag_document_search_integration.rb Adds integration coverage for RAG document search via V2::Client#search.
spec/v2/search/model_search_spec.rb Adds local deserialization spec coverage for model search responses.
spec/v2/search/model_search_integration.rb Adds integration coverage for model search via V2::Client#search.
spec/v2/parsing/search_models_spec.rb Removes older parsing spec targeting deprecated search response path.
sig/mindee/v2/search/rag_documents/rag_document_search_response.rbs Adds RBS for RAG document search response type.
sig/mindee/v2/search/rag_documents/rag_document_search_parameters.rbs Adds RBS for RAG document search parameter type.
sig/mindee/v2/search/models/model_search_response.rbs Adds RBS for model search response type.
sig/mindee/v2/search/models/model_search_parameters.rbs Adds RBS for model search parameter type.
sig/mindee/v2/product/split/params/split_parameters/split_parameters.rbs Updates split params RBS to inherit from V2 client options base parameters.
sig/mindee/v2/product/ocr/params/ocr_parameters/ocr_parameters.rbs Updates OCR params RBS to inherit from V2 client options base parameters.
sig/mindee/v2/product/extraction/params/extraction_parameters.rbs Updates extraction params RBS base class to V2 client options parameters.
sig/mindee/v2/product/crop/params/crop_parameters/crop_parameters.rbs Updates crop params RBS to inherit from V2 client options base parameters.
sig/mindee/v2/product/classification/params/classification_parameters/classification_parameters.rbs Updates classification params RBS to inherit from V2 client options base parameters.
sig/mindee/v2/product/base_product.rbs Updates base product RBS to reference new V2 base parameter class.
sig/mindee/v2/parsing/search/search_response.rbs Deprecates parsing search response by making it inherit the new model search response.
sig/mindee/v2/parsing/search/search_rag_documents.rbs Adds RBS for RAG document list parsing type.
sig/mindee/v2/parsing/search/search_rag_document.rbs Adds RBS for individual RAG document parsing type.
sig/mindee/v2/parsing/search/pagination_metadata.rbs Extends pagination metadata RBS with total_items_unfiltered.
sig/mindee/v2/parsing/search/base_search_response.rbs Adds RBS for new base search response.
sig/mindee/v2/http/mindee_api_v2.rbs Updates HTTP interface types for new search request path + parameter base type rename.
sig/mindee/v2/client.rbs Adds search method typing and updates enqueue typing to new base parameters.
sig/mindee/v2/client_options/base_search_parameters.rbs Adds RBS for base search parameter type (needs return type adjustment per review).
sig/mindee/v2/client_options/base_parameters.rbs Adds RBS for new V2 base parameters (header path comment needs update).
sig/mindee/input/base_parameters.rbs Removes old Mindee::Input::BaseParameters RBS definition.
lib/mindee/v2/search/rag_documents/rag_document_search_response.rb Implements RAG document search response object and formatting.
lib/mindee/v2/search/rag_documents/rag_document_search_parameters.rb Implements RAG document search parameter object and request parameter mapping.
lib/mindee/v2/search/models/model_search_response.rb Implements model search response object and formatting.
lib/mindee/v2/search/models/model_search_parameters.rb Implements model search parameter object and request parameter mapping.
lib/mindee/v2/search.rb Adds V2 search requires/entrypoint for new search classes.
lib/mindee/v2/product/split/params/split_parameters.rb Switches split params to inherit from V2 client options base parameters.
lib/mindee/v2/product/ocr/params/ocr_parameters.rb Switches OCR params to inherit from V2 client options base parameters.
lib/mindee/v2/product/extraction/params/extraction_parameters.rb Switches extraction params to inherit from V2 client options base parameters and updates require path.
lib/mindee/v2/product/crop/params/crop_parameters.rb Switches crop params to inherit from V2 client options base parameters.
lib/mindee/v2/product/classification/params/classification_parameters.rb Switches classification params to inherit from V2 client options base parameters.
lib/mindee/v2/product/base_product.rb Updates base product to require and default to new V2 base parameters.
lib/mindee/v2/parsing/search/search_response.rb Deprecates old parsing search response by inheriting the new model search response.
lib/mindee/v2/parsing/search/search_rag_documents.rb Adds list parsing/formatting for RAG documents.
lib/mindee/v2/parsing/search/search_rag_document.rb Adds parsing/formatting for individual RAG document entries.
lib/mindee/v2/parsing/search/pagination_metadata.rb Extends pagination metadata with total_items_unfiltered.
lib/mindee/v2/parsing/search/base_search_response.rb Adds a shared base class for search responses (pagination + to_s).
lib/mindee/v2/parsing/search.rb Wires new search parsing classes and new search response into parsing requires.
lib/mindee/v2/http/mindee_api_v2.rb Adds req_search and underlying GET helper; renames enqueue helper to req_post_product_enqueue.
lib/mindee/v2/client.rb Adds search method; updates enqueue to call renamed HTTP enqueue method and new base params type.
lib/mindee/v2/client_options/base_search_parameters.rb Adds base search parameter class used by search parameter objects (superclass choice needs adjustment per review).
lib/mindee/v2/client_options/base_parameters.rb Introduces new V2 base parameter class (contains polling-options normalization bugs per review).
lib/mindee/v2/client_options.rb Adds requires for new client options classes.
lib/mindee/v2.rb Requires new V2 client options and search entrypoints.
lib/mindee/input/base_parameters.rb Removes old Mindee::Input::BaseParameters implementation.
Suppressed comments (2)

lib/mindee/v2/client_options/base_parameters.rb:139

  • get_clean_polling_options currently returns a new Input::PollingOptions when an Input::PollingOptions is provided, discarding the caller’s settings. The subsequent else branch also contains a redundant is_a?(Input::PollingOptions) check that can never be reached.
        def get_clean_polling_options(polling_options)
          return Input::PollingOptions.new if polling_options.is_a?(Input::PollingOptions)

lib/mindee/v2/client_options/base_parameters.rb:94

  • load_from_hash reads :page_options and builds a PollingOptions instance but never assigns it back to params[:polling_options]. This means from_hash will ignore normalized polling options and V2 will also accept the wrong key.
          polling_options_input = params.fetch(:page_options, Input::PollingOptions.new)
          if polling_options_input.is_a?(Hash)
            polling_options_input = polling_options_input.transform_keys(&:to_sym)
            Input::PollingOptions.new(
              initial_delay_sec: polling_options_input.fetch(:initial_delay_sec, 2.0),

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/mindee/v2/client_options/base_parameters.rb Outdated
Comment thread lib/mindee/v2/client_options/base_search_parameters.rb Outdated
Comment thread sig/mindee/v2/client_options/base_search_parameters.rbs Outdated
Comment thread lib/mindee/v2/parsing/search/search_response.rb
Comment thread sig/mindee/v2/client_options/base_parameters.rbs Outdated
Comment thread bin/v2/search_commands.rb Outdated
Comment thread bin/v2/search_commands.rb Outdated
Comment thread bin/v2/search_commands.rb Outdated
Comment thread bin/v2/search_commands.rb Outdated
Comment thread bin/v2/search_commands.rb Outdated
Comment thread lib/mindee/v2/parsing/search/pagination_metadata.rb Outdated
Comment thread lib/mindee/v2/search/models/model_search_response.rb
Comment thread lib/mindee/v2/http/mindee_api_v2.rb Outdated
Comment thread lib/mindee/v2/http/mindee_api_v2.rb Outdated
Comment thread lib/mindee/v2/client.rb Outdated
Comment thread lib/mindee/v2/client_options/base_product_parameters.rb Outdated
Comment thread lib/mindee/v2/client_options/base_search_parameters.rb Outdated
Comment thread lib/mindee/v2/search/models/model_search_parameters.rb Outdated
@sebastianMindee
sebastianMindee merged commit 49f3ec8 into main Sep 2, 2026
33 checks passed
@sebastianMindee
sebastianMindee deleted the add-rag-search-api branch September 2, 2026 12:56
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