feat(models): add image model type support

Add a dedicated image model type so bots can use image API models without overloading chat model capabilities, while keeping existing chat-based image generation selectable.
This commit is contained in:
Acbox
2026-04-16 16:00:22 +08:00
parent 33e18e7e64
commit ddda00f980
23 changed files with 326 additions and 68 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ CREATE TABLE IF NOT EXISTS models (
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
CONSTRAINT models_provider_id_model_id_unique UNIQUE (provider_id, model_id),
CONSTRAINT models_type_check CHECK (type IN ('chat', 'embedding', 'speech'))
CONSTRAINT models_type_check CHECK (type IN ('chat', 'embedding', 'image', 'speech'))
);
CREATE TABLE IF NOT EXISTS model_variants (
@@ -0,0 +1,7 @@
-- 0067_add_image_model_type (rollback)
-- Remove image from the supported model types.
ALTER TABLE models DROP CONSTRAINT IF EXISTS models_type_check;
ALTER TABLE models
ADD CONSTRAINT models_type_check
CHECK (type IN ('chat', 'embedding', 'speech'));
@@ -0,0 +1,7 @@
-- 0067_add_image_model_type
-- Add image as a supported model type.
ALTER TABLE models DROP CONSTRAINT IF EXISTS models_type_check;
ALTER TABLE models
ADD CONSTRAINT models_type_check
CHECK (type IN ('chat', 'embedding', 'image', 'speech'));