Profeto — 给 LLM 提供数据,让 LLM 预测足球比分。 核心模块: - FastAPI 后端 + PostgreSQL (SQLAlchemy async) - 多 Agent LLM 预测 (5 专家 + 终裁) - 数据采集 (bzzoiro / understat / injuries) - React 前端 (Vite + Tailwind) 包含: - 数据源抽象 (DataSource 协议 + 注册表) - Alembic 数据库迁移 - Prompt 模板 (单/多 Agent) - 核心路径单元测试
29 lines
856 B
Python
29 lines
856 B
Python
"""add agent outputs to predictions
|
|
|
|
Revision ID: 0002_agent_outputs
|
|
Revises: 0001_initial
|
|
Create Date: 2026-09-08
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import postgresql
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = '0002_agent_outputs'
|
|
down_revision: Union[str, None] = '0001_initial'
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column('predictions', sa.Column('mode', sa.String(length=20), nullable=False, server_default='single'))
|
|
op.add_column('predictions', sa.Column('agent_outputs', postgresql.JSONB(astext_type=sa.Text()), nullable=True))
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column('predictions', 'agent_outputs')
|
|
op.drop_column('predictions', 'mode')
|