Add model router and MCP integration adapters
This commit is contained in:
@@ -119,8 +119,48 @@ def upgrade() -> None:
|
||||
op.create_index("ix_task_events_task_id", "task_events", ["task_id"])
|
||||
op.create_index("ix_task_events_occurred_at", "task_events", ["occurred_at"])
|
||||
|
||||
op.create_table(
|
||||
"model_invocations",
|
||||
sa.Column("invocation_id", sa.String(length=64), primary_key=True),
|
||||
sa.Column("task_id", sa.String(length=64), nullable=False),
|
||||
sa.Column("node_id", sa.String(length=64), nullable=True),
|
||||
sa.Column("slot", sa.String(length=64), nullable=False),
|
||||
sa.Column("provider", sa.String(length=64), nullable=False),
|
||||
sa.Column("model", sa.String(length=255), nullable=False),
|
||||
sa.Column("status", sa.String(length=64), nullable=False),
|
||||
sa.Column("request_json", sa.JSON(), nullable=False),
|
||||
sa.Column("response_json", sa.JSON(), nullable=False),
|
||||
sa.Column("usage_json", sa.JSON(), nullable=False),
|
||||
sa.Column("fallback_from_invocation_id", sa.String(length=64), nullable=True),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
)
|
||||
op.create_index("ix_model_invocations_task_id", "model_invocations", ["task_id"])
|
||||
op.create_index("ix_model_invocations_created_at", "model_invocations", ["created_at"])
|
||||
|
||||
op.create_table(
|
||||
"tool_invocations",
|
||||
sa.Column("invocation_id", sa.String(length=64), primary_key=True),
|
||||
sa.Column("task_id", sa.String(length=64), nullable=False),
|
||||
sa.Column("node_id", sa.String(length=64), nullable=True),
|
||||
sa.Column("source_type", sa.String(length=64), nullable=False),
|
||||
sa.Column("source_id", sa.String(length=128), nullable=False),
|
||||
sa.Column("tool_name", sa.String(length=255), nullable=False),
|
||||
sa.Column("status", sa.String(length=64), nullable=False),
|
||||
sa.Column("request_json", sa.JSON(), nullable=False),
|
||||
sa.Column("response_json", sa.JSON(), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
|
||||
)
|
||||
op.create_index("ix_tool_invocations_task_id", "tool_invocations", ["task_id"])
|
||||
op.create_index("ix_tool_invocations_created_at", "tool_invocations", ["created_at"])
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_index("ix_tool_invocations_created_at", table_name="tool_invocations")
|
||||
op.drop_index("ix_tool_invocations_task_id", table_name="tool_invocations")
|
||||
op.drop_table("tool_invocations")
|
||||
op.drop_index("ix_model_invocations_created_at", table_name="model_invocations")
|
||||
op.drop_index("ix_model_invocations_task_id", table_name="model_invocations")
|
||||
op.drop_table("model_invocations")
|
||||
op.drop_index("ix_task_events_occurred_at", table_name="task_events")
|
||||
op.drop_index("ix_task_events_task_id", table_name="task_events")
|
||||
op.drop_table("task_events")
|
||||
|
||||
Reference in New Issue
Block a user