diff --git a/ui/src/api/log.ts b/ui/src/api/log.ts index dc1e27e91..0641764f0 100644 --- a/ui/src/api/log.ts +++ b/ui/src/api/log.ts @@ -116,10 +116,29 @@ const getMarkRecord: ( ) } +/** + * 获取对话记录详情 + * @param 参数 + * application_id, chart_id, chart_record_id + */ +const getRecordDetail: ( + applicaiton_id: String, + chart_id: String, + chart_record_id: String, + loading?: Ref +) => Promise> = (applicaiton_id, chart_id, chart_record_id, loading) => { + return get( + `${prefix}/${applicaiton_id}/chat/${chart_id}/chat_record/${chart_record_id}`, + undefined, + loading + ) +} + export default { getChatLog, delChatLog, getChatRecordLog, putChatRecordLog, - getMarkRecord + getMarkRecord, + getRecordDetail } diff --git a/ui/src/components/ai-chat/ParagraphSourceDialog.vue b/ui/src/components/ai-chat/ParagraphSourceDialog.vue new file mode 100644 index 000000000..34eb44ef3 --- /dev/null +++ b/ui/src/components/ai-chat/ParagraphSourceDialog.vue @@ -0,0 +1,93 @@ + + + diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 2c39158b0..ed84e1e29 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -62,7 +62,7 @@ -
+
知识来源
@@ -72,20 +72,26 @@ type="primary" plain size="small" + @click="openParagraph(item, dataset.id)" >{{ dataset.name }}
- 引用分段:{{ item.paragraph_list.length }}引用分段:{{ item.paragraph_list?.length }} 消耗 tokens: {{ item?.message_tokens + item?.answer_tokens }} - 耗时: {{ item.run_time.toFixed(2) }} s + 耗时: {{ item.run_time?.toFixed(2) }} s
@@ -149,6 +155,8 @@
+ +