mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
Update factory.py
This commit is contained in:
parent
8dc43f9e3a
commit
01d4a8ab7a
1 changed files with 14 additions and 3 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
from open_webui.retrieval.vector.main import VectorDBBase
|
from open_webui.retrieval.vector.main import VectorDBBase
|
||||||
from open_webui.retrieval.vector.type import VectorType
|
from open_webui.retrieval.vector.type import VectorType
|
||||||
from open_webui.config import VECTOR_DB, ENABLE_QDRANT_MULTITENANCY_MODE
|
from open_webui.config import (
|
||||||
|
VECTOR_DB,
|
||||||
|
ENABLE_QDRANT_MULTITENANCY_MODE,
|
||||||
|
ENABLE_MILVUS_MULTITENANCY_MODE,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Vector:
|
class Vector:
|
||||||
|
|
@ -12,9 +16,16 @@ class Vector:
|
||||||
"""
|
"""
|
||||||
match vector_type:
|
match vector_type:
|
||||||
case VectorType.MILVUS:
|
case VectorType.MILVUS:
|
||||||
from open_webui.retrieval.vector.dbs.milvus import MilvusClient
|
if ENABLE_MILVUS_MULTITENANCY_MODE:
|
||||||
|
from open_webui.retrieval.vector.dbs.milvus_multitenancy import (
|
||||||
|
MilvusClient,
|
||||||
|
)
|
||||||
|
|
||||||
return MilvusClient()
|
return MilvusClient()
|
||||||
|
else:
|
||||||
|
from open_webui.retrieval.vector.dbs.milvus import MilvusClient
|
||||||
|
|
||||||
|
return MilvusClient()
|
||||||
case VectorType.QDRANT:
|
case VectorType.QDRANT:
|
||||||
if ENABLE_QDRANT_MULTITENANCY_MODE:
|
if ENABLE_QDRANT_MULTITENANCY_MODE:
|
||||||
from open_webui.retrieval.vector.dbs.qdrant_multitenancy import (
|
from open_webui.retrieval.vector.dbs.qdrant_multitenancy import (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue