lindorm_config.py 1005 B

12345678910111213141516171819202122232425262728293031323334
  1. from typing import Optional
  2. from pydantic import Field
  3. from pydantic_settings import BaseSettings
  4. class LindormConfig(BaseSettings):
  5. """
  6. Lindorm configs
  7. """
  8. LINDORM_URL: Optional[str] = Field(
  9. description="Lindorm url",
  10. default=None,
  11. )
  12. LINDORM_USERNAME: Optional[str] = Field(
  13. description="Lindorm user",
  14. default=None,
  15. )
  16. LINDORM_PASSWORD: Optional[str] = Field(
  17. description="Lindorm password",
  18. default=None,
  19. )
  20. DEFAULT_INDEX_TYPE: Optional[str] = Field(
  21. description="Lindorm Vector Index Type, hnsw or flat is available in dify",
  22. default="hnsw",
  23. )
  24. DEFAULT_DISTANCE_TYPE: Optional[str] = Field(
  25. description="Vector Distance Type, support l2, cosinesimil, innerproduct", default="l2"
  26. )
  27. USING_UGC_INDEX: Optional[bool] = Field(
  28. description="Using UGC index will store the same type of Index in a single index but can retrieve separately.",
  29. default=False,
  30. )