mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-04 08:37:14 +00:00
feat(provider): add pipeline reasoning controls (#2373)
* feat(provider): add pipeline reasoning controls * fix(provider): preserve local agent model compatibility * refactor(web): use shadcn reasoning slider * fix(runtime): stabilize reasoning chat delivery * fix(provider): route reasoning controls by model family * fix(provider): handle hosted Kimi reasoning protocols * fix(provider): map qwen reasoning levels to budgets * fix(provider): preserve think tags in streamed reasoning * fix(provider): preserve reasoning tool metadata * style(provider): satisfy ruff checks after merge * fix(persistence): preserve reasoning migration compatibility
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
"""add llm reasoning config
|
||||
|
||||
Revision ID: 0018_llm_reasoning_config
|
||||
Revises: 0017_oss_workspace_identity
|
||||
Create Date: 2026-07-27
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision = '0018_llm_reasoning_config'
|
||||
down_revision = '0017_oss_workspace_identity'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
_LLM_MODELS = sa.table(
|
||||
'llm_models',
|
||||
sa.column('reasoning_config', sa.JSON()),
|
||||
)
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
conn = op.get_bind()
|
||||
inspector = sa.inspect(conn)
|
||||
if 'llm_models' not in inspector.get_table_names():
|
||||
return
|
||||
|
||||
columns = {column['name'] for column in inspector.get_columns('llm_models')}
|
||||
if 'reasoning_config' in columns:
|
||||
return
|
||||
|
||||
op.add_column(
|
||||
'llm_models',
|
||||
sa.Column(
|
||||
'reasoning_config',
|
||||
sa.JSON(),
|
||||
nullable=True,
|
||||
server_default=sa.text('\'{"level":"provider_default"}\''),
|
||||
),
|
||||
)
|
||||
conn.execute(_LLM_MODELS.update().values(reasoning_config={'level': 'provider_default'}))
|
||||
with op.batch_alter_table('llm_models') as batch_op:
|
||||
batch_op.alter_column('reasoning_config', existing_type=sa.JSON(), nullable=False)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
conn = op.get_bind()
|
||||
inspector = sa.inspect(conn)
|
||||
if 'llm_models' not in inspector.get_table_names():
|
||||
return
|
||||
columns = {column['name'] for column in inspector.get_columns('llm_models')}
|
||||
if 'reasoning_config' in columns:
|
||||
with op.batch_alter_table('llm_models') as batch_op:
|
||||
batch_op.drop_column('reasoning_config')
|
||||
@@ -0,0 +1,21 @@
|
||||
"""merge reasoning config with the main migration branch
|
||||
|
||||
Revision ID: 0021_merge_reasoning_config
|
||||
Revises: 0020_membership_source, 0018_llm_reasoning_config
|
||||
Create Date: 2026-08-09
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
revision = '0021_merge_reasoning_config'
|
||||
down_revision = ('0020_membership_source', '0018_llm_reasoning_config')
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
pass
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
pass
|
||||
Reference in New Issue
Block a user