style: playground output tips

This commit is contained in:
jialin
2024-07-15 11:17:42 +08:00
parent a834d79b7d
commit 21e151ac28
6 changed files with 30 additions and 8 deletions
@@ -9,6 +9,8 @@ interface ReferenceParamsProps {
prompt_tokens: number;
total_tokens: number;
tokens_per_second: number;
time_per_output_token_ms: number;
time_to_first_token_ms: number;
};
}
@@ -43,8 +45,26 @@ const ReferenceParams = (props: ReferenceParamsProps) => {
</span>
<span>
{intl.formatMessage({ id: 'playground.tokenoutput' })}:{' '}
{_.round(usage.tokens_per_second, 2)} Tokens/s
<Tooltip
trigger={['click']}
title={
<Space>
<span>
{intl.formatMessage({ id: 'playground.timePerOutputToken' })}:{' '}
{_.round(usage.time_per_output_token_ms, 2)} ms
</span>
<span>
{intl.formatMessage({ id: 'playground.timeToFirstToken' })}:{' '}
{_.round(usage.time_to_first_token_ms, 2)} ms
</span>
</Space>
}
>
<span>
{intl.formatMessage({ id: 'playground.tokenoutput' })}:{' '}
{_.round(usage.tokens_per_second, 2)} Tokens/s
</span>
</Tooltip>
</span>
</div>
);
@@ -177,6 +177,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
size="small"
href="#/api-keys"
target="_blank"
style={{ paddingInline: 2 }}
>
<span>
{' '}