Why this change is needed: asdict() converts nested dataclasses to dicts. When LightRAG creates global_config with asdict(self), the embedding_func field (which is an EmbeddingFunc dataclass) gets converted to a plain dict, losing its get_model_identifier() method. How it solves it: 1. Save original EmbeddingFunc object before asdict() call 2. Restore it in global_config after asdict() 3. Add null check and debug logging in _generate_collection_suffix Impact: - E2E tests with full LightRAG initialization now work correctly - Vector storage model isolation features function properly - Maintains backward compatibility Testing: All unit tests pass (12/12 in migration tests) |
||
|---|---|---|
| .. | ||
| api | ||
| evaluation | ||
| kg | ||
| llm | ||
| tools | ||
| __init__.py | ||
| base.py | ||
| constants.py | ||
| exceptions.py | ||
| lightrag.py | ||
| namespace.py | ||
| operate.py | ||
| prompt.py | ||
| rerank.py | ||
| types.py | ||
| utils.py | ||
| utils_graph.py | ||