From b40f4829cb20d4091f9735debf4c23f6e9363a06 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Tue, 31 Mar 2026 15:48:19 +0800 Subject: [PATCH] feat(web): custom model add thinking capability --- .../components/CustomModelModal.tsx | 53 ++++++++++++------- web/src/views/ModelManagement/types.ts | 7 +-- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/web/src/views/ModelManagement/components/CustomModelModal.tsx b/web/src/views/ModelManagement/components/CustomModelModal.tsx index abede886..01cc0fd6 100644 --- a/web/src/views/ModelManagement/components/CustomModelModal.tsx +++ b/web/src/views/ModelManagement/components/CustomModelModal.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 16:49:28 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-25 14:07:10 + * @Last Modified time: 2026-03-31 13:56:18 */ /** * Custom Model Modal @@ -11,7 +11,7 @@ */ import { forwardRef, useEffect, useImperativeHandle, useState } from 'react'; -import { Form, Input, App, Checkbox, Button } from 'antd'; +import { Form, Input, App, Checkbox, Button, Row, Col } from 'antd'; import { useTranslation } from 'react-i18next'; import type { CustomModelForm, ModelListItem, CustomModelModalRef, CustomModelModalProps } from '../types'; @@ -72,6 +72,7 @@ const CustomModelModal = forwardRef( is_vision: capability?.includes('vision') || false, is_video: capability?.includes('video') || false, is_audio: capability?.includes('audio') || false, + is_thinking: capability?.includes('thinking') || false, }); } else { setIsEdit(false); @@ -101,7 +102,7 @@ const CustomModelModal = forwardRef( form .validateFields() .then((values) => { - const { logo, type, is_vision, is_video, is_audio, is_omni, ...rest } = values; + const { logo, type, is_vision, is_video, is_audio, is_omni, is_thinking, ...rest } = values; const formData: CustomModelForm = { ...rest, type, @@ -120,6 +121,9 @@ const CustomModelModal = forwardRef( capability.push('video') } } + if (is_thinking) { + capability.push('thinking') + } formData.capability = capability formData.is_omni = is_omni @@ -238,21 +242,34 @@ const CustomModelModal = forwardRef( - {!['embedding', 'rerank'].includes(modelType as string) && - <> - - {t('modelNew.is_omni')} - - - {t('modelNew.is_vision')} - - - {t('modelNew.is_video')} - - - {t('modelNew.is_audio')} - - + {['llm', 'chat'].includes(modelType as string) && + + + + {t('modelNew.is_omni')} + + + + + {t('modelNew.is_vision')} + + + + + {t('modelNew.is_video')} + + + + + {t('modelNew.is_audio')} + + + + + {t('modelNew.is_thinking')} + + + } diff --git a/web/src/views/ModelManagement/types.ts b/web/src/views/ModelManagement/types.ts index 1662775f..cafac4b3 100644 --- a/web/src/views/ModelManagement/types.ts +++ b/web/src/views/ModelManagement/types.ts @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 16:50:18 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-25 12:28:10 + * @Last Modified time: 2026-03-31 15:48:02 */ /** * Type definitions for Model Management @@ -295,7 +295,8 @@ export interface CustomModelForm { is_video?: boolean; is_audio?: boolean; is_omni?: boolean; - capability?: string[]; + is_thinking?: boolean; + capability?: Capability[]; } /** @@ -324,7 +325,7 @@ export interface BaseRef { modelListDetailRefresh?: () => void; } -export type Capability = 'vision' | 'audio' | 'video'; +export type Capability = 'vision' | 'audio' | 'video' | 'thinking'; export interface Model { name: string; type: string;