+
@@ -99,9 +124,20 @@ function getAttachmentDescription(file: QuestionAttachment) {
-
{{ content.content }}
-
-
+
+
+ {{ content.content }}
+
+
+
+
+
+
+
+
@@ -115,3 +151,9 @@ function getAttachmentDescription(file: QuestionAttachment) {
+
+
diff --git a/ui/src/conversation-panel/components/message-input/index.ts b/ui/src/conversation-panel/components/message-input/index.ts
index 6a256ddab3f..4bacae9da06 100644
--- a/ui/src/conversation-panel/components/message-input/index.ts
+++ b/ui/src/conversation-panel/components/message-input/index.ts
@@ -80,7 +80,6 @@ export function createMessageInputStore(deps: MessageInputDeps) {
const maxFiles = 10
const maxSizeMB = 50
- // TODO 格式 不行
const acceptList = [...IMAGE_EXTENSIONS, ...DOCUMENT_EXTENSIONS, ...VIDEO_EXTENSIONS, ...AUDIO_EXTENSIONS].map((e) => `.${e}`).join(',')
// 语音输入:智能体开启语音转文字且当前模式提供接口时可用
diff --git a/ui/src/conversation-panel/left-sidebar/portal-conversation-list/index.ts b/ui/src/conversation-panel/left-sidebar/portal-conversation-list/index.ts
index 0c947175549..4e17d7d931e 100644
--- a/ui/src/conversation-panel/left-sidebar/portal-conversation-list/index.ts
+++ b/ui/src/conversation-panel/left-sidebar/portal-conversation-list/index.ts
@@ -85,6 +85,35 @@ export function createPortalConversationListStore(deps: PortalConversationListDe
}
}
+ // 先查询全部分组和会话,再删除,避免边删除边翻页造成记录遗漏。
+ const clearConversations = async (onRemoved: (applicationId: string, chatId: string) => void) => {
+ const applicationIds = new Set
()
+ for (let page = 1; ; page++) {
+ const response = await pageApplicationConversations(page, APPLICATION_PAGE_SIZE)
+ const records = response.records ?? []
+ records.forEach((application) => applicationIds.add(application.id))
+ if (records.length < APPLICATION_PAGE_SIZE) break
+ }
+
+ const pendingConversations: { applicationId: string; chatId: string }[] = []
+ for (const applicationId of applicationIds) {
+ for (let page = 1; ; page++) {
+ const response = await pageGroupConversations(applicationId, page, APPLICATION_PAGE_SIZE)
+ // 查询失败不得当作空页继续删除。
+ if (!response) throw new Error('获取历史对话失败')
+ const records = response.records ?? []
+ records.forEach((conversation) => pendingConversations.push({ applicationId, chatId: conversation.id }))
+ if (records.length < APPLICATION_PAGE_SIZE) break
+ }
+ }
+
+ for (const { applicationId, chatId } of pendingConversations) {
+ await deleteGroupConversation(applicationId, chatId)
+ onRemoved(applicationId, chatId)
+ }
+ await loadApplicationGroups()
+ }
+
// 按名称查询可访问的智能体,全部智能体页与选择智能体抽屉各自维护搜索条件与结果
const fetchApplications = (keyword: string) => pageApplications(1, APPLICATION_PAGE_SIZE, keyword.trim()).then((response) => response.records ?? [])
@@ -116,6 +145,7 @@ export function createPortalConversationListStore(deps: PortalConversationListDe
loadApplicationGroups,
toggleGroup,
deleteGroupConversation,
+ clearConversations,
applications,
applicationKeyword,
isApplicationsLoading,
diff --git a/ui/src/conversation-panel/left-sidebar/portal-conversation-list/index.vue b/ui/src/conversation-panel/left-sidebar/portal-conversation-list/index.vue
index 525e1ff4cb5..ab3b2ca06d7 100644
--- a/ui/src/conversation-panel/left-sidebar/portal-conversation-list/index.vue
+++ b/ui/src/conversation-panel/left-sidebar/portal-conversation-list/index.vue
@@ -1,5 +1,6 @@
@@ -83,14 +108,16 @@ const handleDeleteConversation = (group: PortalApplicationGroup, conversation: C
历史对话
-
-
-
-
+
+
+
+
+
+
-
+
暂无历史记录
diff --git a/ui/src/views/chat/share/index.vue b/ui/src/views/chat/share/index.vue
index b05033c1029..0f4df42848a 100644
--- a/ui/src/views/chat/share/index.vue
+++ b/ui/src/views/chat/share/index.vue
@@ -1,5 +1,5 @@