feat: persist real LLM cost to DB + block-level attribution (public API unchanged — placeholder preserved) (#5656)

This commit is contained in:
pedrohsdb 2026-04-24 17:02:12 -07:00 committed by GitHub
parent 6c2b4728ee
commit 3fce82760f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 383 additions and 28 deletions

View file

@ -0,0 +1,30 @@
"""add llm_cost to workflow_run_blocks
Revision ID: c19d7d385560
Revises: c9005bafa5ec
Create Date: 2026-04-24T23:53:46.912017+00:00
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "c19d7d385560"
down_revision: Union[str, None] = "c9005bafa5ec"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
op.add_column(
"workflow_run_blocks",
sa.Column("llm_cost", sa.Numeric(), nullable=False, server_default="0"),
)
def downgrade() -> None:
op.drop_column("workflow_run_blocks", "llm_cost")