bugfix: restore会话历史
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
import Input from '../../components/Input.vue'
|
||||
import { fetchAgentReply } from '@/api/agent'
|
||||
import type { AgentParamsType } from '@/api/agent'
|
||||
import { useUserInfoStore, useProjectStore, } from '@/stores'
|
||||
import { useUserInfoStore, useProjectStore } from '@/stores'
|
||||
import { useAgentStore } from '@/stores/agent'
|
||||
|
||||
const userStore = useUserInfoStore()
|
||||
@@ -252,7 +252,7 @@
|
||||
// console.log('dataLInes', dataLines)
|
||||
if (isNodeIdEvent) {
|
||||
params.versionID = dataLines[0]
|
||||
projectStore.setProject({nodeId:dataLines[0]})
|
||||
projectStore.setProject({ nodeId: dataLines[0] })
|
||||
}
|
||||
|
||||
if (dataLines.length === 0) continue
|
||||
@@ -367,31 +367,34 @@
|
||||
const ancestorsList = []
|
||||
if (ancestors) {
|
||||
ancestors.forEach((item) => {
|
||||
const list = item.dialogue.map((el, index) => {
|
||||
if (el.image_url) {
|
||||
imgList.push(el.image_url)
|
||||
}
|
||||
return {
|
||||
...el,
|
||||
text: el.content,
|
||||
isUser: el.role === 'user',
|
||||
id: index + 1
|
||||
}
|
||||
})
|
||||
const list =
|
||||
item.dialogue?.map((el, index) => {
|
||||
if (el.image_url) {
|
||||
imgList.push(el.image_url)
|
||||
}
|
||||
return {
|
||||
...el,
|
||||
text: el.content,
|
||||
isUser: el.role === 'user',
|
||||
id: index + 1
|
||||
}
|
||||
}) || []
|
||||
ancestorsList.push(...list)
|
||||
})
|
||||
}
|
||||
const currentList = current.dialogue.map((item, index) => {
|
||||
if (item.image_url) {
|
||||
imgList.push(item.image_url)
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
text: item.content,
|
||||
isUser: item.role === 'user',
|
||||
id: index + 1 + ancestorsList.length
|
||||
}
|
||||
})
|
||||
const currentList =
|
||||
current?.dialogue?.map((item, index) => {
|
||||
if (item.image_url) {
|
||||
imgList.push(item.image_url)
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
text: item.content,
|
||||
isUser: item.role === 'user',
|
||||
id: index + 1 + ancestorsList.length
|
||||
}
|
||||
}) || []
|
||||
|
||||
messageList.value = [...ancestorsList, ...currentList]
|
||||
params.versionID = current.id
|
||||
sketchList.value = imgList
|
||||
|
||||
Reference in New Issue
Block a user