chore: use singular style in middleware config class name (#5502)

This commit is contained in:
Bowen Liang 2024-06-22 18:26:38 +08:00 committed by GitHub
parent 5217f7cf69
commit 29ca6815ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 44 additions and 43 deletions

1
.gitignore vendored
View File

@ -138,6 +138,7 @@ web/.vscode/settings.json
!.idea/vcs.xml !.idea/vcs.xml
!.idea/icon.png !.idea/icon.png
.ideaDataSources/ .ideaDataSources/
*.iml
api/.env api/.env
api/storage/* api/storage/*

View File

@ -8,20 +8,20 @@ from configs.middleware.storage.amazon_s3_storage_config import S3StorageConfig
from configs.middleware.storage.azure_blob_storage_config import AzureBlobStorageConfig from configs.middleware.storage.azure_blob_storage_config import AzureBlobStorageConfig
from configs.middleware.storage.google_cloud_storage_config import GoogleCloudStorageConfig from configs.middleware.storage.google_cloud_storage_config import GoogleCloudStorageConfig
from configs.middleware.storage.tencent_cos_storage_config import TencentCloudCOSStorageConfig from configs.middleware.storage.tencent_cos_storage_config import TencentCloudCOSStorageConfig
from configs.middleware.vdb.chroma_configs import ChromaConfigs from configs.middleware.vdb.chroma_config import ChromaConfig
from configs.middleware.vdb.milvus_configs import MilvusConfigs from configs.middleware.vdb.milvus_config import MilvusConfig
from configs.middleware.vdb.opensearch_configs import OpenSearchConfigs from configs.middleware.vdb.opensearch_config import OpenSearchConfig
from configs.middleware.vdb.oracle_configs import OracleConfigs from configs.middleware.vdb.oracle_config import OracleConfig
from configs.middleware.vdb.pgvector_configs import PGVectorConfigs from configs.middleware.vdb.pgvector_config import PGVectorConfig
from configs.middleware.vdb.pgvectors_configs import PGVectoRSConfigs from configs.middleware.vdb.pgvectors_config import PGVectoRSConfig
from configs.middleware.vdb.qdrant_configs import QdrantConfigs from configs.middleware.vdb.qdrant_config import QdrantConfig
from configs.middleware.vdb.relyt_configs import RelytConfigs from configs.middleware.vdb.relyt_config import RelytConfig
from configs.middleware.vdb.tencent_vector_configs import TencentVectorDBConfigs from configs.middleware.vdb.tencent_vector_config import TencentVectorDBConfig
from configs.middleware.vdb.tidb_vector_configs import TiDBVectorConfigs from configs.middleware.vdb.tidb_vector_config import TiDBVectorConfig
from configs.middleware.vdb.weaviate_configs import WeaviateConfigs from configs.middleware.vdb.weaviate_config import WeaviateConfig
class StorageConfigs(BaseModel): class StorageConfig(BaseModel):
STORAGE_TYPE: str = Field( STORAGE_TYPE: str = Field(
description='storage type,' description='storage type,'
' default to `local`,' ' default to `local`,'
@ -35,21 +35,21 @@ class StorageConfigs(BaseModel):
) )
class VectorStoreConfigs(BaseModel): class VectorStoreConfig(BaseModel):
VECTOR_STORE: Optional[str] = Field( VECTOR_STORE: Optional[str] = Field(
description='vector store type', description='vector store type',
default=None, default=None,
) )
class KeywordStoreConfigs(BaseModel): class KeywordStoreConfig(BaseModel):
KEYWORD_STORE: str = Field( KEYWORD_STORE: str = Field(
description='keyword store type', description='keyword store type',
default='jieba', default='jieba',
) )
class DatabaseConfigs: class DatabaseConfig:
DB_HOST: str = Field( DB_HOST: str = Field(
description='db host', description='db host',
default='localhost', default='localhost',
@ -130,7 +130,7 @@ class DatabaseConfigs:
} }
class CeleryConfigs(DatabaseConfigs): class CeleryConfig(DatabaseConfig):
CELERY_BACKEND: str = Field( CELERY_BACKEND: str = Field(
description='Celery backend, available values are `database`, `redis`', description='Celery backend, available values are `database`, `redis`',
default='database', default='database',
@ -155,13 +155,13 @@ class CeleryConfigs(DatabaseConfigs):
class MiddlewareConfig( class MiddlewareConfig(
# place the configs in alphabet order # place the configs in alphabet order
CeleryConfigs, CeleryConfig,
DatabaseConfigs, DatabaseConfig,
KeywordStoreConfigs, KeywordStoreConfig,
RedisConfig, RedisConfig,
# configs of storage and storage providers # configs of storage and storage providers
StorageConfigs, StorageConfig,
AliyunOSSStorageConfig, AliyunOSSStorageConfig,
AzureBlobStorageConfig, AzureBlobStorageConfig,
GoogleCloudStorageConfig, GoogleCloudStorageConfig,
@ -169,17 +169,17 @@ class MiddlewareConfig(
S3StorageConfig, S3StorageConfig,
# configs of vdb and vdb providers # configs of vdb and vdb providers
VectorStoreConfigs, VectorStoreConfig,
ChromaConfigs, ChromaConfig,
MilvusConfigs, MilvusConfig,
OpenSearchConfigs, OpenSearchConfig,
OracleConfigs, OracleConfig,
PGVectorConfigs, PGVectorConfig,
PGVectoRSConfigs, PGVectoRSConfig,
QdrantConfigs, QdrantConfig,
RelytConfigs, RelytConfig,
TencentVectorDBConfigs, TencentVectorDBConfig,
TiDBVectorConfigs, TiDBVectorConfig,
WeaviateConfigs, WeaviateConfig,
): ):
pass pass

View File

@ -3,7 +3,7 @@ from typing import Optional
from pydantic import BaseModel, Field, PositiveInt from pydantic import BaseModel, Field, PositiveInt
class ChromaConfigs(BaseModel): class ChromaConfig(BaseModel):
""" """
Chroma configs Chroma configs
""" """

View File

@ -3,7 +3,7 @@ from typing import Optional
from pydantic import BaseModel, Field, PositiveInt from pydantic import BaseModel, Field, PositiveInt
class MilvusConfigs(BaseModel): class MilvusConfig(BaseModel):
""" """
Milvus configs Milvus configs
""" """

View File

@ -3,7 +3,7 @@ from typing import Optional
from pydantic import BaseModel, Field, PositiveInt from pydantic import BaseModel, Field, PositiveInt
class OpenSearchConfigs(BaseModel): class OpenSearchConfig(BaseModel):
""" """
OpenSearch configs OpenSearch configs
""" """

View File

@ -3,7 +3,7 @@ from typing import Optional
from pydantic import BaseModel, Field, PositiveInt from pydantic import BaseModel, Field, PositiveInt
class OracleConfigs(BaseModel): class OracleConfig(BaseModel):
""" """
ORACLE configs ORACLE configs
""" """

View File

@ -3,7 +3,7 @@ from typing import Optional
from pydantic import BaseModel, Field, PositiveInt from pydantic import BaseModel, Field, PositiveInt
class PGVectorConfigs(BaseModel): class PGVectorConfig(BaseModel):
""" """
PGVector configs PGVector configs
""" """

View File

@ -3,7 +3,7 @@ from typing import Optional
from pydantic import BaseModel, Field, PositiveInt from pydantic import BaseModel, Field, PositiveInt
class PGVectoRSConfigs(BaseModel): class PGVectoRSConfig(BaseModel):
""" """
PGVectoRS configs PGVectoRS configs
""" """

View File

@ -3,7 +3,7 @@ from typing import Optional
from pydantic import BaseModel, Field, NonNegativeInt, PositiveInt from pydantic import BaseModel, Field, NonNegativeInt, PositiveInt
class QdrantConfigs(BaseModel): class QdrantConfig(BaseModel):
""" """
Qdrant configs Qdrant configs
""" """

View File

@ -3,7 +3,7 @@ from typing import Optional
from pydantic import BaseModel, Field, PositiveInt from pydantic import BaseModel, Field, PositiveInt
class RelytConfigs(BaseModel): class RelytConfig(BaseModel):
""" """
Relyt configs Relyt configs
""" """

View File

@ -3,7 +3,7 @@ from typing import Optional
from pydantic import BaseModel, Field, PositiveInt from pydantic import BaseModel, Field, PositiveInt
class TencentVectorDBConfigs(BaseModel): class TencentVectorDBConfig(BaseModel):
""" """
Tencent Vector configs Tencent Vector configs
""" """

View File

@ -3,7 +3,7 @@ from typing import Optional
from pydantic import BaseModel, Field, PositiveInt from pydantic import BaseModel, Field, PositiveInt
class TiDBVectorConfigs(BaseModel): class TiDBVectorConfig(BaseModel):
""" """
TiDB Vector configs TiDB Vector configs
""" """

View File

@ -3,7 +3,7 @@ from typing import Optional
from pydantic import BaseModel, Field, PositiveInt from pydantic import BaseModel, Field, PositiveInt
class WeaviateConfigs(BaseModel): class WeaviateConfig(BaseModel):
""" """
Weaviate configs Weaviate configs
""" """