Skip to content

Commit

Permalink
chore: use singular style in middleware config class name (langgenius…
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 authored Jun 22, 2024
1 parent 5217f7c commit 29ca681
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 45 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ web/.vscode/settings.json
!.idea/vcs.xml
!.idea/icon.png
.ideaDataSources/
*.iml

api/.env
api/storage/*
Expand Down
68 changes: 34 additions & 34 deletions api/configs/middleware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
from configs.middleware.storage.azure_blob_storage_config import AzureBlobStorageConfig
from configs.middleware.storage.google_cloud_storage_config import GoogleCloudStorageConfig
from configs.middleware.storage.tencent_cos_storage_config import TencentCloudCOSStorageConfig
from configs.middleware.vdb.chroma_configs import ChromaConfigs
from configs.middleware.vdb.milvus_configs import MilvusConfigs
from configs.middleware.vdb.opensearch_configs import OpenSearchConfigs
from configs.middleware.vdb.oracle_configs import OracleConfigs
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


class StorageConfigs(BaseModel):
from configs.middleware.vdb.chroma_config import ChromaConfig
from configs.middleware.vdb.milvus_config import MilvusConfig
from configs.middleware.vdb.opensearch_config import OpenSearchConfig
from configs.middleware.vdb.oracle_config import OracleConfig
from configs.middleware.vdb.pgvector_config import PGVectorConfig
from configs.middleware.vdb.pgvectors_config import PGVectoRSConfig
from configs.middleware.vdb.qdrant_config import QdrantConfig
from configs.middleware.vdb.relyt_config import RelytConfig
from configs.middleware.vdb.tencent_vector_config import TencentVectorDBConfig
from configs.middleware.vdb.tidb_vector_config import TiDBVectorConfig
from configs.middleware.vdb.weaviate_config import WeaviateConfig


class StorageConfig(BaseModel):
STORAGE_TYPE: str = Field(
description='storage type,'
' default to `local`,'
Expand All @@ -35,21 +35,21 @@ class StorageConfigs(BaseModel):
)


class VectorStoreConfigs(BaseModel):
class VectorStoreConfig(BaseModel):
VECTOR_STORE: Optional[str] = Field(
description='vector store type',
default=None,
)


class KeywordStoreConfigs(BaseModel):
class KeywordStoreConfig(BaseModel):
KEYWORD_STORE: str = Field(
description='keyword store type',
default='jieba',
)


class DatabaseConfigs:
class DatabaseConfig:
DB_HOST: str = Field(
description='db host',
default='localhost',
Expand Down Expand Up @@ -130,7 +130,7 @@ def SQLALCHEMY_ENGINE_OPTIONS(self) -> dict[str, Any]:
}


class CeleryConfigs(DatabaseConfigs):
class CeleryConfig(DatabaseConfig):
CELERY_BACKEND: str = Field(
description='Celery backend, available values are `database`, `redis`',
default='database',
Expand All @@ -155,31 +155,31 @@ def BROKER_USE_SSL(self) -> bool:

class MiddlewareConfig(
# place the configs in alphabet order
CeleryConfigs,
DatabaseConfigs,
KeywordStoreConfigs,
CeleryConfig,
DatabaseConfig,
KeywordStoreConfig,
RedisConfig,

# configs of storage and storage providers
StorageConfigs,
StorageConfig,
AliyunOSSStorageConfig,
AzureBlobStorageConfig,
GoogleCloudStorageConfig,
TencentCloudCOSStorageConfig,
S3StorageConfig,

# configs of vdb and vdb providers
VectorStoreConfigs,
ChromaConfigs,
MilvusConfigs,
OpenSearchConfigs,
OracleConfigs,
PGVectorConfigs,
PGVectoRSConfigs,
QdrantConfigs,
RelytConfigs,
TencentVectorDBConfigs,
TiDBVectorConfigs,
WeaviateConfigs,
VectorStoreConfig,
ChromaConfig,
MilvusConfig,
OpenSearchConfig,
OracleConfig,
PGVectorConfig,
PGVectoRSConfig,
QdrantConfig,
RelytConfig,
TencentVectorDBConfig,
TiDBVectorConfig,
WeaviateConfig,
):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, Field, PositiveInt


class ChromaConfigs(BaseModel):
class ChromaConfig(BaseModel):
"""
Chroma configs
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, Field, PositiveInt


class MilvusConfigs(BaseModel):
class MilvusConfig(BaseModel):
"""
Milvus configs
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, Field, PositiveInt


class OpenSearchConfigs(BaseModel):
class OpenSearchConfig(BaseModel):
"""
OpenSearch configs
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, Field, PositiveInt


class OracleConfigs(BaseModel):
class OracleConfig(BaseModel):
"""
ORACLE configs
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, Field, PositiveInt


class PGVectorConfigs(BaseModel):
class PGVectorConfig(BaseModel):
"""
PGVector configs
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, Field, PositiveInt


class PGVectoRSConfigs(BaseModel):
class PGVectoRSConfig(BaseModel):
"""
PGVectoRS configs
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, Field, NonNegativeInt, PositiveInt


class QdrantConfigs(BaseModel):
class QdrantConfig(BaseModel):
"""
Qdrant configs
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, Field, PositiveInt


class RelytConfigs(BaseModel):
class RelytConfig(BaseModel):
"""
Relyt configs
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, Field, PositiveInt


class TencentVectorDBConfigs(BaseModel):
class TencentVectorDBConfig(BaseModel):
"""
Tencent Vector configs
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, Field, PositiveInt


class TiDBVectorConfigs(BaseModel):
class TiDBVectorConfig(BaseModel):
"""
TiDB Vector configs
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel, Field, PositiveInt


class WeaviateConfigs(BaseModel):
class WeaviateConfig(BaseModel):
"""
Weaviate configs
"""
Expand Down

0 comments on commit 29ca681

Please sign in to comment.