Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
5fcd5c24
Unverified
Commit
5fcd5c24
authored
May 16, 2023
by
Joel
Committed by
GitHub
May 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: spend time and token (#47)
parent
d680fca9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
index.tsx
web/app/components/app/chat/index.tsx
+2
-1
index.tsx
web/app/components/app/configuration/debug/index.tsx
+2
-2
list.tsx
web/app/components/app/log/list.tsx
+2
-2
No files found.
web/app/components/app/chat/index.tsx
View file @
5fcd5c24
...
...
@@ -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
=
(
<
svg
width=
"14"
height=
"14"
viewBox=
"0 0 14 14"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
...
...
@@ -105,7 +106,7 @@ const MoreInfo: FC<{ more: MessageMore; isQuestion: boolean }> = ({ more, isQues
const
{
t
}
=
useTranslation
()
return
(<
div
className=
{
`mt-1 space-x-2 text-xs text-gray-400 ${isQuestion ? 'mr-2 text-right ' : 'ml-2 text-left float-right'}`
}
>
<
span
>
{
`${t('appLog.detail.timeConsuming')} ${more.latency}${t('appLog.detail.second')}`
}
</
span
>
<
span
>
{
`${t('appLog.detail.tokenCost')} ${
more.tokens
}`
}
</
span
>
<
span
>
{
`${t('appLog.detail.tokenCost')} ${
formatNumber(more.tokens)
}`
}
</
span
>
<
span
>
·
</
span
>
<
span
>
{
more
.
time
}
</
span
>
</
div
>)
...
...
web/app/components/app/configuration/debug/index.tsx
View file @
5fcd5c24
...
...
@@ -247,8 +247,8 @@ const Debug: FC<IDebug> = ({
...
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
),
}
}
}
...
...
web/app/components/app/log/list.tsx
View file @
5fcd5c24
...
...
@@ -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
,
})
...
...
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