♻️ simplify RAG document parameters - #443
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical public API compatibility issues require correction before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Refactors RAG document parameters to associate request types with their annotation response types.
Changes:
- Adds generic upload and annotation parameter bases.
- Updates concrete RAG parameter classes.
- Propagates generic types through V2 HTTP and client APIs.
File summaries
| File | Reviewed changes |
|---|---|
src/Mindee/V2/Product/Extraction/RagDocuments/Params/RagDocumentUploadParameters.cs |
Uses the generic upload-parameter base. |
src/Mindee/V2/Product/Extraction/RagDocuments/Params/RagDocumentAnnotationParameters.cs |
Uses the generic annotation-parameter base. |
src/Mindee/V2/Http/MindeeApiV2.cs |
Updates concrete HTTP implementations. |
src/Mindee/V2/Http/HttpApiV2.cs |
Updates abstract RAG API contracts. |
src/Mindee/V2/ClientOptions/BaseRagDocumentUploadParameters.cs |
Introduces response-typed upload parameters. |
src/Mindee/V2/ClientOptions/BaseAnnotationParameters.cs |
Makes annotation parameters response-specific. |
src/Mindee/V2/Client.cs |
Propagates generic parameter types through public client methods. |
Review details
Suppressed comments (2)
src/Mindee/V2/Client.cs:318
- This parameter type now has to match
TAnnotationResponseexactly. Thus a custom response subtype accepted by the oldUpdateRagAnnotationAsync<TAnnotationResponse>signature can no longer be used with the providedRagDocumentAnnotationParameters, which is fixed toExtractionRagAnnotationResponse; the same restriction applies to the polling update method. Avoid coupling these independent public types or provide a compatibility overload.
public async Task<TAnnotationResponse> UpdateRagAnnotationAsync<TAnnotationResponse>(
BaseAnnotationParameters<TAnnotationResponse> parameters, CancellationToken ct = default)
where TAnnotationResponse : BaseRagAnnotationResponse, new()
src/Mindee/V2/Http/HttpApiV2.cs:119
- The same public extensibility break occurs for patch implementations: existing
HttpApiV2subclasses overriding this method withBaseAnnotationParameterswill no longer compile after the generic parameter type is introduced. This should retain a compatibility contract or be declared as a breaking change.
public abstract Task<TAnnotationResponse> ReqPatchRagAnnotationAsync<TAnnotationResponse>(
BaseAnnotationParameters<TAnnotationResponse> parameters, CancellationToken cancellationToken = default)
where TAnnotationResponse : BaseRagAnnotationResponse, new();
- Files reviewed: 7/7 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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