67 lines
2.1 KiB
Python
67 lines
2.1 KiB
Python
|
|
"""Add Phase F fields to automation_agent_definitions.
|
||
|
|
|
||
|
|
Adds temperature, max_tokens, max_steps, trace_mode, skill_ids,
|
||
|
|
trigger_config, and ai_use_case_metadata to support the Phase F
|
||
|
|
context-builder, SSE streaming, and AI-use-case features.
|
||
|
|
|
||
|
|
Revision ID: 0122
|
||
|
|
Revises: 0121
|
||
|
|
"""
|
||
|
|
|
||
|
|
from alembic import op
|
||
|
|
import sqlalchemy as sa
|
||
|
|
from sqlalchemy.dialects.postgresql import JSONB
|
||
|
|
|
||
|
|
revision = "0122"
|
||
|
|
down_revision = "0121"
|
||
|
|
branch_labels = None
|
||
|
|
depends_on = None
|
||
|
|
|
||
|
|
|
||
|
|
def upgrade() -> None:
|
||
|
|
op.add_column(
|
||
|
|
"automation_agent_definitions",
|
||
|
|
sa.Column("temperature", sa.Float, nullable=False, server_default="0.3"),
|
||
|
|
)
|
||
|
|
op.add_column(
|
||
|
|
"automation_agent_definitions",
|
||
|
|
sa.Column("max_tokens", sa.Integer, nullable=False, server_default="1000"),
|
||
|
|
)
|
||
|
|
op.add_column(
|
||
|
|
"automation_agent_definitions",
|
||
|
|
sa.Column("max_steps", sa.Integer, nullable=False, server_default="20"),
|
||
|
|
)
|
||
|
|
op.add_column(
|
||
|
|
"automation_agent_definitions",
|
||
|
|
sa.Column(
|
||
|
|
"trace_mode", sa.String(20), nullable=False, server_default="standard"
|
||
|
|
),
|
||
|
|
)
|
||
|
|
op.add_column(
|
||
|
|
"automation_agent_definitions",
|
||
|
|
sa.Column("skill_ids", JSONB, nullable=False, server_default=sa.text("'[]'::jsonb")),
|
||
|
|
)
|
||
|
|
op.add_column(
|
||
|
|
"automation_agent_definitions",
|
||
|
|
sa.Column("trigger_config", JSONB, nullable=False, server_default=sa.text("'{}'::jsonb")),
|
||
|
|
)
|
||
|
|
op.add_column(
|
||
|
|
"automation_agent_definitions",
|
||
|
|
sa.Column(
|
||
|
|
"ai_use_case_metadata",
|
||
|
|
JSONB,
|
||
|
|
nullable=False,
|
||
|
|
server_default=sa.text("'{}'::jsonb"),
|
||
|
|
),
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
def downgrade() -> None:
|
||
|
|
op.drop_column("automation_agent_definitions", "ai_use_case_metadata")
|
||
|
|
op.drop_column("automation_agent_definitions", "trigger_config")
|
||
|
|
op.drop_column("automation_agent_definitions", "skill_ids")
|
||
|
|
op.drop_column("automation_agent_definitions", "trace_mode")
|
||
|
|
op.drop_column("automation_agent_definitions", "max_steps")
|
||
|
|
op.drop_column("automation_agent_definitions", "max_tokens")
|
||
|
|
op.drop_column("automation_agent_definitions", "temperature")
|