Files
crypto_monitor/manual_trading_hub/hub_ai/config.py
T
dekun 62e48dab92 feat(hub): enrich AI coach with fund history, closed trades, and chat uploads
- Add 15-day fund snapshot store and /api/hub/account on all instances

- Summary includes yesterday/today trades, fund columns, and section 5 操作建议

- Chat context distinguishes empty positions from local monitors

- Support image/document attachments in AI chat

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 08:54:20 +08:00

38 lines
917 B
Python

"""中控 AI 配置(读 hub .env,与实例同名 AI 变量)。"""
from __future__ import annotations
import os
HUB_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SUMMARY_TEMPERATURE = 0.15
CHAT_TEMPERATURE = 0.5
CHAT_MAX_HISTORY_TURNS = 20
SUMMARY_RETENTION_DAYS = 90
CHAT_SESSION_RETENTION_DAYS = 60
FUND_HISTORY_DAYS = 15
CHAT_MAX_ATTACHMENTS = 3
CHAT_MAX_IMAGE_BYTES = 4 * 1024 * 1024
CHAT_MAX_TEXT_FILE_BYTES = 200 * 1024
def trading_day_reset_hour() -> int:
try:
return int(os.getenv("TRADING_DAY_RESET_HOUR", "8") or "8")
except ValueError:
return 8
def hub_flask_timeout() -> float:
try:
return float(os.getenv("HUB_FLASK_TIMEOUT", "10") or "10")
except ValueError:
return 10.0
def hub_agent_timeout() -> float:
try:
return float(os.getenv("HUB_AGENT_TIMEOUT", "8") or "8")
except ValueError:
return 8.0