Skip to content

♻️ simplify RAG document parameters - #443

Merged
ianardee merged 1 commit into
mainfrom
better-rag
Sep 15, 2026
Merged

ianardee merged 1 commit into
mainfrom
better-rag

Conversation

@ianardee

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.

🟡 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 TAnnotationResponse exactly. Thus a custom response subtype accepted by the old UpdateRagAnnotationAsync<TAnnotationResponse> signature can no longer be used with the provided RagDocumentAnnotationParameters, which is fixed to ExtractionRagAnnotationResponse; 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 HttpApiV2 subclasses overriding this method with BaseAnnotationParameters will 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.

Comment thread src/Mindee/V2/Client.cs
Comment thread src/Mindee/V2/ClientOptions/BaseAnnotationParameters.cs
Comment thread src/Mindee/V2/ClientOptions/BaseRagDocumentUploadParameters.cs
Comment thread src/Mindee/V2/Http/HttpApiV2.cs
@ianardee
ianardee merged commit 139f85e into main Sep 15, 2026
29 checks passed
@ianardee
ianardee deleted the better-rag branch September 15, 2026 16:46
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