UPDATE base_model_catalog
SET capabilities = jsonb_set(
      jsonb_set(capabilities, '{omni_video,input_audio}', 'false'::jsonb, true),
      '{omni_video,max_audios}', '0'::jsonb, true
    ),
    metadata = jsonb_set(
      jsonb_set(metadata, '{rawModel,capabilities,omni_video,input_audio}', 'false'::jsonb, true),
      '{rawModel,capabilities,omni_video,max_audios}', '0'::jsonb, true
    ),
    updated_at = now()
WHERE provider_key = 'keling'
  AND provider_model_name IN ('kling-video-o1', 'kling-v3-omni')
  AND capabilities ? 'omni_video';

UPDATE platform_models m
SET capabilities = jsonb_set(
      jsonb_set(m.capabilities, '{omni_video,input_audio}', 'false'::jsonb, true),
      '{omni_video,max_audios}', '0'::jsonb, true
    ),
    updated_at = now()
FROM integration_platforms p
WHERE m.platform_id = p.id
  AND p.provider = 'keling'
  AND COALESCE(NULLIF(m.provider_model_name, ''), m.model_name) IN ('kling-video-o1', 'kling-v3-omni')
  AND m.capabilities ? 'omni_video';
