Commit 221c9d58 by YunaiV

【功能新增】AI:聊天记录返回时,增加 segments

parent 47e1cd9c
......@@ -14,9 +14,16 @@ export interface ChatMessageVO {
modelId: number // 模型编号
content: string // 聊天内容
tokens: number // 消耗 Token 数量
segmentIds?: number[] // 段落编号
segments?: {
id: number // 段落编号
content: string // 段落内容
documentId: number // 文档编号
documentName: string // 文档名称
}[]
createTime: Date // 创建时间
roleAvatar: string // 角色头像
userAvatar: string // 创建时间
userAvatar: string // 用户头像
}
// AI chat 聊天
......
......@@ -12,6 +12,7 @@
</div>
<div class="left-text-container" ref="markdownViewRef">
<MarkdownView class="left-text" :content="item.content" />
<MessageKnowledge v-if="item.segments" :segments="item.segments" />
</div>
<div class="left-btns">
<el-button class="btn-cus" link @click="copyContent(item.content)">
......@@ -62,6 +63,7 @@
import { PropType } from 'vue'
import { formatDate } from '@/utils/formatTime'
import MarkdownView from '@/components/MarkdownView/index.vue'
import MessageKnowledge from './MessageKnowledge.vue'
import { useClipboard } from '@vueuse/core'
import { ArrowDownBold, Edit, RefreshRight } from '@element-plus/icons-vue'
import { ChatMessageApi, ChatMessageVO } from '@/api/ai/chat/message'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment