Skip to content

✨ load RAG annotation from file - #476

Merged
ianardee merged 1 commit into
mainfrom
annotation-from-file
Nov 20, 2026
Merged

ianardee merged 1 commit into
mainfrom
annotation-from-file

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.

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

The annotation truthiness check silently drops explicitly supplied empty values, allowing a status-only PATCH to activate a document without the intended annotation update instead of rejecting invalid input.

1 open issue
What changed in this PR

Adds file-based loading for RAG annotations in the Python SDK and centralizes input conversion in RagAnnotation.

Changes:

  • Accepts dictionaries, JSON strings, bytes, and text or binary file handles.
  • Routes PATCH annotation inputs through the shared constructor.
  • Adds file-handle test coverage and an explicit integration-test type annotation.
File Description
tests/​v2/​product/​extraction/​test_rag_documents.py Loads expected annotations from a fixture and tests file-handle input.
tests/​v2/​product/​extraction/​test_rag_documents_integration.py Adds an explicit RagAnnotation type annotation.
mindee/​v2/​product/​extraction/​rag_documents/​rag_annotation.py Adds JSON and file-handle parsing to the annotation constructor.
mindee/​v2/​product/​extraction/​rag_documents/​params/​rag_document_annotation_parameters.py Broadens accepted inputs and delegates conversion to RagAnnotation.

Review effort: Balanced

@ianardee
ianardee force-pushed the annotation-from-file branch 2 times, most recently from f76db47 to e436a39 Compare November 20, 2026 12:44
@ianardee
ianardee requested a balanced review from Copilot November 20, 2026 12:44

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

The newly supported bytes and binary file-handle inputs lack regression tests asserting the resulting PATCH annotation.

1 open issue
1 resolved since last review

Review effort: Balanced

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.

🔵 Needs a closer look

The new unit tests require a fixture from the empty tests/data submodule, so the pinned revision must be confirmed to contain test_annotation.json with the expected annotation before merging.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@ianardee
ianardee merged commit 16e2f1e into main Nov 20, 2026
38 checks passed
@ianardee
ianardee deleted the annotation-from-file branch November 20, 2026 13:16
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