Files
Memoh/db/migrations/0014_reasoning.up.sql
Acbox Liu 17cd077f34 feat: add thinking support (#100)
* feat: add thinking support

* feat: improve thinking block render in web and filter thinking content in channels

* fix: migrate
2026-02-23 14:41:27 +08:00

18 lines
630 B
SQL

-- 0014_reasoning
-- Add reasoning support flag to models and reasoning settings to bots.
ALTER TABLE models ADD COLUMN IF NOT EXISTS supports_reasoning BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE bots ADD COLUMN IF NOT EXISTS reasoning_enabled BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE bots ADD COLUMN IF NOT EXISTS reasoning_effort TEXT NOT NULL DEFAULT 'medium';
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_constraint WHERE conname = 'bots_reasoning_effort_check'
) THEN
ALTER TABLE bots ADD CONSTRAINT bots_reasoning_effort_check
CHECK (reasoning_effort IN ('low', 'medium', 'high'));
END IF;
END
$$;