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