feat: add contextCount to inputbar
This commit is contained in:
parent
2592448c74
commit
87c04408de
@ -67,7 +67,7 @@ const resources = {
|
||||
'input.send': 'Send',
|
||||
'input.pause': 'Pause',
|
||||
'input.settings': 'Settings',
|
||||
'input.estimated_tokens': 'Estimated tokens: ',
|
||||
'input.estimated_tokens': 'Estimated Tokens: ',
|
||||
'settings.temperature': 'Temperature',
|
||||
'settings.temperature.tip':
|
||||
'Lower values make the model more creative and unpredictable, while higher values make it more deterministic and precise.',
|
||||
|
||||
@ -26,6 +26,7 @@ import { useTranslation } from 'react-i18next'
|
||||
import styled from 'styled-components'
|
||||
import AssistantSettings from './AssistantSettings'
|
||||
import SendMessageSetting from './SendMessageSetting'
|
||||
import { DEFAULT_CONEXTCOUNT } from '@renderer/config/constant'
|
||||
|
||||
interface Props {
|
||||
assistant: Assistant
|
||||
@ -193,6 +194,7 @@ const Inputbar: FC<Props> = ({ assistant, setActiveTopic }) => {
|
||||
styles={{ textarea: { paddingLeft: 0 } }}
|
||||
/>
|
||||
<TextCount>
|
||||
<HistoryOutlined /> {assistant?.settings?.contextCount ?? DEFAULT_CONEXTCOUNT} |{' '}
|
||||
{t('assistant.input.estimated_tokens')}: {`${inputTokenCount}/${estimateTokenCount}`}
|
||||
</TextCount>
|
||||
</Container>
|
||||
@ -257,6 +259,7 @@ const TextCount = styled.div`
|
||||
bottom: 8px;
|
||||
font-size: 11px;
|
||||
color: var(--color-text-3);
|
||||
z-index: 10;
|
||||
`
|
||||
|
||||
export default Inputbar
|
||||
|
||||
@ -105,7 +105,7 @@ const MessageItem: FC<Props> = ({ message, index, showMenu, onDeleteMessage }) =
|
||||
{message.usage && (
|
||||
<>
|
||||
<MessageMetadata>
|
||||
Tokens: {message.usage.total_tokens} (IN:{message.usage.prompt_tokens}/OUT:
|
||||
tokens: {message.usage.total_tokens} (in:{message.usage.prompt_tokens}/out:
|
||||
{message.usage.completion_tokens})
|
||||
</MessageMetadata>
|
||||
</>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user