diff --git a/.DS_Store b/.DS_Store index 27b5101..b9ff8c5 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/build/index.html b/build/index.html index 27317b5..b9dfffe 100644 --- a/build/index.html +++ b/build/index.html @@ -8,12 +8,12 @@ NPCs - + - - + + - + diff --git a/build/locales/zh/bs.json b/build/locales/zh/bs.json index 0c44f9a..4264066 100644 --- a/build/locales/zh/bs.json +++ b/build/locales/zh/bs.json @@ -14,8 +14,8 @@ "pleaseEnterAccount": "请填写账号", "pleaseEnterPassword": "请填写密码", "accountTooShort": "账号过短", - "passwordTooShort": "请填写密码,至少8位", - "passwordError": "密码必须包含大小写字母、数字和字符!", + "passwordTooShort": "请填写密码,至少6位", + "passwordError": "密码必须包含字母、数字!", "passwordMismatch": "两次密码不一致", "registrationSuccess": "注册成功,请输入密码进行登录" }, diff --git a/public/locales/zh/bs.json b/public/locales/zh/bs.json index 0c44f9a..411d426 100644 --- a/public/locales/zh/bs.json +++ b/public/locales/zh/bs.json @@ -14,8 +14,8 @@ "pleaseEnterAccount": "请填写账号", "pleaseEnterPassword": "请填写密码", "accountTooShort": "账号过短", - "passwordTooShort": "请填写密码,至少8位", - "passwordError": "密码必须包含大小写字母、数字和字符!", + "passwordTooShort": "请填写密码,至少6位", + "passwordError": "密码必须包含字母、数字!", "passwordMismatch": "两次密码不一致", "registrationSuccess": "注册成功,请输入密码进行登录" }, @@ -55,40 +55,40 @@ "language": "语言" }, "skills": { - "manageTemplate": "管理技能模板", - "createNew": "新建技能", - "customSkills": "自定义技能", + "manageTemplate": "管理能力模板", + "createNew": "新建能力", + "customSkills": "自定义能力", "chooseOnline": "选择上线版本", - "executionSteps": "技能通过可视化的流程编排,明确任务执行步骤", + "executionSteps": "能力通过可视化的流程编排,明确任务执行步骤", "sceneTemplates": "我们提供场景模板供您使用和参考", - "manageProjects": "在此页面管理您的技能,对技能上下线、编辑等等", - "skillSearch": "搜索您需要的技能", - "confirmDeleteSkill": "确认删除该技能?", - "backToSkillList": "返回技能列表", - "skillTemplateManagement": "技能模板管理,模板对所有用户可见,支持拖拽排序、删除操作", + "manageProjects": "在此页面管理您的能力,对能力上下线、编辑等等", + "skillSearch": "搜索您需要的能力", + "confirmDeleteSkill": "确认删除该能力?", + "backToSkillList": "返回能力列表", + "skillTemplateManagement": "能力模板管理,模板对所有用户可见,支持拖拽排序、删除操作", "templateName": "模板名称", "templateDescription": "模板描述", - "confirmText": "是否确认删除该技能模板?", - "skillSettings": "技能设置", + "confirmText": "是否确认删除该能力模板?", + "skillSettings": "能力设置", "basicInfo": "基础信息", - "skillName": "技能名称", + "skillName": "能力名称", "description": "描述", "parameterInfo": "参数信息", "advancedConfiguration": "高级配置", "nextStep": "下一步,高级配置", - "skillNameRequired": "请填写技能名称", - "skillNameTooLong": "技能名称过长,不要超过30字", + "skillNameRequired": "请填写能力名称", + "skillNameTooLong": "能力名称过长,不要超过30字", "skillNameExists": "该名称已存在", - "skillDescRequired": "请填写技能描述", - "skillDescTooLong": "技能描述过长,不要超过200字", + "skillDescRequired": "请填写能力描述", + "skillDescTooLong": "能力描述过长,不要超过200字", "errorTitle": "关键信息有误", "onlineFailure": "上线失败", "onlineSuccessful": "上线成功", "custom": "自定义", - "skillTemplate": "技能模板", + "skillTemplate": "能力模板", "skillTemplateChoose": "您可以从这里挑选一个模板开始,或者自定义高级模板", "createTemplate": "创建模板", - "createSuccessTitle": "技能创建成功", + "createSuccessTitle": "能力创建成功", "createFailureTitle": "创建失败", "createdBy": "创建用户", "offline": "下线", @@ -442,7 +442,7 @@ "build": { "create": "创建", "assistant": "NPC", - "skill": "技能", + "skill": "能力", "tools": "工具", "save": "保存", "online": "上线", @@ -455,7 +455,7 @@ "portraitOptimization": "NPC画像优化", "automaticOptimization": "自动优化", "createDescription": "通过描述角色和任务来创建你的NPC", - "nextDescription": "NPC可以调用多个技能和工具", + "nextDescription": "NPC可以调用多个能力和工具", "searchAssistant": "搜索您需要的NPC", "manageAssistant": "在此页面管理您的NPC,对NPC上下线、编辑等等", "establishAssistant": "创建NPC", @@ -473,7 +473,7 @@ "guideReplaced": "引导词已替换", "openingReplaced": "开场白已替换", "toolsReplaced": "工具已替换", - "skillsReplaced": "技能已替换", + "skillsReplaced": "能力已替换", "allReplaced": "已全部替换", "basicConfiguration": "基础配置", "modelConfiguration": "AI模型配置", @@ -503,13 +503,13 @@ "addTool": "添加工具", "search": "搜索", "empty": "空空如也", - "onlineSA": "上线技能&NPC", + "onlineSA": "上线能力&NPC", "params": "参数", "added": "已添加", "add": "添加", "configurationUpdated": "配置已更新", - "addSkill": "添加技能", - "createSkill": "创建技能", + "addSkill": "添加能力", + "createSkill": "创建能力", "nameRequired": "名称不可为空", "nameMaxLength": "名称最多50个字符", "descMaxLength": "最多1000个字符", diff --git a/src/.DS_Store b/src/.DS_Store index 4eacb2c..907cc45 100644 Binary files a/src/.DS_Store and b/src/.DS_Store differ diff --git a/src/assets/.DS_Store b/src/assets/.DS_Store index 792e682..befa8a8 100644 Binary files a/src/assets/.DS_Store and b/src/assets/.DS_Store differ diff --git a/src/assets/toolbar/.DS_Store b/src/assets/toolbar/.DS_Store new file mode 100644 index 0000000..cec33f8 Binary files /dev/null and b/src/assets/toolbar/.DS_Store differ diff --git a/src/components/bs-comp/chatComponent/ChatInput.tsx b/src/components/bs-comp/chatComponent/ChatInput.tsx index 35405d9..0bc902a 100644 --- a/src/components/bs-comp/chatComponent/ChatInput.tsx +++ b/src/components/bs-comp/chatComponent/ChatInput.tsx @@ -9,6 +9,8 @@ import { useMessageStore } from "./messageStore"; import GuideQuestions from "./GuideQuestions"; import { ClearIcon } from "@/components/bs-icons/clear"; import duihua_send from "../../../assets/chat/duihua-send.png"; +import { Button } from "@/components/bs-ui/button"; +import { StopCircle } from "lucide-react"; export default function ChatInput({ clear, form, questions, inputForm, wsUrl, onBeforSend }) { const { toast } = useToast() @@ -22,7 +24,8 @@ export default function ChatInput({ clear, form, questions, inputForm, wsUrl, on const { messages, chatId, createSendMsg, createWsMsg, updateCurrentMessage, destory, setShowGuideQuestion } = useMessageStore() const currentChatIdRef = useRef(null) const inputRef = useRef(null) - + // 停止状态 + const [isStop, setIsStop] = useState(true) /** * 记录会话切换状态,等待消息加载完成时,控制表单在新会话自动展开 */ @@ -88,6 +91,7 @@ export default function ChatInput({ clear, form, questions, inputForm, wsUrl, on // 锁定 input setInputLock({ locked: true, reason: '' }) await createWebSocket(chatId) + console.log(wsMsg,inputKey); sendWsMsg(wsMsg) // 滚动聊天到底 @@ -96,7 +100,13 @@ export default function ChatInput({ clear, form, questions, inputForm, wsUrl, on messageDom.scrollTop = messageDom.scrollHeight; } } - + const stop = async () => { + const [wsMsg] = onBeforSend('', '') + wsMsg.action = "stop" + sendWsMsg(wsMsg) + // console.log(wsMsg); + // sendWsMsg(wsMsg) + } const sendWsMsg = async (msg) => { try { wsRef.current.send(JSON.stringify(msg)) @@ -158,6 +168,7 @@ export default function ChatInput({ clear, form, questions, inputForm, wsUrl, on ws.onerror = (ev) => { wsRef.current = null console.error('链接异常error', ev); + setIsStop(true) toast({ title: `${t('chat.networkError')}:`, variant: 'error', @@ -178,8 +189,11 @@ export default function ChatInput({ clear, form, questions, inputForm, wsUrl, on // 接受 ws 消息 const handleWsMessage = (data) => { + console.log(data) if (Array.isArray(data) && data.length) return - if (data.type === 'start') { + if (data.type === "begin") { + setIsStop(false) + }else if (data.type === 'start') { createWsMsg(data) } else if (data.type === 'stream') { updateCurrentMessage({ @@ -197,6 +211,7 @@ export default function ChatInput({ clear, form, questions, inputForm, wsUrl, on liked: 0 }, data.type === 'end_cover') } else if (data.type === "close") { + setIsStop(true) setInputLock({ locked: false, reason: '' }) } @@ -296,6 +311,9 @@ export default function ChatInput({ clear, form, questions, inputForm, wsUrl, on } }} > +
+ +
{/*

内容由AI生成,仅供参考

*/}

{appConfig.dialogTips}

diff --git a/src/components/bs-comp/chatComponent/FileBs.tsx b/src/components/bs-comp/chatComponent/FileBs.tsx index 41582aa..faa0e80 100644 --- a/src/components/bs-comp/chatComponent/FileBs.tsx +++ b/src/components/bs-comp/chatComponent/FileBs.tsx @@ -3,6 +3,9 @@ import { WordIcon } from "@/components/bs-icons/office"; import { checkSassUrl } from "@/pages/ChatAppPage/components/FileView"; import { downloadFile } from "@/util/utils"; import { useTranslation } from "react-i18next"; +import npcIcon from "../../../assets/npc/npcIcon.png"; +import nengliIcon from "../../../assets/npc/nengliIcon.png"; +import { TitleIconBg } from "../cardComponent"; // 颜色列表 const colorList = [ @@ -19,7 +22,7 @@ const colorList = [ "#95A5A6" ] -export default function FileBs({ data }) { +export default function FileBs({ data,flow_type }) { const { t } = useTranslation() const avatarColor = colorList[(data.sender?.split('').reduce((num, s) => num + s.charCodeAt(), 0) || 0) % colorList.length] @@ -33,15 +36,16 @@ export default function FileBs({ data }) {
{data.sender &&

{data.sender}

}
-
+ {data.flow_id && } + {/*
*/}
handleDownloadFile(data.files[0])} > -
+
-

{data.files[0]?.file_name}

-

点击下载

+

{data.files[0]?.file_name}

+

点击下载

diff --git a/src/components/bs-comp/chatComponent/MessageBs.tsx b/src/components/bs-comp/chatComponent/MessageBs.tsx index 445a0b1..4183208 100644 --- a/src/components/bs-comp/chatComponent/MessageBs.tsx +++ b/src/components/bs-comp/chatComponent/MessageBs.tsx @@ -38,7 +38,7 @@ const colorList = [ "#95A5A6" ] -export default function MessageBs({ data, onUnlike = () => { }, onSource }: { data: ChatMessageType, onUnlike?: any, onSource?: any }) { +export default function MessageBs({ data, onUnlike = () => { }, flow_type, onSource }: { data: ChatMessageType, flow_type: string, onUnlike?: any, onSource?: any }) { const avatarColor = colorList[ (data.sender?.split('').reduce((num, s) => num + s.charCodeAt(), 0) || 0) % colorList.length ] @@ -87,7 +87,6 @@ export default function MessageBs({ data, onUnlike = () => { }, onSource }: { da } const chatId = useMessageStore(state => state.chatId) - console.log(data) return
{data.sender &&

{data.sender}

} @@ -95,15 +94,15 @@ export default function MessageBs({ data, onUnlike = () => { }, onSource }: { da {/* {(data.flow_id == "06b1d374-ba97-46e6-8782-c56dec8dcc17" || data.flow_id == "ed8e21f6-9757-43d0-b076-8c6e81bb0580") && } {data.flow_id == "ca214b41-2b73-4585-b172-bf1e546cf6ec" && } {(data.flow_id != "06b1d374-ba97-46e6-8782-c56dec8dcc17" && data.flow_id != "ed8e21f6-9757-43d0-b076-8c6e81bb0580" && data.flow_id != "ca214b41-2b73-4585-b172-bf1e546cf6ec") && } */} - {data.flow_id && } + {data.flow_id && } -
+
{data.message.toString() ? mkdown : } {/* @user */} {data.receiver &&

@ {data.receiver.user_name}

} {/* 光标 */} - {data.message.toString() && !data.end &&
} + {/* {data.message.toString() && !data.end &&
} */}
{/* 赞 踩 */} diff --git a/src/components/bs-comp/chatComponent/MessagePanne.tsx b/src/components/bs-comp/chatComponent/MessagePanne.tsx index 3939f5d..97e504b 100644 --- a/src/components/bs-comp/chatComponent/MessagePanne.tsx +++ b/src/components/bs-comp/chatComponent/MessagePanne.tsx @@ -10,7 +10,7 @@ import RunLog from "./RunLog"; import Separator from "./Separator"; import { useMessageStore } from "./messageStore"; -export default function MessagePanne({ useName, guideWord, loadMore }) { +export default function MessagePanne({ useName, guideWord, loadMore, flow_type }) { const { t } = useTranslation() const { chatId, messages } = useMessageStore() @@ -83,6 +83,7 @@ export default function MessagePanne({ useName, guideWord, loadMore }) { return { thumbRef.current?.openModal(chatId) }} onSource={(data) => { sourceRef.current?.openModal(data) }} />; @@ -91,7 +92,7 @@ export default function MessagePanne({ useName, guideWord, loadMore }) { case 'separator': return ; case 'file': - return ; + return ; case 'runLog': return ; default: diff --git a/src/components/bs-comp/chatComponent/MessageUser.tsx b/src/components/bs-comp/chatComponent/MessageUser.tsx index 9524847..99cb0e8 100644 --- a/src/components/bs-comp/chatComponent/MessageUser.tsx +++ b/src/components/bs-comp/chatComponent/MessageUser.tsx @@ -34,13 +34,12 @@ export default function MessageUser({ useName, data }: { data: ChatMessageType } {/* {chat.category === 'loading' && } */} {msg}
- -
+ {!Array.isArray(data.message.data) &&
{!running && handleResend(false)} className="w-[28px] cursor-pointer" alt=""/>} {!running && handleResend(true)} className="w-[28px] cursor-pointer" alt=""/>} {/* */} {/* {!showSearch && onSearch(chat.message[chat.chatKey])}>} */} -
+
}
{/*

{userName}

*/} diff --git a/src/components/bs-comp/chatComponent/index.tsx b/src/components/bs-comp/chatComponent/index.tsx index bb1013b..92b024b 100644 --- a/src/components/bs-comp/chatComponent/index.tsx +++ b/src/components/bs-comp/chatComponent/index.tsx @@ -1,10 +1,9 @@ import ChatInput from "./ChatInput"; import MessagePanne from "./MessagePanne"; -export default function ChatComponent({ clear = false, questions = [], form = false, useName, inputForm = null, guideWord, wsUrl, onBeforSend, loadMore = () => { } }) { - +export default function ChatComponent({ clear = false, questions = [], form = false, useName, inputForm = null, guideWord, wsUrl, onBeforSend, type, loadMore = () => { } }) { return
- +
}; diff --git a/src/components/bs-comp/chatComponent/messageStore.ts b/src/components/bs-comp/chatComponent/messageStore.ts index 0399039..6432696 100644 --- a/src/components/bs-comp/chatComponent/messageStore.ts +++ b/src/components/bs-comp/chatComponent/messageStore.ts @@ -82,7 +82,6 @@ export const useMessageStore = create((set, get) => ({ set({ showGuideQuestion: bln }) }, async loadHistoryMsg(flowid, chatId, flow_type) { - console.log(111) const res = await getChatHistory(flowid, chatId, 30, 0, flow_type) const msgs = handleHistoryMsg(res) currentChatId = chatId @@ -155,6 +154,7 @@ export const useMessageStore = create((set, get) => ({ console.log('change updateCurrentMessage'); const messages = get().messages const isRunLog = runLogsTypes.includes(wsdata.category); + console.log(wsdata,isRunLog,messages) // run log类型存在嵌套情况,使用 extra 匹配 currentMessage; 否则取最近 const currentMessageIndex = isRunLog ? messages.findLastIndex((msg) => msg.extra === wsdata.extra) @@ -173,11 +173,13 @@ export const useMessageStore = create((set, get) => ({ } messages[currentMessageIndex] = newCurrentMessage + console.log(newCurrentMessage) // 会话特殊处理,兼容后端的缺陷 if (!isRunLog) { // start - end 之间没有内容删除load if (newCurrentMessage.end && !(newCurrentMessage.files.length || newCurrentMessage.thought || newCurrentMessage.message)) { - messages.pop() + // messages.pop() + console.log("删了") } // 无 messageid 删除 // if (newCurrentMessage.end && !newCurrentMessage.id) { diff --git a/src/components/bs-comp/sheets/SkillChatSheet.tsx b/src/components/bs-comp/sheets/SkillChatSheet.tsx index 36f5096..8af1ac7 100644 --- a/src/components/bs-comp/sheets/SkillChatSheet.tsx +++ b/src/components/bs-comp/sheets/SkillChatSheet.tsx @@ -62,10 +62,7 @@ export default function SkillChatSheet({ children, onSelect }) {
- {/* */} - {(item.id == "06b1d374-ba97-46e6-8782-c56dec8dcc17" || item.id == "ed8e21f6-9757-43d0-b076-8c6e81bb0580") && } - {item.id == "ca214b41-2b73-4585-b172-bf1e546cf6ec" && } - {(item.id != "06b1d374-ba97-46e6-8782-c56dec8dcc17" && item.id != "ed8e21f6-9757-43d0-b076-8c6e81bb0580" && item.id != "ca214b41-2b73-4585-b172-bf1e546cf6ec") && } +
@@ -100,12 +97,12 @@ export default function SkillChatSheet({ children, onSelect }) {
{/* */}
-
+
选择对话 选择一个您想使用的上线NPC或能力 setKeyword(e.target.value)} />
-
+
{/* { options.length ? options.map((flow, i) => ( {/* */}
-
+
{t("build.addSkill")} */}
{t("build.createSkill")}
-
+
{onlineFlows[0] ? ( // onlineFlows.map((flow, i) => ( // {/* */}
-
+
{t('build.addTool')}
@@ -83,7 +83,7 @@ export default function ToolsSheet({ select, onSelect, children }) {
-
+
{ options.length ? options.map(el => ( diff --git a/src/components/bs-icons/office/index.tsx b/src/components/bs-icons/office/index.tsx index 10e6163..60a88a8 100644 --- a/src/components/bs-icons/office/index.tsx +++ b/src/components/bs-icons/office/index.tsx @@ -5,6 +5,6 @@ export const WordIcon = forwardRef< SVGSVGElement & { className: any }, React.PropsWithChildren<{ className?: string }> >(({ className, ...props }, ref) => { - const _className = 'transition text-gray-950 ' + (className || '') + const _className = 'transition text-[#43AFD2] ' + (className || '') return ; }); diff --git a/src/components/bs-ui/dialog/index.tsx b/src/components/bs-ui/dialog/index.tsx index 5b84905..fd87d5a 100644 --- a/src/components/bs-ui/dialog/index.tsx +++ b/src/components/bs-ui/dialog/index.tsx @@ -36,7 +36,7 @@ const DialogContent = React.forwardRef< (({ className, ...props }, ref) => ( )) diff --git a/src/components/bs-ui/select/index.tsx b/src/components/bs-ui/select/index.tsx index c65dde2..8a266c5 100644 --- a/src/components/bs-ui/select/index.tsx +++ b/src/components/bs-ui/select/index.tsx @@ -79,7 +79,7 @@ const SelectContent = React.forwardRef< [role=checkbox]]:translate-y-[2px] bg-[#1a1a1a] first:rounded-l-md last:rounded-r-md group-odd:bg-[#1a1a1a] group-hover:bg-[#1a1a1a]", + "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] bg-[#2B2B2B] first:rounded-l-md last:rounded-r-md group-odd:bg-[#1a1a1a]", + // group-hover:bg-[#1a1a1a] className )} {...props} diff --git a/src/components/bs-ui/tooltip/index.tsx b/src/components/bs-ui/tooltip/index.tsx index c15c0f1..ce95a67 100644 --- a/src/components/bs-ui/tooltip/index.tsx +++ b/src/components/bs-ui/tooltip/index.tsx @@ -18,7 +18,7 @@ const TooltipContent = React.forwardRef< ref={ref} sideOffset={sideOffset} className={cname( - "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", + "z-50 overflow-hidden rounded-md bg-[#1a1a1a] px-3 py-1.5 text-xs text-[#ccc] animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className )} {...props} diff --git a/src/controllers/API/index.ts b/src/controllers/API/index.ts index 950ec95..e33f2d0 100644 --- a/src/controllers/API/index.ts +++ b/src/controllers/API/index.ts @@ -327,10 +327,9 @@ export interface MessageDB { type: string; update_time: string; user_id: number; - flow_type: string; } -export async function getChatHistory(flowId: string, chatId: string, pageSize: number, id?: number, flow_type: string): Promise { +export async function getChatHistory(flowId: string, chatId: string, pageSize: number, id: number, flow_type: string): Promise { return await axios.get(`/api/v1/chat/history?flow_id=${flowId}&chat_id=${chatId}&page_size=${pageSize}&id=${id || ''}&flow_type=${flow_type}`); } diff --git a/src/pages/.DS_Store b/src/pages/.DS_Store index aafa290..b0e260b 100644 Binary files a/src/pages/.DS_Store and b/src/pages/.DS_Store differ diff --git a/src/pages/ChatAppPage/components/ChatPanne.tsx b/src/pages/ChatAppPage/components/ChatPanne.tsx index 267a4d1..4d9c598 100644 --- a/src/pages/ChatAppPage/components/ChatPanne.tsx +++ b/src/pages/ChatAppPage/components/ChatPanne.tsx @@ -58,7 +58,6 @@ export default function ChatPanne({ customWsHost = '', data }) { useEffect(() => { return destroy }, []) - console.log(type) const init = async () => { if (type === 'flow') { setAssistant(null) @@ -93,6 +92,7 @@ export default function ChatPanne({ customWsHost = '', data }) { const getWsParamData = (action, msg) => { if (type === 'flow') { const _flow = flowRef.current + console.log(_flow) let inputs = tabsState[_flow.id].formKeysData.input_keys; const input = inputs.find((el: any) => !el.type) const inputKey = input ? Object.keys(input)[0] : ''; @@ -386,7 +386,8 @@ export default function ChatPanne({ customWsHost = '', data }) { guideWord={flow.guide_word} wsUrl={wsUrl} onBeforSend={getWsParamData} - loadMore={() => loadMoreHistoryMsg(flow.id)} + loadMore={() => loadMoreHistoryMsg(flow.id,"flow")} + type={type} inputForm={flowSate.isForm ? : null} /> {/*
@@ -424,7 +425,8 @@ export default function ChatPanne({ customWsHost = '', data }) { guideWord={assistantState.guide_word} wsUrl={wsUrl} onBeforSend={getWsParamData} - loadMore={() => loadMoreHistoryMsg(assistant.id)} + loadMore={() => loadMoreHistoryMsg(assistant.id,"assistant")} + type={type} inputForm={null} />
diff --git a/src/pages/ChatAppPage/components/ChatReportForm.tsx b/src/pages/ChatAppPage/components/ChatReportForm.tsx index 0961be4..7649ace 100644 --- a/src/pages/ChatAppPage/components/ChatReportForm.tsx +++ b/src/pages/ChatAppPage/components/ChatReportForm.tsx @@ -67,7 +67,7 @@ const ChatReportForm = forwardRef(({ type = 'chat', vid = 0, flow, onStart }, re return
- {items.map((item, i) =>
+ {items.map((item, i) =>
{item.name} {item.required ? " *" : ""}
diff --git a/src/pages/ChatAppPage/mobile/ChatPanneM.tsx b/src/pages/ChatAppPage/mobile/ChatPanneM.tsx index 41c8f3a..bbeb3c5 100644 --- a/src/pages/ChatAppPage/mobile/ChatPanneM.tsx +++ b/src/pages/ChatAppPage/mobile/ChatPanneM.tsx @@ -57,7 +57,7 @@ export default function ChatPanne({ customWsHost = '', data }) { setAssistant(null) const _flow = await getFlowApi(id) await build(_flow, chatId) - loadHistoryMsg(_flow.id, chatId) + loadHistoryMsg(_flow.id, chatId, type) flowRef.current = _flow setFlow(_flow) changeChatId(chatId) // ws @@ -65,7 +65,7 @@ export default function ChatPanne({ customWsHost = '', data }) { flowRef.current = null setFlow(null) const _assistant = await loadAssistantState(id) - loadHistoryMsg(_assistant.id, chatId) + loadHistoryMsg(_assistant.id, chatId, type) setAssistant(_assistant) changeChatId(chatId) // ws } @@ -370,7 +370,7 @@ export default function ChatPanne({ customWsHost = '', data }) { guideWord={flow.guide_word} wsUrl={wsUrl} onBeforSend={getWsParamData} - loadMore={() => loadMoreHistoryMsg(flow.id)} + loadMore={() => loadMoreHistoryMsg(flow.id, type)} inputForm={flowSate.isForm ? : null} /> {/*
diff --git a/src/pages/DiffFlowPage/components/Cell.tsx b/src/pages/DiffFlowPage/components/Cell.tsx index eda8530..9276408 100644 --- a/src/pages/DiffFlowPage/components/Cell.tsx +++ b/src/pages/DiffFlowPage/components/Cell.tsx @@ -42,7 +42,7 @@ const Cell = forwardRef((props, ref) => { remarkPlugins={[remarkGfm, remarkMath]} rehypePlugins={[rehypeMathjax]} linkTarget="_blank" - className="bs-mkdown inline-block break-all max-w-full text-sm text-[#111]" + className="bs-mkdown inline-block break-all max-w-full text-sm text-[#fff]" components={{ code: ({ node, inline, className, children, ...props }) => { if (children.length) { diff --git a/src/pages/DiffFlowPage/components/Component.tsx b/src/pages/DiffFlowPage/components/Component.tsx index ac8fbc5..afa3e01 100644 --- a/src/pages/DiffFlowPage/components/Component.tsx +++ b/src/pages/DiffFlowPage/components/Component.tsx @@ -39,7 +39,7 @@ export default function Component({ compId, options, disables, version, classNam
{vs.name} - {vs.update_time.replace('T', ' ').substring(0, 16)} + {vs.update_time.replace('T', ' ').substring(0, 16)}
)) @@ -68,7 +68,7 @@ export default function Component({ compId, options, disables, version, classNam
{vs.name} - {vs.update_time.replace('T', ' ').substring(0, 16)} + {vs.update_time.replace('T', ' ').substring(0, 16)}
)) diff --git a/src/pages/DiffFlowPage/components/RunForm.tsx b/src/pages/DiffFlowPage/components/RunForm.tsx index 47b97e9..c702e84 100644 --- a/src/pages/DiffFlowPage/components/RunForm.tsx +++ b/src/pages/DiffFlowPage/components/RunForm.tsx @@ -20,9 +20,9 @@ export default function RunForm({ show, flow, onChangeShow, onSubmit }) { } - + - + }; diff --git a/src/pages/DiffFlowPage/components/RunTest.tsx b/src/pages/DiffFlowPage/components/RunTest.tsx index e47418e..0bc518f 100644 --- a/src/pages/DiffFlowPage/components/RunTest.tsx +++ b/src/pages/DiffFlowPage/components/RunTest.tsx @@ -186,7 +186,7 @@ export default function RunTest({ nodeId }) {
{ if (e.key === 'Enter') { diff --git a/src/pages/DiffFlowPage/index.tsx b/src/pages/DiffFlowPage/index.tsx index ddbca35..a7d9f9d 100644 --- a/src/pages/DiffFlowPage/index.tsx +++ b/src/pages/DiffFlowPage/index.tsx @@ -33,7 +33,7 @@ export default function index(params) { addEmptyVersionFlow() } - console.log('mulitVersionFlow', mulitVersionFlow); + // console.log('mulitVersionFlow', mulitVersionFlow); return
diff --git a/src/pages/FlowPage/components/Header.tsx b/src/pages/FlowPage/components/Header.tsx index 4e4db08..a303bad 100644 --- a/src/pages/FlowPage/components/Header.tsx +++ b/src/pages/FlowPage/components/Header.tsx @@ -46,7 +46,7 @@ export default function Header({ flow }) { const { reactFlowInstance } = useContext(typesContext); const isPending = tabsState[flow.id]?.isPending; - console.log(isPending) + // console.log(isPending) const { openPopUp } = useContext(PopUpContext); // 记录快照 const { takeSnapshot } = useContext(undoRedoContext); @@ -167,17 +167,17 @@ export default function Header({ flow }) { handleChangeVersion(vid) }} className="gap-0"> {versions.map((vers, index) => ( -
+
changeName(vers.id, val)} > -

{vers.update_time.replace('T', ' ').substring(0, 16)}

+

{vers.update_time.replace('T', ' ').substring(0, 16)}

{ // 最后一个 V0 版本和当前选中版本不允许删除 diff --git a/src/pages/SkillPage/components/CardSelectVersion.tsx b/src/pages/SkillPage/components/CardSelectVersion.tsx index a7cad03..fcfeaa1 100644 --- a/src/pages/SkillPage/components/CardSelectVersion.tsx +++ b/src/pages/SkillPage/components/CardSelectVersion.tsx @@ -13,7 +13,7 @@ const SelectComp = ({ value, onChange = (id) => { }, data, disabled = false }) = } return