Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
221c9d58
authored
Mar 09, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能新增】AI:聊天记录返回时,增加 segments
parent
47e1cd9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
src/api/ai/chat/message/index.ts
+8
-1
src/views/ai/chat/index/components/message/MessageList.vue
+2
-0
No files found.
src/api/ai/chat/message/index.ts
View file @
221c9d58
...
@@ -14,9 +14,16 @@ export interface ChatMessageVO {
...
@@ -14,9 +14,16 @@ export interface ChatMessageVO {
modelId
:
number
// 模型编号
modelId
:
number
// 模型编号
content
:
string
// 聊天内容
content
:
string
// 聊天内容
tokens
:
number
// 消耗 Token 数量
tokens
:
number
// 消耗 Token 数量
segmentIds
?:
number
[]
// 段落编号
segments
?:
{
id
:
number
// 段落编号
content
:
string
// 段落内容
documentId
:
number
// 文档编号
documentName
:
string
// 文档名称
}[]
createTime
:
Date
// 创建时间
createTime
:
Date
// 创建时间
roleAvatar
:
string
// 角色头像
roleAvatar
:
string
// 角色头像
userAvatar
:
string
//
创建时间
userAvatar
:
string
//
用户头像
}
}
// AI chat 聊天
// AI chat 聊天
...
...
src/views/ai/chat/index/components/message/MessageList.vue
View file @
221c9d58
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
</div>
</div>
<div
class=
"left-text-container"
ref=
"markdownViewRef"
>
<div
class=
"left-text-container"
ref=
"markdownViewRef"
>
<MarkdownView
class=
"left-text"
:content=
"item.content"
/>
<MarkdownView
class=
"left-text"
:content=
"item.content"
/>
<MessageKnowledge
v-if=
"item.segments"
:segments=
"item.segments"
/>
</div>
</div>
<div
class=
"left-btns"
>
<div
class=
"left-btns"
>
<el-button
class=
"btn-cus"
link
@
click=
"copyContent(item.content)"
>
<el-button
class=
"btn-cus"
link
@
click=
"copyContent(item.content)"
>
...
@@ -62,6 +63,7 @@
...
@@ -62,6 +63,7 @@
import
{
PropType
}
from
'vue'
import
{
PropType
}
from
'vue'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
formatDate
}
from
'@/utils/formatTime'
import
MarkdownView
from
'@/components/MarkdownView/index.vue'
import
MarkdownView
from
'@/components/MarkdownView/index.vue'
import
MessageKnowledge
from
'./MessageKnowledge.vue'
import
{
useClipboard
}
from
'@vueuse/core'
import
{
useClipboard
}
from
'@vueuse/core'
import
{
ArrowDownBold
,
Edit
,
RefreshRight
}
from
'@element-plus/icons-vue'
import
{
ArrowDownBold
,
Edit
,
RefreshRight
}
from
'@element-plus/icons-vue'
import
{
ChatMessageApi
,
ChatMessageVO
}
from
'@/api/ai/chat/message'
import
{
ChatMessageApi
,
ChatMessageVO
}
from
'@/api/ai/chat/message'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment