1 line
5.3 KiB
JSON
1 line
5.3 KiB
JSON
{"repo": "aspirin-s/zhilian-robot", "files": {"backend/config/settings.py": {"bfa376b78305896b138c65500b93a99c5740e843": {"t": 1785745981.3894737, "n": 2234, "h": "7b2398957d167639", "c": "\"\"\"\n智链机器人 - 配置管理模块\n\"\"\"\nfrom pydantic_settings import BaseSettings\nfrom typing import List\nfrom functools import lru_cache\n\n\nclass Settings(BaseSettings):\n \"\"\"应用配置\"\"\"\n \n # 应用基础配置\n APP_NAME: str = \"智链机器人\"\n APP_VERSION: str = \"1.0.0\"\n DEBUG: bool = True\n ENV: str = \"development\"\n \n # 服务器配置\n HOST: str = \"0.0.0.0\"\n PORT: int = 8000\n \n # Neo4j配置\n NEO4J_URI: str = \"bolt://localhost:7687\"\n NEO4J_USER: str = \"neo4j\"\n NEO4J_PASSWORD: str = \"password\"\n \n # MongoDB配置\n MONGODB_URI: str = \"mongodb://localhost:27017\"\n MONGODB_DATABASE: str = \"zhilian_robot\"\n \n # Redis配置\n REDIS_HOST: str = \"localhost\"\n REDIS_PORT: int = 6379\n REDIS_PASSWORD: str = \"\"\n REDIS_DB: int = 0\n \n # MySQL配置\n MYSQL_HOST: str = \"localhost\"\n MYSQL_PORT: int = 3306\n MYSQL_USER: str = \"root\"\n MYSQL_PASSWORD: str = \"password\"\n MYSQL_DATABASE: str = \"zhilian_robot\"\n \n # AI模型配置\n # DeepSeek API (兼容 OpenAI 接口)\n OPENAI_API_KEY: str = \"\" # 使用 DeepSeek API Key\n OPENAI_API_BASE: str = \"https://api.deepseek.com\" # DeepSeek API Base URL\n OPENAI_MODEL: str = \"deepseek-chat\" # DeepSeek 模型名称\n HF_TOKEN: str = \"\"\n HF_MODEL: str = \"bert-base-chinese\"\n \n # NLP模型配置\n NER_MODEL: str = \"ckiplab/bert-base-chinese-ner\"\n RE_MODEL: str = \"hfl/chinese-roberta-wwm-ext\"\n \n # 爬虫配置\n CRAWLER_USER_AGENT: str = \"Mozilla/5.0 (Windows NT 10.0; Win64; x64)\"\n CRAWLER_DELAY: int = 2\n CRAWLER_CONCURRENT: int = 5\n \n # 安全配置\n SECRET_KEY: str = \"change-this-secret-key-in-production\"\n ALGORITHM: str = \"HS256\"\n ACCESS_TOKEN_EXPIRE_MINUTES: int = 30\n \n # CORS配置\n CORS_ORIGINS: List[str] = [\n \"http://localhost\",\n \"http://localhost:80\",\n \"http://localhost:3000\",\n \"http://localhost:8000\",\n \"http://127.0.0.1\",\n \"http://127.0.0.1:80\",\n \"http://127.0.0.1:3000\",\n \"http://127.0.0.1:8000\"\n ]\n \n # 日志配置\n LOG_LEVEL: str = \"INFO\"\n LOG_FILE: str = \"logs/app.log\"\n \n class Config:\n env_file = \".env\"\n case_sensitive = True\n\n\n@lru_cache()\ndef get_settings() -> Settings:\n \"\"\"获取配置单例\"\"\"\n return Settings()\n\n\n# 配置实例\nsettings = get_settings()\n"}, "2a0246177e30b6a4029d3864b3b278967ef5eb73": {"t": 1785758498.380136, "n": 2234, "h": "7b2398957d167639", "c": "\"\"\"\n智链机器人 - 配置管理模块\n\"\"\"\nfrom pydantic_settings import BaseSettings\nfrom typing import List\nfrom functools import lru_cache\n\n\nclass Settings(BaseSettings):\n \"\"\"应用配置\"\"\"\n \n # 应用基础配置\n APP_NAME: str = \"智链机器人\"\n APP_VERSION: str = \"1.0.0\"\n DEBUG: bool = True\n ENV: str = \"development\"\n \n # 服务器配置\n HOST: str = \"0.0.0.0\"\n PORT: int = 8000\n \n # Neo4j配置\n NEO4J_URI: str = \"bolt://localhost:7687\"\n NEO4J_USER: str = \"neo4j\"\n NEO4J_PASSWORD: str = \"password\"\n \n # MongoDB配置\n MONGODB_URI: str = \"mongodb://localhost:27017\"\n MONGODB_DATABASE: str = \"zhilian_robot\"\n \n # Redis配置\n REDIS_HOST: str = \"localhost\"\n REDIS_PORT: int = 6379\n REDIS_PASSWORD: str = \"\"\n REDIS_DB: int = 0\n \n # MySQL配置\n MYSQL_HOST: str = \"localhost\"\n MYSQL_PORT: int = 3306\n MYSQL_USER: str = \"root\"\n MYSQL_PASSWORD: str = \"password\"\n MYSQL_DATABASE: str = \"zhilian_robot\"\n \n # AI模型配置\n # DeepSeek API (兼容 OpenAI 接口)\n OPENAI_API_KEY: str = \"\" # 使用 DeepSeek API Key\n OPENAI_API_BASE: str = \"https://api.deepseek.com\" # DeepSeek API Base URL\n OPENAI_MODEL: str = \"deepseek-chat\" # DeepSeek 模型名称\n HF_TOKEN: str = \"\"\n HF_MODEL: str = \"bert-base-chinese\"\n \n # NLP模型配置\n NER_MODEL: str = \"ckiplab/bert-base-chinese-ner\"\n RE_MODEL: str = \"hfl/chinese-roberta-wwm-ext\"\n \n # 爬虫配置\n CRAWLER_USER_AGENT: str = \"Mozilla/5.0 (Windows NT 10.0; Win64; x64)\"\n CRAWLER_DELAY: int = 2\n CRAWLER_CONCURRENT: int = 5\n \n # 安全配置\n SECRET_KEY: str = \"change-this-secret-key-in-production\"\n ALGORITHM: str = \"HS256\"\n ACCESS_TOKEN_EXPIRE_MINUTES: int = 30\n \n # CORS配置\n CORS_ORIGINS: List[str] = [\n \"http://localhost\",\n \"http://localhost:80\",\n \"http://localhost:3000\",\n \"http://localhost:8000\",\n \"http://127.0.0.1\",\n \"http://127.0.0.1:80\",\n \"http://127.0.0.1:3000\",\n \"http://127.0.0.1:8000\"\n ]\n \n # 日志配置\n LOG_LEVEL: str = \"INFO\"\n LOG_FILE: str = \"logs/app.log\"\n \n class Config:\n env_file = \".env\"\n case_sensitive = True\n\n\n@lru_cache()\ndef get_settings() -> Settings:\n \"\"\"获取配置单例\"\"\"\n return Settings()\n\n\n# 配置实例\nsettings = get_settings()\n"}}}} |