__init__.py 983 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. from typing import Optional
  2. from pydantic import BaseModel, Field
  3. from configs.middleware.redis_configs import RedisConfigs
  4. class StorageConfigs(BaseModel):
  5. STORAGE_TYPE: str = Field(
  6. description='storage type,'
  7. ' default to `local`,'
  8. ' available values are `local`, `s3`, `azure-blob`, `aliyun-oss`, `google-storage`.',
  9. default='local',
  10. )
  11. STORAGE_LOCAL_PATH: str = Field(
  12. description='local storage path',
  13. default='storage',
  14. )
  15. class VectorStoreConfigs(BaseModel):
  16. VECTOR_STORE: Optional[str] = Field(
  17. description='vector store type',
  18. default=None,
  19. )
  20. class KeywordStoreConfigs(BaseModel):
  21. KEYWORD_STORE: str = Field(
  22. description='keyword store type',
  23. default='jieba',
  24. )
  25. class MiddlewareConfigs(
  26. # place the configs in alphabet order
  27. KeywordStoreConfigs,
  28. RedisConfigs,
  29. StorageConfigs,
  30. VectorStoreConfigs,
  31. ):
  32. pass