| | |
| | | if (code == 0) { |
| | | console.log(data,'会话详情'); |
| | | sessionDetailList.value = data.dsl.messages; |
| | | agentTitle.value = data.name || '未命名会话'; |
| | | agentTitle.value = `和${data.title}的会话` || '未命名会话'; |
| | | refreshScroll(); //刷新滚动条位置 |
| | | } |
| | | }; |
| | |
| | | // 查询历史记录 |
| | | if (session.app_type == '1') { |
| | | // 生成智能体新的对话 |
| | | emit('createSession',session.app_id); |
| | | emit('createSession',session.app_id,`和${session.name}的会话`); |
| | | emit('changeAgentType','1'); |
| | | } else { |
| | | // 生成agent新的对话 |
| | |
| | | Message.warning("查询失败"); |
| | | } |
| | | }; |
| | | |
| | | // 生成智能体新建会话 |
| | | const createNewSession = async (session) => { |
| | | console.log(session, 'session'); |
| | | // 查询历史记录 |
| | | // emit('querySessionDetail',session); |
| | | if (session.type == '1') { |
| | | // 生成智能体新的对话 |
| | | emit('createSession',session.id); |
| | | emit('createSession',session.id,`和${session.name}的会话`); |
| | | emit('changeAgentType','1'); |
| | | } else { |
| | | // 生成agent新的对话 |
| | |
| | | } |
| | | }; |
| | | // 新建会话 |
| | | const createSession = async (id) => { |
| | | const createSession = async (id,name='未命名会话') => { |
| | | // 如果有会话id |
| | | console.log(name, '新建会话名称'); |
| | | |
| | | |
| | | |
| | | const res = await addSessionApi({ |
| | | dialog_id: id, |
| | | conversation_desc: "未命名会话" |
| | | conversation_desc: name |
| | | }); |
| | | // console.log(res, "res"); |
| | | if (res.code == 200) { |