feat: add interface params

This commit is contained in:
Swayam 2025-10-07 04:59:01 +05:30
parent 22de2f2045
commit b7c68277f6
4 changed files with 204 additions and 0 deletions

View file

@ -0,0 +1,40 @@
"""add litellm_params to searchspaces
Revision ID: fd3f2e543873
Revises: eb0c978da8fd
Create Date: 2025-10-07 04:11:50.392338
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision: str = 'fd3f2e543873'
down_revision: Union[str, None] = 'eb0c978da8fd'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('chucks_search_index'), table_name='chunks', postgresql_using='gin')
op.drop_index(op.f('chucks_vector_index'), table_name='chunks', postgresql_using='hnsw')
op.drop_index(op.f('document_search_index'), table_name='documents', postgresql_using='gin')
op.drop_index(op.f('document_vector_index'), table_name='documents', postgresql_using='hnsw')
op.drop_column('searchspaces', 'inference_params')
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('searchspaces', sa.Column('inference_params', postgresql.JSON(astext_type=sa.Text()), autoincrement=False, nullable=True))
op.create_index(op.f('document_vector_index'), 'documents', ['embedding'], unique=False, postgresql_using='hnsw')
op.create_index(op.f('document_search_index'), 'documents', [sa.literal_column("to_tsvector('english'::regconfig, content)")], unique=False, postgresql_using='gin')
op.create_index(op.f('chucks_vector_index'), 'chunks', ['embedding'], unique=False, postgresql_using='hnsw')
op.create_index(op.f('chucks_search_index'), 'chunks', [sa.literal_column("to_tsvector('english'::regconfig, content)")], unique=False, postgresql_using='gin')
# ### end Alembic commands ###