mirror of
https://github.com/csunny/DB-GPT.git
synced 2026-07-16 17:15:22 +00:00
When users set `type = "milvus"` in their TOML vector storage config, the server fails to start with: ValueError: Unknown type value: milvus, known types: [...] Root causes: 1. The `StorageConfig.vector` field was annotated as `ChromaVectorConfig` instead of the base `VectorStoreConfig`, preventing polymorphic type dispatch from resolving any non-chroma vector store type correctly. 2. `milvus_store.py` imported `pymilvus` at module level. When pymilvus is not installed, the entire module fails to load and `MilvusVectorConfig` is never registered in the type registry. Fix: - Change the `vector` field type annotation to `VectorStoreConfig` (keeping `ChromaVectorConfig()` as default for backward compatibility). - Move the top-level `pymilvus` import into the methods that actually use it (lazy import), matching the pattern used by all other vector store implementations (chroma, elasticsearch, pgvector, etc.). Co-authored-by: Cursor <cursoragent@cursor.com>