Skip to content

✨ add RAG search API - #457

Merged
ianardee merged 5 commits into
mainfrom
rag-search
Aug 20, 2026
Merged

✨ add RAG search API#457
ianardee merged 5 commits into
mainfrom
rag-search

Conversation

@ianardee

Copy link
Copy Markdown
Contributor

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.

@ianardee
ianardee force-pushed the rag-search branch 12 times, most recently from 2656279 to f14b77f Compare August 20, 2026 21:28
@ianardee
ianardee marked this pull request as ready for review August 20, 2026 21:45
@ianardee
ianardee requested a lite review from Copilot August 20, 2026 21:46

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 V2 “search” surface (including RAG document search) and refactors V2 product endpoint slugs/URLs to a unified /v2/products/{product}/... structure, along with corresponding test updates.

Changes:

  • Added generic V2 search parameters/response base classes plus concrete “models” and “rag-documents” search implementations.
  • Refactored V2 product slugs (enqueue/result) to match the /v2/products/{slug}/... API path and updated client/http plumbing accordingly.
  • Updated/added tests to use respx mocks and added integration coverage for model search + RAG document search.

Reviewed changes

Copilot reviewed 33 out of 35 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/v2/test_client.py Refactors client tests to use respx and updated V2 product endpoints.
tests/v2/search/test_search_models.py Removes legacy local parsing test for the old search response type.
tests/v2/search/test_model_search.py Adds local-deserialization test for new model search response.
tests/v2/search/test_model_search_integration.py Adds integration tests for model search.
tests/v2/search/test_rag_document_search.py Adds local-deserialization test for RAG document search responses.
tests/v2/search/test_rag_document_search_integration.py Adds integration test for RAG document search.
mindee/v2/client.py Adds generic Client.search() and updates V2 enqueue/job/result calls to new API methods.
mindee/v2/mindee_http/mindee_api_v2.py Refactors request methods for product enqueue/results/jobs and introduces generic req_search().
mindee/v2/mindee_http/response_validation_v2.py Removes old V2 response validation helpers.
mindee/v2/client_options/base_search_parameters.py Introduces a generic base for search parameter objects.
mindee/v2/parsing/search/base_search_response.py Introduces a base search response with pagination + string rendering.
mindee/v2/parsing/search/search_response.py Deprecates SearchResponse in favor of ModelSearchResponse.
mindee/v2/parsing/search/search_models.py Minor rename in list comprehension variable.
mindee/v2/parsing/search/search_rag_document.py Adds parser for a single RAG document search item.
mindee/v2/parsing/search/search_rag_documents.py Adds list wrapper + string formatting for RAG documents search results.
mindee/v2/parsing/search/init.py Exports new RAG search parsing symbols.
mindee/v2/search/rag_documents/init.py Exposes RAG document search parameter/response types.
mindee/v2/search/rag_documents/rag_document_search_parameters.py Adds RAG document search parameters and query serialization.
mindee/v2/search/rag_documents/rag_document_search_response.py Adds RAG document search response wrapper.
mindee/v2/search/models/model_search_parameters.py Adds model search parameters and query serialization.
mindee/v2/search/models/model_search_response.py Adds model search response wrapper.
mindee/v2/search/models/init.py Adds package (currently empty).
mindee/v2/search/init.py Adds package (currently empty).
mindee/v2/product/extraction/params/extraction_parameters.py Updates extraction enqueue slug + docstring.
mindee/v2/product/extraction/extraction_response.py Updates extraction result slug.
mindee/v2/product/ocr/params/ocr_parameters.py Updates OCR enqueue slug + docstring.
mindee/v2/product/ocr/ocr_response.py Updates OCR result slug.
mindee/v2/product/crop/params/crop_parameters.py Updates crop enqueue slug + docstring.
mindee/v2/product/crop/crop_response.py Updates crop result slug.
mindee/v2/product/classification/params/classification_parameters.py Updates classification enqueue slug + docstring.
mindee/v2/product/classification/classification_response.py Updates classification result slug.
mindee/v2/product/split/params/split_parameters.py Updates split enqueue slug.
mindee/v2/client_options/base_product_parameters.py Updates wording around product slug/docstring.
mindee/v2/parsing/inference/base_inference_response.py Adjusts slug docstring wording.
Suppressed comments (1)

mindee/v2/mindee_http/mindee_api_v2.py:156

  • req_get_job_by_id has the same issue as enqueue: a 2xx response containing job.error will currently be treated as valid because is_valid_sync_response only checks HTTP status + JSON. Handle job.error explicitly so polling fails fast with a proper Mindee error.
        dict_response = self._response_json(response)
        if not is_valid_sync_response(response):
            handle_error_v2(dict_response)
        return JobResponse(dict_response)

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

Comment thread mindee/v2/parsing/search/base_search_response.py Outdated
Comment thread mindee/v2/mindee_http/mindee_api_v2.py
Comment thread tests/v2/search/test_rag_document_search_integration.py Outdated
Comment thread mindee/v2/mindee_http/mindee_api_v2.py Outdated
ianardee and others added 4 commits August 20, 2026 23:55
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ianardee
ianardee merged commit 99bde7c into main Aug 20, 2026
42 checks passed
@ianardee
ianardee deleted the rag-search branch August 20, 2026 22:08
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.

2 participants