From 1c402be21d1cf76a3000487f2596c299f3c9d1c8 Mon Sep 17 00:00:00 2001 From: buua436 Date: Fri, 14 Aug 2026 19:12:45 +0800 Subject: [PATCH] fix: hide wiki mode on python backend (#18289) --- .../agent/form/compilation-form/index.tsx | 45 ++++++++++++------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/web/src/pages/agent/form/compilation-form/index.tsx b/web/src/pages/agent/form/compilation-form/index.tsx index f947c58594..fd44bcbdbe 100644 --- a/web/src/pages/agent/form/compilation-form/index.tsx +++ b/web/src/pages/agent/form/compilation-form/index.tsx @@ -3,8 +3,12 @@ import { LargeModelFormField } from '@/components/large-model-form-field'; import { SelectWithSearch } from '@/components/originui/select-with-search'; import { RAGFlowFormItem } from '@/components/ragflow-form'; import { Form } from '@/components/ui/form'; +import { + getBackendLanguage, + subscribeBackendLanguage, +} from '@/utils/backend-runtime'; import { zodResolver } from '@hookform/resolvers/zod'; -import { memo } from 'react'; +import { memo, useSyncExternalStore } from 'react'; import { useForm } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { z } from 'zod'; @@ -46,6 +50,11 @@ const CompilationForm = ({ const ownerTenantId = useOwnerTenantId(); const { t } = useTranslation(); const FormSchema = useFormSchema(); + const backendLanguage = useSyncExternalStore( + subscribeBackendLanguage, + getBackendLanguage, + getBackendLanguage, + ); const form = useForm({ defaultValues, @@ -64,22 +73,24 @@ const CompilationForm = ({ name="llm_id" ownerTenantId={ownerTenantId} > - - {(field) => ( - - )} - + {backendLanguage === 'go' && ( + + {(field) => ( + + )} + + )} {!hideOutputs && (