Skip to content

Commit a8fe48e

Browse files
committed
Add input/output tokens for ai workflow runs
1 parent 12cca79 commit a8fe48e

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

src/apps/review/src/lib/hooks/useFetchAiWorkflowRuns.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ export interface AiWorkflowRun {
4444
gitRunUrl?: string;
4545
score: number;
4646
workflow: AiWorkflow
47+
usage: {
48+
input: number
49+
output: number
50+
}
4751
}
4852

4953
export interface AiWorkflowRunArtifact {

src/apps/review/src/pages/reviews/components/ScorecardHeader/ScorecardHeader.module.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,16 @@
101101
&.sm {
102102
height: 16px;
103103
}
104-
path {
105-
fill: #0A0A0A;
104+
&.md {
105+
height: 20px;
106+
stroke: #0a0a0a;
107+
}
108+
109+
&.iconFile {
110+
path {
111+
fill: #0A0A0A;
112+
}
113+
height: 16px;
106114
}
107115
}
108116

src/apps/review/src/pages/reviews/components/ScorecardHeader/ScorecardHeader.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import moment, { Duration } from 'moment'
33

44
import { ReviewsContextModel } from '~/apps/review/src/lib/models'
55
import { useRolePermissions, UseRolePermissionsResult } from '~/apps/review/src/lib/hooks'
6+
import { ArrowCircleDownIcon, ArrowCircleUpIcon } from '@heroicons/react/outline'
67

78
import { IconClock, IconFile, IconPremium } from '../../../../lib/assets/icons'
89
import { AiModelModal } from '../AiModelModal'
@@ -68,7 +69,7 @@ const ScorecardHeader: FC = () => {
6869
</span>
6970
{isAdmin && (
7071
<span>
71-
<IconFile className={styles.sm} />
72+
<IconFile className={styles.iconFile} />
7273
<span>
7374
<strong>Git log:</strong>
7475
{' '}
@@ -81,6 +82,26 @@ const ScorecardHeader: FC = () => {
8182
</span>
8283
</span>
8384
)}
85+
{isAdmin && (
86+
<span>
87+
<ArrowCircleDownIcon className={styles.md} />
88+
<span>
89+
<strong>Input Tokens:</strong>
90+
{' '}
91+
{workflowRun.usage.input}
92+
</span>
93+
</span>
94+
)}
95+
{isAdmin && (
96+
<span>
97+
<ArrowCircleUpIcon className={styles.md} />
98+
<span>
99+
<strong>Output Tokens:</strong>
100+
{' '}
101+
{workflowRun.usage.output}
102+
</span>
103+
</span>
104+
)}
84105
</div>
85106
</div>
86107
<p className={styles.workflowDescription}>

0 commit comments

Comments
 (0)