Refact: Add Multimodal Processing Status Support to DocProcessingStatus #2248
+36
−17
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.
Add Multimodal Processing Status Support to DocProcessingStatus
Summary
This PR adds support for tracking multimodal processing status in document metadata and implements automatic status conversion logic to ensure accurate document state representation with RayAnything.
Problem
RayAnything use LightRAG to process normal text data, and add
multimodal_processedfield to doc_status storage. Whenmultimodal_processedis Flase, means additional multimodal processing is required. The current system treats these documents as fullyPROCESSED, which doesn't accurately reflect their actual processing state.Solution
Added a
multimodal_processedfield toDocProcessingStatusclass with automatic status conversion logic:Key Changes:
multimodal_processed: bool | Nonefield toDocProcessingStatus(withrepr=Falseto keep it internal)__post_init__method to handle status conversionrepr()outputBusiness Logic:
multimodal_processed=FalseANDstatus=PROCESSED, the status is automatically converted toPREPROCESSEDmultimodal_processed=TrueOR isNone, no status conversion occursPROCESSEDstatusPENDING,PROCESSING,FAILED) are not affectedTechnical Details
Implementation:
Design Decision:
repr=Falseto hide it from debug output while keeping it accessibleImpact Analysis
✅ API Layer: No impact - API response models use explicit field mapping,
multimodal_processedis not exposed✅ Frontend: No impact - Frontend uses TypeScript types that don't include this field
✅ Storage: No impact - Field is persisted but doesn't affect existing logic
✅ Backward Compatibility: Fully compatible - documents without the field default to
NoneBenefits
PREPROCESSEDwhen multimodal processing is incompleterepr()to avoid cluttering debug output