2024-06-20 16:24:10 +08:00
|
|
|
from typing import Optional
|
|
|
|
|
2024-07-07 12:18:15 +08:00
|
|
|
from pydantic import Field, NonNegativeInt, PositiveInt
|
|
|
|
from pydantic_settings import BaseSettings
|
2024-06-20 16:24:10 +08:00
|
|
|
|
|
|
|
|
2024-07-07 12:18:15 +08:00
|
|
|
class QdrantConfig(BaseSettings):
|
2024-06-20 16:24:10 +08:00
|
|
|
"""
|
|
|
|
Qdrant configs
|
|
|
|
"""
|
|
|
|
|
|
|
|
QDRANT_URL: Optional[str] = Field(
|
2024-08-23 23:46:01 +08:00
|
|
|
description="Qdrant url",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
QDRANT_API_KEY: Optional[str] = Field(
|
2024-08-23 23:46:01 +08:00
|
|
|
description="Qdrant api key",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
QDRANT_CLIENT_TIMEOUT: NonNegativeInt = Field(
|
2024-08-23 23:46:01 +08:00
|
|
|
description="Qdrant client timeout in seconds",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=20,
|
|
|
|
)
|
|
|
|
|
|
|
|
QDRANT_GRPC_ENABLED: bool = Field(
|
2024-08-23 23:46:01 +08:00
|
|
|
description="whether enable grpc support for Qdrant connection",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=False,
|
|
|
|
)
|
|
|
|
|
|
|
|
QDRANT_GRPC_PORT: PositiveInt = Field(
|
2024-08-23 23:46:01 +08:00
|
|
|
description="Qdrant grpc port",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=6334,
|
|
|
|
)
|