vikingdb_config.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from typing import Optional
  2. from pydantic import Field
  3. from pydantic_settings import BaseSettings
  4. class VikingDBConfig(BaseSettings):
  5. """
  6. Configuration for connecting to Volcengine VikingDB.
  7. Refer to the following documentation for details on obtaining credentials:
  8. https://www.volcengine.com/docs/6291/65568
  9. """
  10. VIKINGDB_ACCESS_KEY: Optional[str] = Field(
  11. description="The Access Key provided by Volcengine VikingDB for API authentication."
  12. "Refer to the following documentation for details on obtaining credentials:"
  13. "https://www.volcengine.com/docs/6291/65568",
  14. default=None,
  15. )
  16. VIKINGDB_SECRET_KEY: Optional[str] = Field(
  17. description="The Secret Key provided by Volcengine VikingDB for API authentication.",
  18. default=None,
  19. )
  20. VIKINGDB_REGION: str = Field(
  21. description="The region of the Volcengine VikingDB service.(e.g., 'cn-shanghai', 'cn-beijing').",
  22. default="cn-shanghai",
  23. )
  24. VIKINGDB_HOST: str = Field(
  25. description="The host of the Volcengine VikingDB service.(e.g., 'api-vikingdb.volces.com', \
  26. 'api-vikingdb.mlp.cn-shanghai.volces.com')",
  27. default="api-vikingdb.mlp.cn-shanghai.volces.com",
  28. )
  29. VIKINGDB_SCHEME: str = Field(
  30. description="The scheme of the Volcengine VikingDB service.(e.g., 'http', 'https').",
  31. default="http",
  32. )
  33. VIKINGDB_CONNECTION_TIMEOUT: int = Field(
  34. description="The connection timeout of the Volcengine VikingDB service.",
  35. default=30,
  36. )
  37. VIKINGDB_SOCKET_TIMEOUT: int = Field(
  38. description="The socket timeout of the Volcengine VikingDB service.",
  39. default=30,
  40. )