diff --git a/web/app/components/app/chat/index.tsx b/web/app/components/app/chat/index.tsx index 7b512c57d4..577f0b1c1b 100644 --- a/web/app/components/app/chat/index.tsx +++ b/web/app/components/app/chat/index.tsx @@ -16,6 +16,7 @@ import type { Annotation, MessageRating } from '@/models/log' import AppContext from '@/context/app-context' import { Markdown } from '@/app/components/base/markdown' import LoadingAnim from './loading-anim' +import { formatNumber } from '@/utils/format' const stopIcon = ( @@ -105,7 +106,7 @@ const MoreInfo: FC<{ more: MessageMore; isQuestion: boolean }> = ({ more, isQues const { t } = useTranslation() return (
{`${t('appLog.detail.timeConsuming')} ${more.latency}${t('appLog.detail.second')}`} - {`${t('appLog.detail.tokenCost')} ${more.tokens}`} + {`${t('appLog.detail.tokenCost')} ${formatNumber(more.tokens)}`} ยท {more.time}
) diff --git a/web/app/components/app/configuration/debug/index.tsx b/web/app/components/app/configuration/debug/index.tsx index c7ac273886..a4d19be265 100644 --- a/web/app/components/app/configuration/debug/index.tsx +++ b/web/app/components/app/configuration/debug/index.tsx @@ -247,8 +247,8 @@ const Debug: FC = ({ ...draft[index], more: { time: dayjs.unix(newResponseItem.created_at).format('hh:mm A'), - tokens: newResponseItem.answer_tokens, - latency: (newResponseItem.provider_response_latency / 1000).toFixed(2), + tokens: newResponseItem.answer_tokens + newResponseItem.message_tokens, + latency: newResponseItem.provider_response_latency.toFixed(2), } } } diff --git a/web/app/components/app/log/list.tsx b/web/app/components/app/log/list.tsx index cfde271d53..e29eafa6f0 100644 --- a/web/app/components/app/log/list.tsx +++ b/web/app/components/app/log/list.tsx @@ -94,8 +94,8 @@ const getFormattedChatList = (messages: ChatMessage[]) => { isAnswer: true, more: { time: dayjs.unix(item.created_at).format('hh:mm A'), - tokens: item.answer_tokens, - latency: (item.provider_response_latency / 1000).toFixed(2), + tokens: item.answer_tokens + item.message_tokens, + latency: item.provider_response_latency.toFixed(2), }, annotation: item.annotation, })