2024-06-19 13:41:12 +08:00
|
|
|
from typing import Optional
|
|
|
|
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
2024-06-22 09:54:25 +08:00
|
|
|
from configs.middleware.redis_config import RedisConfig
|
2024-06-20 16:24:10 +08:00
|
|
|
from configs.middleware.vdb.chroma_configs import ChromaConfigs
|
|
|
|
from configs.middleware.vdb.milvus_configs import MilvusConfigs
|
|
|
|
from configs.middleware.vdb.opensearch_configs import OpenSearchConfigs
|
2024-06-22 01:48:07 +08:00
|
|
|
from configs.middleware.vdb.oracle_configs import OracleConfigs
|
2024-06-20 16:24:10 +08:00
|
|
|
from configs.middleware.vdb.pgvector_configs import PGVectorConfigs
|
|
|
|
from configs.middleware.vdb.pgvectors_configs import PGVectoRSConfigs
|
|
|
|
from configs.middleware.vdb.qdrant_configs import QdrantConfigs
|
|
|
|
from configs.middleware.vdb.relyt_configs import RelytConfigs
|
|
|
|
from configs.middleware.vdb.tencent_vector_configs import TencentVectorDBConfigs
|
|
|
|
from configs.middleware.vdb.tidb_vector_configs import TiDBVectorConfigs
|
|
|
|
from configs.middleware.vdb.weaviate_configs import WeaviateConfigs
|
2024-06-19 13:41:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
class StorageConfigs(BaseModel):
|
|
|
|
STORAGE_TYPE: str = Field(
|
|
|
|
description='storage type,'
|
|
|
|
' default to `local`,'
|
|
|
|
' available values are `local`, `s3`, `azure-blob`, `aliyun-oss`, `google-storage`.',
|
|
|
|
default='local',
|
|
|
|
)
|
|
|
|
|
|
|
|
STORAGE_LOCAL_PATH: str = Field(
|
|
|
|
description='local storage path',
|
|
|
|
default='storage',
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class VectorStoreConfigs(BaseModel):
|
|
|
|
VECTOR_STORE: Optional[str] = Field(
|
|
|
|
description='vector store type',
|
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class KeywordStoreConfigs(BaseModel):
|
|
|
|
KEYWORD_STORE: str = Field(
|
|
|
|
description='keyword store type',
|
|
|
|
default='jieba',
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-06-22 09:54:25 +08:00
|
|
|
class MiddlewareConfig(
|
2024-06-19 13:41:12 +08:00
|
|
|
# place the configs in alphabet order
|
|
|
|
KeywordStoreConfigs,
|
2024-06-22 09:54:25 +08:00
|
|
|
RedisConfig,
|
2024-06-19 13:41:12 +08:00
|
|
|
StorageConfigs,
|
2024-06-20 16:24:10 +08:00
|
|
|
|
|
|
|
# configs of vdb and vdb providers
|
2024-06-19 13:41:12 +08:00
|
|
|
VectorStoreConfigs,
|
2024-06-20 16:24:10 +08:00
|
|
|
ChromaConfigs,
|
|
|
|
MilvusConfigs,
|
|
|
|
OpenSearchConfigs,
|
|
|
|
PGVectorConfigs,
|
|
|
|
PGVectoRSConfigs,
|
|
|
|
QdrantConfigs,
|
|
|
|
RelytConfigs,
|
|
|
|
TencentVectorDBConfigs,
|
|
|
|
TiDBVectorConfigs,
|
|
|
|
WeaviateConfigs,
|
2024-06-22 01:48:07 +08:00
|
|
|
OracleConfigs,
|
2024-06-19 13:41:12 +08:00
|
|
|
):
|
|
|
|
pass
|