You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
"""
无人机决策系统 - 配置文件
作者:刘宇杰
日期: 2025-07-13
功能说明:
本文件定义全局配置参数, 包括API密钥、数据库路径、上传目录、允许的文件类型等。
"""
import os
from pathlib import Path
# 基础配置
class Settings :
# 项目根目录
BASE_DIR = Path ( __file__ ) . resolve ( ) . parent . parent
# 文心大模型API配置
ERNIE_API_KEY = " bce-v3/ALTAK-d9EuFZrO8ZIViw4fywXCp/bd1c6d19fe2a2596613298e292ef38c845064a30 " # 替换为你的API密钥
ERNIE_API_URL = " https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ERNIE-4.5-Turbo-128K-Preview "
# 数据库配置
DATABASE_PATH = os . path . join ( BASE_DIR , " data " , " history.db " )
# 文件上传配置
UPLOAD_FOLDER = os . path . join ( BASE_DIR , " data " , " uploads " )
ALLOWED_IMAGE_EXTENSIONS = { ' png ' , ' jpg ' , ' jpeg ' , ' gif ' }
ALLOWED_TEXT_EXTENSIONS = { ' txt ' , ' pdf ' , ' docx ' }
# 界面样式配置
PRIMARY_COLOR = " #2c3e50 "
SECONDARY_COLOR = " #3498db "
BACKGROUND_COLOR = " #ecf0f1 "
TEXT_COLOR = " #2c3e50 "
settings = Settings ( )