Skip to content

Commit

Permalink
导出聊天记录:带上时间戳
Browse files Browse the repository at this point in the history
  • Loading branch information
classfang committed May 31, 2024
1 parent 56ca321 commit 0e887d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Message, Modal } from '@arco-design/web-vue'
import AssistantForm from '@renderer/components/views/chat2assistant/assistant-list/AssistantForm.vue'
import { useAssistantStore } from '@renderer/store/assistant'
import { useSystemStore } from '@renderer/store/system'
import { nowTimestamp } from '@renderer/utils/date-util'
import { formatDateTime, nowTimestamp } from '@renderer/utils/date-util'
import { exportTextFile } from '@renderer/utils/download-util'
import { copyObj } from '@renderer/utils/object-util'
import { copyFields } from '@renderer/utils/object-util'
Expand Down Expand Up @@ -108,9 +108,9 @@ const exportChatMessageList = () => {
return
}
const content = data.currentAssistant.chatMessageList
.map((r) => r.role + ': \n' + r.content)
.map((r) => `[${formatDateTime(new Date(r.createTime))}] ${r.role} : \n${r.content}`)
.join('\n\n')
exportTextFile(`records-${nowTimestamp()}.md`, content)
exportTextFile(`chat-records-${nowTimestamp()}.md`, content)
}
const assistantUpdate = (newAssistant: Assistant) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ const exportChatMessageList = (id: string) => {
return
}
const content = collectionSet.chat?.chatMessageList
.map((r) => r.role + ': \n' + r.content)
.map((r) => `[${formatDateTime(new Date(r.createTime))}] ${r.role} : \n${r.content}`)
.join('\n\n')
exportTextFile(`records-${nowTimestamp()}.md`, content)
exportTextFile(`chat-records-${nowTimestamp()}.md`, content)
}
// 新建笔记
Expand Down

0 comments on commit 0e887d5

Please sign in to comment.