program/config.py

57 lines
2.1 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.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
系统配置文件
"""
import os
class Config:
# 数据库配置
DB_HOST = os.getenv('DB_HOST', '192.168.75.129')
DB_PORT = int(os.getenv('DB_PORT', 3306))
DB_USER = os.getenv('DB_USER', 'dbuser1')
DB_PASSWORD = os.getenv('DB_PASSWORD', 'Wangdong@192')
DB_NAME = os.getenv('DB_NAME', 'openclaw_db')
# 组态王API配置
API_URL = os.getenv('API_URL', 'https://dltkhmi.shendong.vip:9006/query/getRealtimeData')
USER_HANDLE = os.getenv('USER_HANDLE', 'k61d4e5bf-4c51-41ab-bbb6d-056eafc01d63_master')
BATCH_SIZE = 100
# AI模型配置 - 支持多模型切换
AI_MODELS = {
'kimi': {
'name': 'Kimi (Qwen3.5-122B-A10B)',
'api_url': 'http://10.248.248.20:3101/sdgpt/api/v1/chat/completions',
'api_key': 'shendongapi-cHVOxVFfQ9Z6qSK5s0BiNlgYohmleQxPzZNhldHYWqT0gUMAr2MJujXiSwu6',
'model': 'Qwen3.5-122B-A10B'
},
'deepseek': {
'name': 'DeepSeek-V3.2-671B',
'api_url': 'http://10.248.248.20:3101/sdgpt/api/v1/chat/completions',
'api_key': 'shendongapi-cHVOxVFfQ9Z6qSK5s0BiNlgYohmleQxPzZNhldHYWqT0gUMAr2MJujXiSwu6',
'model': 'DeepSeek-V3.2-671B'
},
'qwen': {
'name': 'Qwen2.5-VL-72B',
'api_url': 'http://10.248.248.20:3101/sdgpt/api/v1/chat/completions',
'api_key': 'shendongapi-cHVOxVFfQ9Z6qSK5s0BiNlgYohmleQxPzZNhldHYWqT0gUMAr2MJujXiSwu6',
'model': 'Qwen2.5-VL-72B'
},
'zhipu': {
'name': 'DeepSeek-R1-671B-0528',
'api_url': 'http://10.248.248.20:3101/sdgpt/api/v1/chat/completions',
'api_key': 'shendongapi-cHVOxVFfQ9Z6qSK5s0BiNlgYohmleQxPzZNhldHYWqT0gUMAr2MJujXiSwu6',
'model': 'DeepSeek-R1-671B-0528'
}
}
# 默认AI模型
DEFAULT_AI_MODEL = os.getenv('DEFAULT_AI_MODEL', 'qwen')
# AI API超时时间默认300秒5分钟
AI_API_TIMEOUT = int(os.getenv('AI_API_TIMEOUT', 300))
# Secret Key
SECRET_KEY = os.getenv('SECRET_KEY', 'mining-system-secret-key-2024')