refactor: extract vdb configs into pydantic-setting based dify configs (#5426)
This commit is contained in:
parent
142dc0afd7
commit
65d34ebb96
12 changed files with 377 additions and 84 deletions
34
api/configs/middleware/vdb/qdrant_configs.py
Normal file
34
api/configs/middleware/vdb/qdrant_configs.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field, NonNegativeInt, PositiveInt
|
||||
|
||||
|
||||
class QdrantConfigs(BaseModel):
|
||||
"""
|
||||
Qdrant configs
|
||||
"""
|
||||
|
||||
QDRANT_URL: Optional[str] = Field(
|
||||
description='Qdrant url',
|
||||
default=None,
|
||||
)
|
||||
|
||||
QDRANT_API_KEY: Optional[str] = Field(
|
||||
description='Qdrant api key',
|
||||
default=None,
|
||||
)
|
||||
|
||||
QDRANT_CLIENT_TIMEOUT: NonNegativeInt = Field(
|
||||
description='Qdrant client timeout in seconds',
|
||||
default=20,
|
||||
)
|
||||
|
||||
QDRANT_GRPC_ENABLED: bool = Field(
|
||||
description='whether enable grpc support for Qdrant connection',
|
||||
default=False,
|
||||
)
|
||||
|
||||
QDRANT_GRPC_PORT: PositiveInt = Field(
|
||||
description='Qdrant grpc port',
|
||||
default=6334,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue