add observer thought token count and llm cost (#1595)

This commit is contained in:
Shuchang Zheng
2025-01-22 07:45:40 +08:00
committed by GitHub
parent 98a7d1ced5
commit 4578b6fe86
5 changed files with 93 additions and 18 deletions

View File

@@ -0,0 +1,35 @@
"""Add thought cost, input token count and output token count
Revision ID: 13e4af5c975c
Revises: 9adef4708ca8
Create Date: 2025-01-21 23:37:35.122761+00:00
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "13e4af5c975c"
down_revision: Union[str, None] = "9adef4708ca8"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("observer_thoughts", sa.Column("input_token_count", sa.Integer(), nullable=True))
op.add_column("observer_thoughts", sa.Column("output_token_count", sa.Integer(), nullable=True))
op.add_column("observer_thoughts", sa.Column("thought_cost", sa.Numeric(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("observer_thoughts", "thought_cost")
op.drop_column("observer_thoughts", "output_token_count")
op.drop_column("observer_thoughts", "input_token_count")
# ### end Alembic commands ###