-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #574 from openchatai/feat/analytics_2
Adding columns to track if api call / knowledgebase was called
- Loading branch information
Showing
8 changed files
with
114 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
llm-server/models/migrations/versions/b9828e70d171_add_api_call_made_and_knowledgebase_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Add api_call_made and knowledgebase_called columns | ||
Revision ID: b9828e70d171 | ||
Revises: 62ef7ae67c7d | ||
Create Date: 2024-01-22 20:57:25.839823 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy import Column, Boolean | ||
from sqlalchemy.dialects import mysql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "b9828e70d171" | ||
down_revision: Union[str, None] = "62ef7ae67c7d" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
# Add two new boolean columns | ||
def upgrade(): | ||
op.add_column("chat_history", Column("api_called", Boolean, default=False)) | ||
op.add_column( | ||
"chat_history", Column("knowledgebase_called", Boolean, default=False) | ||
) | ||
|
||
|
||
# Remove the two boolean columns | ||
def downgrade(): | ||
op.drop_column("chat_history", "api_called") | ||
op.drop_column("chat_history", "knowledgebase_called") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters