mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
41 lines
861 B
Python
41 lines
861 B
Python
from typing import Optional
|
|
|
|
from pydantic import Field, NonNegativeInt, PositiveInt
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class RedisConfig(BaseSettings):
|
|
"""
|
|
Redis configs
|
|
"""
|
|
|
|
REDIS_HOST: str = Field(
|
|
description="Redis host",
|
|
default="localhost",
|
|
)
|
|
|
|
REDIS_PORT: PositiveInt = Field(
|
|
description="Redis port",
|
|
default=6379,
|
|
)
|
|
|
|
REDIS_USERNAME: Optional[str] = Field(
|
|
description="Redis username",
|
|
default=None,
|
|
)
|
|
|
|
REDIS_PASSWORD: Optional[str] = Field(
|
|
description="Redis password",
|
|
default=None,
|
|
)
|
|
|
|
REDIS_DB: NonNegativeInt = Field(
|
|
description="Redis database id, default to 0",
|
|
default=0,
|
|
)
|
|
|
|
REDIS_USE_SSL: bool = Field(
|
|
description="whether to use SSL for Redis connection",
|
|
default=False,
|
|
)
|