Files
XingHuo/app/config/settings.py
T

55 lines
1.7 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""环境配置(从 .env 读取,见 .env.example)。"""
from decimal import Decimal
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
app_env: str = "development"
mysql_host: str = "127.0.0.1"
mysql_port: int = 3306
mysql_database: str = "jinrong_agent"
mysql_core_database: str = "jinrong_core"
mysql_user: str = "root"
mysql_password: str = ""
redis_url: str = "redis://127.0.0.1:6379/0"
neo4j_uri: str = "bolt://localhost:7687"
neo4j_user: str = "neo4j"
neo4j_password: str = ""
milvus_uri: str = "./data/milvus.db"
ollama_base_url: str = "http://127.0.0.1:11434"
embed_model: str = "bge-m3"
deepseek_api_key: str = ""
deepseek_base_url: str = "https://api.deepseek.com"
# ===== JWT(T-01 · JWT 手册 §4/§11)=====
# RS256 公钥路径(生产,私钥仅在 IdP);为空时用 HS256 + jwt_dev_secret(仅 development)
jwt_public_key_path: str = ""
jwt_dev_secret: str = "change-me-in-dev-only"
jwt_issuer: str = "https://idp.jinrong.internal"
jwt_audience: str = "agent-gateway"
# ===== Risk 阈值(默认值=冻结规则 · docs/PRD/附-风控规则表.md)=====
risk_assessment_valid_days: int = 365
risk_large_amount: Decimal = Decimal("500000")
risk_daily_total: Decimal = Decimal("500000")
risk_freq_count: int = 3
risk_probe_window_minutes: int = 5
risk_probe_count: int = 3
risk_probe_amount: Decimal = Decimal("400000")
risk_small_amount: Decimal = Decimal("10000")
risk_small_count: int = 3
risk_aml_default_threshold: Decimal = Decimal("0.85")
settings = Settings()