Do you need to file an issue?
Describe the bug
Environment
- raganything: 1.3.1
- lightrag-hku: 1.5.2
- OS: Windows 10
Description
When processing documents with multimodal content (images, tables) enabled, the following error occurs during both batch and individual multimodal processing:
ERROR: Error in multimodal processing: 'role_llm_funcs'
Root Cause
In raganything/modalprocessors.py, BaseModalProcessor.__init__ sets:
self.global_config = asdict(lightrag)
asdict() only serializes dataclass fields. However, role_llm_funcs is not a dataclass field — it is dynamically injected by LightRAG._build_global_config() at runtime (lightrag/lightrag.py, around line 835):
global_config["role_llm_funcs"] = {
spec.name: states[spec.name].wrapped ...
}
As a result, when extract_entities() is called inside _process_chunk_for_extraction() with global_config=self.global_config, it raises KeyError: 'role_llm_funcs'.
Fix
Replace asdict(lightrag) with lightrag._build_global_config():
# Before
self.global_config = asdict(lightrag)
# After
self.global_config = lightrag._build_global_config()
Steps to Reproduce
1. Initialize RAGAnything with enable_image_processing=True or enable_table_processing=True
2. Process any PDF containing images or tables
3. Observe KeyError: 'role_llm_funcs' in multimodal processing stage
### Steps to reproduce
_No response_
### Expected Behavior
_No response_
### LightRAG Config Used
# Paste your config here
### Logs and screenshots
_No response_
### Additional Information
- LightRAG Version:
- Operating System:
- Python Version:
- Related Issues:
Do you need to file an issue?
Describe the bug
Environment
Description
When processing documents with multimodal content (images, tables) enabled, the following error occurs during both batch and individual multimodal processing:
ERROR: Error in multimodal processing: 'role_llm_funcs'
Root Cause
In
raganything/modalprocessors.py,BaseModalProcessor.__init__sets: