2024-10-12 15:24:17 +00:00
|
|
|
from pydantic import Field, NonNegativeInt, PositiveInt
|
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BaiduVectorDBConfig(BaseSettings):
|
|
|
|
|
"""
|
|
|
|
|
Configuration settings for Baidu Vector Database
|
|
|
|
|
"""
|
|
|
|
|
|
2025-09-15 05:06:33 +00:00
|
|
|
BAIDU_VECTOR_DB_ENDPOINT: str | None = Field(
|
2024-10-12 15:24:17 +00:00
|
|
|
description="URL of the Baidu Vector Database service (e.g., 'http://vdb.bj.baidubce.com')",
|
|
|
|
|
default=None,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
BAIDU_VECTOR_DB_CONNECTION_TIMEOUT_MS: PositiveInt = Field(
|
|
|
|
|
description="Timeout in milliseconds for Baidu Vector Database operations (default is 30000 milliseconds)",
|
|
|
|
|
default=30000,
|
|
|
|
|
)
|
|
|
|
|
|
2025-09-15 05:06:33 +00:00
|
|
|
BAIDU_VECTOR_DB_ACCOUNT: str | None = Field(
|
2024-10-12 15:24:17 +00:00
|
|
|
description="Account for authenticating with the Baidu Vector Database",
|
|
|
|
|
default=None,
|
|
|
|
|
)
|
|
|
|
|
|
2025-09-15 05:06:33 +00:00
|
|
|
BAIDU_VECTOR_DB_API_KEY: str | None = Field(
|
2024-10-12 15:24:17 +00:00
|
|
|
description="API key for authenticating with the Baidu Vector Database service",
|
|
|
|
|
default=None,
|
|
|
|
|
)
|
|
|
|
|
|
2025-09-15 05:06:33 +00:00
|
|
|
BAIDU_VECTOR_DB_DATABASE: str | None = Field(
|
2024-10-12 15:24:17 +00:00
|
|
|
description="Name of the specific Baidu Vector Database to connect to",
|
|
|
|
|
default=None,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
BAIDU_VECTOR_DB_SHARD: PositiveInt = Field(
|
|
|
|
|
description="Number of shards for the Baidu Vector Database (default is 1)",
|
|
|
|
|
default=1,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
BAIDU_VECTOR_DB_REPLICAS: NonNegativeInt = Field(
|
|
|
|
|
description="Number of replicas for the Baidu Vector Database (default is 3)",
|
|
|
|
|
default=3,
|
|
|
|
|
)
|
2025-09-22 02:17:35 +00:00
|
|
|
|
|
|
|
|
BAIDU_VECTOR_DB_INVERTED_INDEX_ANALYZER: str = Field(
|
|
|
|
|
description="Analyzer type for inverted index in Baidu Vector Database (default is DEFAULT_ANALYZER)",
|
|
|
|
|
default="DEFAULT_ANALYZER",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
BAIDU_VECTOR_DB_INVERTED_INDEX_PARSER_MODE: str = Field(
|
|
|
|
|
description="Parser mode for inverted index in Baidu Vector Database (default is COARSE_MODE)",
|
|
|
|
|
default="COARSE_MODE",
|
|
|
|
|
)
|
2026-03-23 12:42:57 +00:00
|
|
|
|
|
|
|
|
BAIDU_VECTOR_DB_AUTO_BUILD_ROW_COUNT_INCREMENT: int = Field(
|
|
|
|
|
description="Auto build row count increment threshold (default is 500)",
|
|
|
|
|
default=500,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
BAIDU_VECTOR_DB_AUTO_BUILD_ROW_COUNT_INCREMENT_RATIO: float = Field(
|
|
|
|
|
description="Auto build row count increment ratio threshold (default is 0.05)",
|
|
|
|
|
default=0.05,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
BAIDU_VECTOR_DB_REBUILD_INDEX_TIMEOUT_IN_SECONDS: int = Field(
|
|
|
|
|
description="Timeout in seconds for rebuilding the index in Baidu Vector Database (default is 3600 seconds)",
|
|
|
|
|
default=300,
|
|
|
|
|
)
|