vikingdb_config.py 1.5 KB

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