diff --git a/src/components/pages/AssistantPage.tsx b/src/components/pages/AssistantPage.tsx index 357cbfc..9ccaa7c 100644 --- a/src/components/pages/AssistantPage.tsx +++ b/src/components/pages/AssistantPage.tsx @@ -4,12 +4,10 @@ import { useState } from "react"; import { Bot, Brain, - Database, Mic, Rocket, Save, Sparkles, - Volume2, } from "lucide-react"; import { Button } from "@/components/ui/button"; @@ -33,28 +31,27 @@ import { type AssistantForm = { name: string; - scene: string; greeting: string; + prompt: string; model: string; asr: string; voice: string; knowledgeBase: string; enableInterrupt: boolean; - enablePublish: boolean; }; export function AssistantPage() { const [form, setForm] = useState({ name: "政务视频咨询助手", - scene: "政务服务", greeting: "您好,我是 AI 视频助手,请问有什么可以帮您?", + prompt: + "你是一名专业的政务视频咨询助手,负责为市民提供政策解读、办事指南和常见问题解答。\n\n请遵循以下原则:\n1. 回答准确、简洁,使用通俗易懂的语言\n2. 不确定的信息应明确告知,不编造政策内容\n3. 涉及具体办事流程时,引导用户前往官方渠道核实", model: "DeepSeek-V3", asr: "SenseVoice", voice: "晓宁", knowledgeBase: "政务政策知识库", enableInterrupt: true, - enablePublish: false, }); function updateForm( @@ -93,28 +90,18 @@ export function AssistantPage() { -
-
+
} title="基础信息" - description="定义助手名称、业务场景和开场白" + description="定义助手名称、开场白和提示词" > -
- updateForm("name", value)} - placeholder="请输入助手名称" - /> - - updateForm("scene", value)} - options={["政务服务", "客户服务", "教育咨询", "医疗导诊", "企业培训"]} - /> -
+ updateForm("name", value)} + placeholder="请输入助手名称" + /> updateForm("greeting", value)} placeholder="请输入助手开场白" /> + + updateForm("prompt", value)} + placeholder="请输入提示词,描述助手的角色、能力和回答要求" + rows={8} + />
updateForm("enableInterrupt", checked)} /> - - updateForm("enablePublish", checked)} - /> -
- -
); @@ -256,11 +241,13 @@ function TextAreaField({ label, value, placeholder, + rows = 4, onChange, }: { label: string; value: string; placeholder?: string; + rows?: number; onChange: (value: string) => void; }) { return ( @@ -270,7 +257,7 @@ function TextAreaField({ value={value} placeholder={placeholder} onChange={(event) => onChange(event.target.value)} - rows={4} + rows={rows} className="resize-none border-[#1b2233] bg-[#0d121d] text-white placeholder:text-[#5d6880]" /> @@ -333,81 +320,4 @@ function ToggleRow({ ); -} - -function PreviewPanel({ form }: { form: AssistantForm }) { - return ( - - ); -} - -function PreviewItem({ - icon, - label, - value, -}: { - icon: React.ReactNode; - label: string; - value: string; -}) { - return ( -
-
- {icon} - {label} -
-
{value}
-
- ); } \ No newline at end of file