diff --git a/frontend/src/components/pages/AssistantPage.tsx b/frontend/src/components/pages/AssistantPage.tsx index 45d8dab..6b0c88e 100644 --- a/frontend/src/components/pages/AssistantPage.tsx +++ b/frontend/src/components/pages/AssistantPage.tsx @@ -314,8 +314,6 @@ export function AssistantPage(props: AssistantPageProps) { // (工作流占位页也用它展示名称与类型) const [draftName, setDraftName] = useState(""); const [draftType, setDraftType] = useState(null); - const [draftAgentPlatform, setDraftAgentPlatform] = - useState(null); // 引导页:创建请求进行中 / 创建失败 const [creating, setCreating] = useState(false); const [createError, setCreateError] = useState(null); @@ -480,26 +478,19 @@ export function AssistantPage(props: AssistantPageProps) { } // 引导页确认:直接创建到数据库拿到 id,再进入该助手的编辑页 + // 智能体平台默认先建 dify,具体平台在编辑页再选 async function confirmType() { - if ( - !draftName.trim() || - !draftType || - (draftType === "智能体平台" && !draftAgentPlatform) || - creating - ) { + if (!draftName.trim() || !draftType || creating) { return; } setCreating(true); setCreateError(null); try { - let assistantType: ApiAssistantType; - if (draftType === "智能体平台") { - if (!draftAgentPlatform) return; - assistantType = draftAgentPlatform; - } else { - assistantType = typeFromBuildMethod[draftType]; - } + const assistantType: ApiAssistantType = + draftType === "智能体平台" + ? "dify" + : typeFromBuildMethod[draftType]; const created = await assistantsApi.create( baseUpsert({ name: draftName.trim(), @@ -1228,40 +1219,6 @@ export function AssistantPage(props: AssistantPageProps) { ); })} - - {draftType === "智能体平台" && ( -
-
- 选择智能体平台 -
-

- 平台类型用于匹配对应的应用资源和运行方式。 -

-
- {(["dify", "fastgpt"] as const).map((platform) => { - const selected = draftAgentPlatform === platform; - const label = platform === "dify" ? "Dify" : "FastGPT"; - - return ( - - ); - })} -
-
- )}
@@ -1280,12 +1237,7 @@ export function AssistantPage(props: AssistantPageProps) { - ); - })} -
- + + handleAgentPlatformChange(value as AgentPlatform) + } + options={[ + { value: "dify", label: "Dify" }, + { value: "fastgpt", label: "FastGPT" }, + ]} + />