83 lines
2.1 KiB
Python
83 lines
2.1 KiB
Python
from pydantic_settings import BaseSettings
|
|
from typing import Optional
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# Qwen API配置
|
|
qwen_api_key: str = ""
|
|
qwen_base_url: str = "https://dashscope.aliyuncs.com/api/v1"
|
|
qwen_model: str = "qwen-max"
|
|
qwen_vl_model: str = "qwen-vl-plus"
|
|
|
|
# DeepSeek API配置
|
|
deepseek_api_key: str = ""
|
|
deepseek_base_url: str = "https://api.deepseek.com/v1"
|
|
deepseek_model: str = "deepseek-v3"
|
|
|
|
# PostgreSQL
|
|
postgres_host: str = "localhost"
|
|
postgres_port: int = 5432
|
|
postgres_user: str = "postgresql"
|
|
postgres_password: str = "postgresql123456"
|
|
postgres_db: str = "mydb"
|
|
|
|
# Redis
|
|
redis_host: str = "localhost"
|
|
redis_port: int = 6379
|
|
redis_password: str = ""
|
|
|
|
# MinIO
|
|
minio_endpoint: str = "localhost:9000"
|
|
minio_access_key: str = "minioadmin"
|
|
minio_secret_key: str = "minioadmin"
|
|
minio_bucket: str = "regulation-docs"
|
|
minio_secure: bool = False
|
|
|
|
# Milvus
|
|
milvus_host: str = "localhost"
|
|
milvus_port: int = 19530
|
|
|
|
# Neo4j
|
|
neo4j_uri: str = "bolt://localhost:7687"
|
|
neo4j_user: str = "neo4j"
|
|
neo4j_password: str = "neo4j123"
|
|
|
|
# RabbitMQ
|
|
rabbitmq_host: str = "localhost"
|
|
rabbitmq_port: int = 5672
|
|
rabbitmq_user: str = "admin"
|
|
rabbitmq_password: str = "admin@123"
|
|
|
|
# LLM配置
|
|
llm_model: str = "qwen-max"
|
|
embedding_model: str = "text-embedding-v3"
|
|
embedding_dim: int = 1536
|
|
|
|
# 检索配置
|
|
vector_top_k: int = 10
|
|
bm25_top_k: int = 10
|
|
final_top_k: int = 5
|
|
|
|
# 分块配置
|
|
chunk_size: int = 800
|
|
chunk_overlap: int = 50
|
|
|
|
# 服务配置
|
|
api_host: str = "0.0.0.0"
|
|
api_port: int = 8000
|
|
|
|
# Collection名称
|
|
regulations_collection: str = "vehicle_regulations"
|
|
compliance_collection: str = "compliance_cache"
|
|
|
|
# 数据目录
|
|
data_raw_dir: str = "/airegulation/demo-mao/backend/data/raw"
|
|
data_parsed_dir: str = "/airegulation/demo-mao/backend/data/parsed"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
case_sensitive = False
|
|
|
|
|
|
settings = Settings() |