初始化

This commit is contained in:
2026-05-11 11:22:55 +08:00
parent 5f6c571434
commit 80dcd070f7
39 changed files with 1997 additions and 0 deletions

41
app/core/config.py Normal file
View File

@@ -0,0 +1,41 @@
from pydantic_settings import BaseSettings
from typing import Optional
class Settings(BaseSettings):
# DashScope API
dashscope_api_key: str = ""
# Milvus
milvus_host: str = "localhost"
milvus_port: int = 19530
# 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"
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = False
settings = Settings()