Files
DB-GPT/packages
田云钊 d8c2abf027 fix(config): allow Milvus vector store type in TOML configuration (#3041)
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>
2026-07-04 11:33:11 +08:00
..