✨ add RAG search API - #457
Merged
Merged
Conversation
ianardee
force-pushed
the
rag-search
branch
12 times, most recently
from
August 20, 2026 21:28
2656279 to
f14b77f
Compare
There was a problem hiding this comment.
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
respxmocks 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_idhas the same issue as enqueue: a 2xx response containingjob.errorwill currently be treated as valid becauseis_valid_sync_responseonly checks HTTP status + JSON. Handlejob.errorexplicitly 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.
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>
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
Types of changes