diff --git a/.gitignore b/.gitignore index bfb7ad8902..e71b381610 100644 --- a/.gitignore +++ b/.gitignore @@ -138,6 +138,7 @@ web/.vscode/settings.json !.idea/vcs.xml !.idea/icon.png .ideaDataSources/ +*.iml api/.env api/storage/* diff --git a/api/configs/middleware/__init__.py b/api/configs/middleware/__init__.py index 5ea557c87d..c454f4e603 100644 --- a/api/configs/middleware/__init__.py +++ b/api/configs/middleware/__init__.py @@ -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.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 +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 StorageConfigs(BaseModel): +class StorageConfig(BaseModel): STORAGE_TYPE: str = Field( description='storage type,' ' default to `local`,' @@ -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', @@ -130,7 +130,7 @@ class DatabaseConfigs: } -class CeleryConfigs(DatabaseConfigs): +class CeleryConfig(DatabaseConfig): CELERY_BACKEND: str = Field( description='Celery backend, available values are `database`, `redis`', default='database', @@ -155,13 +155,13 @@ class CeleryConfigs(DatabaseConfigs): 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, @@ -169,17 +169,17 @@ class MiddlewareConfig( 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 diff --git a/api/configs/middleware/vdb/chroma_configs.py b/api/configs/middleware/vdb/chroma_config.py similarity index 96% rename from api/configs/middleware/vdb/chroma_configs.py rename to api/configs/middleware/vdb/chroma_config.py index ddb61a564d..a764ddc796 100644 --- a/api/configs/middleware/vdb/chroma_configs.py +++ b/api/configs/middleware/vdb/chroma_config.py @@ -3,7 +3,7 @@ from typing import Optional from pydantic import BaseModel, Field, PositiveInt -class ChromaConfigs(BaseModel): +class ChromaConfig(BaseModel): """ Chroma configs """ diff --git a/api/configs/middleware/vdb/milvus_configs.py b/api/configs/middleware/vdb/milvus_config.py similarity index 96% rename from api/configs/middleware/vdb/milvus_configs.py rename to api/configs/middleware/vdb/milvus_config.py index f291a0e066..88855db877 100644 --- a/api/configs/middleware/vdb/milvus_configs.py +++ b/api/configs/middleware/vdb/milvus_config.py @@ -3,7 +3,7 @@ from typing import Optional from pydantic import BaseModel, Field, PositiveInt -class MilvusConfigs(BaseModel): +class MilvusConfig(BaseModel): """ Milvus configs """ diff --git a/api/configs/middleware/vdb/opensearch_configs.py b/api/configs/middleware/vdb/opensearch_config.py similarity index 95% rename from api/configs/middleware/vdb/opensearch_configs.py rename to api/configs/middleware/vdb/opensearch_config.py index 4e29c9c9d5..4d77e7be94 100644 --- a/api/configs/middleware/vdb/opensearch_configs.py +++ b/api/configs/middleware/vdb/opensearch_config.py @@ -3,7 +3,7 @@ from typing import Optional from pydantic import BaseModel, Field, PositiveInt -class OpenSearchConfigs(BaseModel): +class OpenSearchConfig(BaseModel): """ OpenSearch configs """ diff --git a/api/configs/middleware/vdb/oracle_configs.py b/api/configs/middleware/vdb/oracle_config.py similarity index 95% rename from api/configs/middleware/vdb/oracle_configs.py rename to api/configs/middleware/vdb/oracle_config.py index a70fd3efc2..e5c479a66f 100644 --- a/api/configs/middleware/vdb/oracle_configs.py +++ b/api/configs/middleware/vdb/oracle_config.py @@ -3,7 +3,7 @@ from typing import Optional from pydantic import BaseModel, Field, PositiveInt -class OracleConfigs(BaseModel): +class OracleConfig(BaseModel): """ ORACLE configs """ diff --git a/api/configs/middleware/vdb/pgvector_configs.py b/api/configs/middleware/vdb/pgvector_config.py similarity index 95% rename from api/configs/middleware/vdb/pgvector_configs.py rename to api/configs/middleware/vdb/pgvector_config.py index 2c6cf7486b..c544a84031 100644 --- a/api/configs/middleware/vdb/pgvector_configs.py +++ b/api/configs/middleware/vdb/pgvector_config.py @@ -3,7 +3,7 @@ from typing import Optional from pydantic import BaseModel, Field, PositiveInt -class PGVectorConfigs(BaseModel): +class PGVectorConfig(BaseModel): """ PGVector configs """ diff --git a/api/configs/middleware/vdb/pgvectors_configs.py b/api/configs/middleware/vdb/pgvectors_config.py similarity index 95% rename from api/configs/middleware/vdb/pgvectors_configs.py rename to api/configs/middleware/vdb/pgvectors_config.py index e2c8c1f725..78cb4e570e 100644 --- a/api/configs/middleware/vdb/pgvectors_configs.py +++ b/api/configs/middleware/vdb/pgvectors_config.py @@ -3,7 +3,7 @@ from typing import Optional from pydantic import BaseModel, Field, PositiveInt -class PGVectoRSConfigs(BaseModel): +class PGVectoRSConfig(BaseModel): """ PGVectoRS configs """ diff --git a/api/configs/middleware/vdb/qdrant_configs.py b/api/configs/middleware/vdb/qdrant_config.py similarity index 95% rename from api/configs/middleware/vdb/qdrant_configs.py rename to api/configs/middleware/vdb/qdrant_config.py index bee49921e6..f0223ffa1c 100644 --- a/api/configs/middleware/vdb/qdrant_configs.py +++ b/api/configs/middleware/vdb/qdrant_config.py @@ -3,7 +3,7 @@ from typing import Optional from pydantic import BaseModel, Field, NonNegativeInt, PositiveInt -class QdrantConfigs(BaseModel): +class QdrantConfig(BaseModel): """ Qdrant configs """ diff --git a/api/configs/middleware/vdb/relyt_configs.py b/api/configs/middleware/vdb/relyt_config.py similarity index 95% rename from api/configs/middleware/vdb/relyt_configs.py rename to api/configs/middleware/vdb/relyt_config.py index 621ecfb173..b550fa8e00 100644 --- a/api/configs/middleware/vdb/relyt_configs.py +++ b/api/configs/middleware/vdb/relyt_config.py @@ -3,7 +3,7 @@ from typing import Optional from pydantic import BaseModel, Field, PositiveInt -class RelytConfigs(BaseModel): +class RelytConfig(BaseModel): """ Relyt configs """ diff --git a/api/configs/middleware/vdb/tencent_vector_configs.py b/api/configs/middleware/vdb/tencent_vector_config.py similarity index 96% rename from api/configs/middleware/vdb/tencent_vector_configs.py rename to api/configs/middleware/vdb/tencent_vector_config.py index 7a5418030b..083f10b40b 100644 --- a/api/configs/middleware/vdb/tencent_vector_configs.py +++ b/api/configs/middleware/vdb/tencent_vector_config.py @@ -3,7 +3,7 @@ from typing import Optional from pydantic import BaseModel, Field, PositiveInt -class TencentVectorDBConfigs(BaseModel): +class TencentVectorDBConfig(BaseModel): """ Tencent Vector configs """ diff --git a/api/configs/middleware/vdb/tidb_vector_configs.py b/api/configs/middleware/vdb/tidb_vector_config.py similarity index 95% rename from api/configs/middleware/vdb/tidb_vector_configs.py rename to api/configs/middleware/vdb/tidb_vector_config.py index 5b81f8807b..53f985e386 100644 --- a/api/configs/middleware/vdb/tidb_vector_configs.py +++ b/api/configs/middleware/vdb/tidb_vector_config.py @@ -3,7 +3,7 @@ from typing import Optional from pydantic import BaseModel, Field, PositiveInt -class TiDBVectorConfigs(BaseModel): +class TiDBVectorConfig(BaseModel): """ TiDB Vector configs """ diff --git a/api/configs/middleware/vdb/weaviate_configs.py b/api/configs/middleware/vdb/weaviate_config.py similarity index 94% rename from api/configs/middleware/vdb/weaviate_configs.py rename to api/configs/middleware/vdb/weaviate_config.py index 369b631b6f..d1c9f5b5be 100644 --- a/api/configs/middleware/vdb/weaviate_configs.py +++ b/api/configs/middleware/vdb/weaviate_config.py @@ -3,7 +3,7 @@ from typing import Optional from pydantic import BaseModel, Field, PositiveInt -class WeaviateConfigs(BaseModel): +class WeaviateConfig(BaseModel): """ Weaviate configs """