opensearch_config.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. from typing import Optional
  2. from pydantic import Field, PositiveInt
  3. from pydantic_settings import BaseSettings
  4. class OpenSearchConfig(BaseSettings):
  5. """
  6. Configuration settings for OpenSearch
  7. """
  8. OPENSEARCH_HOST: Optional[str] = Field(
  9. description="Hostname or IP address of the OpenSearch server (e.g., 'localhost' or 'opensearch.example.com')",
  10. default=None,
  11. )
  12. OPENSEARCH_PORT: PositiveInt = Field(
  13. description="Port number on which the OpenSearch server is listening (default is 9200)",
  14. default=9200,
  15. )
  16. OPENSEARCH_USER: Optional[str] = Field(
  17. description="Username for authenticating with OpenSearch",
  18. default=None,
  19. )
  20. OPENSEARCH_PASSWORD: Optional[str] = Field(
  21. description="Password for authenticating with OpenSearch",
  22. default=None,
  23. )
  24. OPENSEARCH_SECURE: bool = Field(
  25. description="Whether to use SSL/TLS encrypted connection for OpenSearch (True for HTTPS, False for HTTP)",
  26. default=False,
  27. )