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
|
|
|
"""
|
2024-09-22 13:38:41 +08:00
|
|
|
Configuration settings for Qdrant vector database
|
2024-06-20 16:24:10 +08:00
|
|
|
"""
|
|
|
|
|
|
|
|
QDRANT_URL: Optional[str] = Field(
|
2024-09-22 13:38:41 +08:00
|
|
|
description="URL of the Qdrant server (e.g., 'http://localhost:6333' or 'https://qdrant.example.com')",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
QDRANT_API_KEY: Optional[str] = Field(
|
2024-09-22 13:38:41 +08:00
|
|
|
description="API key for authenticating with the Qdrant server",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
QDRANT_CLIENT_TIMEOUT: NonNegativeInt = Field(
|
2024-09-22 13:38:41 +08:00
|
|
|
description="Timeout in seconds for Qdrant client operations (default is 20 seconds)",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=20,
|
|
|
|
)
|
|
|
|
|
|
|
|
QDRANT_GRPC_ENABLED: bool = Field(
|
2024-09-22 13:38:41 +08:00
|
|
|
description="Whether to enable gRPC support for Qdrant connection (True for gRPC, False for HTTP)",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=False,
|
|
|
|
)
|
|
|
|
|
|
|
|
QDRANT_GRPC_PORT: PositiveInt = Field(
|
2024-09-22 13:38:41 +08:00
|
|
|
description="Port number for gRPC connection to Qdrant server (default is 6334)",
|
2024-06-20 16:24:10 +08:00
|
|
|
default=6334,
|
|
|
|
)
|