feat: 核心模块增强 — 加密 + 运行时配置 + 日志缓冲
- crypto.py: API Key 加密/解密工具 - runtime_config.py: 运行时动态配置管理 - log_buffer.py: 内存日志缓冲区 - config.py: 新增加密配置项 - http_client.py: 增强重试和错误处理
This commit is contained in:
@@ -20,6 +20,7 @@ from src.db.unit_of_work import get_uow
|
||||
from src.llm.eval import settle_prediction
|
||||
from src.llm.predict import predict_match
|
||||
from src.llm.utils import actual_1x2
|
||||
from src.data.team_names_zh import zh_name
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -31,6 +32,8 @@ class BacktestMatchResult:
|
||||
league_code: str | None
|
||||
home_team: str
|
||||
away_team: str
|
||||
home_team_zh: str | None
|
||||
away_team_zh: str | None
|
||||
match_date: str
|
||||
actual_home: int
|
||||
actual_away: int
|
||||
@@ -54,6 +57,8 @@ class BacktestCandidate:
|
||||
league_code: str | None
|
||||
home_team: str
|
||||
away_team: str
|
||||
home_team_zh: str | None
|
||||
away_team_zh: str | None
|
||||
match_date: datetime
|
||||
home_goals: int
|
||||
away_goals: int
|
||||
@@ -113,6 +118,8 @@ async def _get_historical_matches(
|
||||
league_code=m.league.code if m.league else None,
|
||||
home_team=m.home_team.name if m.home_team else "?",
|
||||
away_team=m.away_team.name if m.away_team else "?",
|
||||
home_team_zh=zh_name(m.home_team.name) if m.home_team else None,
|
||||
away_team_zh=zh_name(m.away_team.name) if m.away_team else None,
|
||||
match_date=m.match_date,
|
||||
home_goals=m.home_goals,
|
||||
away_goals=m.away_goals,
|
||||
@@ -164,6 +171,8 @@ async def run_backtest(
|
||||
league_code=c.league_code,
|
||||
home_team=c.home_team,
|
||||
away_team=c.away_team,
|
||||
home_team_zh=c.home_team_zh,
|
||||
away_team_zh=c.away_team_zh,
|
||||
match_date=c.match_date.strftime("%Y-%m-%d") if c.match_date else "?",
|
||||
actual_home=c.home_goals,
|
||||
actual_away=c.away_goals,
|
||||
|
||||
Reference in New Issue
Block a user