fix: exclude TTS models from agent component model selector (#17231)

This commit is contained in:
euvre
2026-07-22 19:27:12 +08:00
committed by GitHub
parent cfaef879fe
commit 5bc28d4d15
3 changed files with 5 additions and 16 deletions

View File

@@ -39,12 +39,8 @@ export const LargeModelFilterFormSchema = {
llm_filter: z.string().optional(),
};
type LargeModelFormFieldProps = Pick<
NextInnerLLMSelectProps,
'showSpeech2TextModel' | 'ownerTenantId'
>;
type LargeModelFormFieldProps = Pick<NextInnerLLMSelectProps, 'ownerTenantId'>;
export function LargeModelFormField({
showSpeech2TextModel: showTTSModel,
ownerTenantId,
}: LargeModelFormFieldProps) {
const form = useFormContext();
@@ -96,7 +92,6 @@ export function LargeModelFormField({
<NextLLMSelect
{...field}
filter={filter}
showSpeech2TextModel={showTTSModel}
ownerTenantId={ownerTenantId}
/>
</FormControl>

View File

@@ -14,7 +14,6 @@ export interface NextInnerLLMSelectProps {
onChange?: (value: string) => void;
disabled?: boolean;
filter?: string;
showSpeech2TextModel?: boolean;
triggerTestId?: string;
optionTestIdPrefix?: string;
ownerTenantId?: string;
@@ -29,7 +28,6 @@ const NextInnerLLMSelect = forwardRef<
value,
disabled,
filter,
showSpeech2TextModel = false,
triggerTestId,
optionTestIdPrefix,
ownerTenantId,
@@ -39,19 +37,15 @@ const NextInnerLLMSelect = forwardRef<
const { t } = useTranslation();
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
const ttsModel = useMemo(() => {
return showSpeech2TextModel ? ['tts'] : [];
}, [showSpeech2TextModel]);
const modelTypes = useMemo(() => {
if (filter === LlmModelType.Chat) {
return ['chat'];
} else if (filter === LlmModelType.Image2text) {
return ['vision', ...ttsModel];
return ['vision'];
} else {
return ['chat', 'vision', ...ttsModel];
return ['chat', 'vision'];
}
}, [filter, ttsModel]);
}, [filter]);
return (
<Select disabled={disabled} value={value}>

View File

@@ -157,7 +157,7 @@ function AgentForm({ node }: INextOperatorForm) {
<Form {...form}>
<FormWrapper>
{isSubAgent && <DescriptionField></DescriptionField>}
<LargeModelFormField showSpeech2TextModel></LargeModelFormField>
<LargeModelFormField></LargeModelFormField>
{findLlmByUuid(llmId)?.model_type?.includes('vision') && (
<QueryVariable
name="visual_files_var"