Skip to content

Commit 4eede21

Browse files
committed
feat: add chat log step display
1 parent 9b34e25 commit 4eede21

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

frontend/src/views/chat/index.vue

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -934,23 +934,26 @@ async function clickAnalysis(id?: number) {
934934
}
935935
936936
function getRecordUsage(recordId: any) {
937-
chatApi
938-
.get_chart_usage(recordId)
939-
.then((res) => {
940-
const logHistory = chatApi.toChatLogHistory(res)
941-
if (logHistory) {
942-
currentChat.value.records.forEach((record) => {
943-
if (record.id === recordId) {
944-
record.duration = logHistory.duration
945-
record.finish_time = logHistory.finish_time
946-
record.total_tokens = logHistory.total_tokens
947-
}
948-
})
949-
}
950-
})
951-
.catch((e) => {
952-
console.error(e)
953-
})
937+
console.debug('getRecordUsage id: ', recordId)
938+
nextTick(() => {
939+
chatApi
940+
.get_chart_usage(recordId)
941+
.then((res) => {
942+
const logHistory = chatApi.toChatLogHistory(res)
943+
if (logHistory) {
944+
currentChat.value.records.forEach((record) => {
945+
if (record.id === recordId) {
946+
record.duration = logHistory.duration
947+
record.finish_time = logHistory.finish_time
948+
record.total_tokens = logHistory.total_tokens
949+
}
950+
})
951+
}
952+
})
953+
.catch((e) => {
954+
console.error(e)
955+
})
956+
})
954957
}
955958
956959
const predictAnswerRef = ref()

0 commit comments

Comments
 (0)