-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added translations, new column, and UI improvements.
- Added translations for a new field. - Added new column for file count in the FilesPage view. - Improved handling of message tokens in the UI. - Added functionality to display message tokens for messages with specific roles. - Added window style selection and styling adjustments to the General Settings page. - Added support for vision models in OpenAIProvider.
- Loading branch information
1 parent
f1c8922
commit 33ac093
Showing
6 changed files
with
77 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { useRuntime } from '@renderer/hooks/useStore' | ||
import { Message } from '@renderer/types' | ||
import styled from 'styled-components' | ||
|
||
const MessgeTokens: React.FC<{ message: Message }> = ({ message }) => { | ||
const { generating } = useRuntime() | ||
|
||
if (!message.usage) { | ||
return null | ||
} | ||
|
||
if (message.role === 'user') { | ||
return <MessageMetadata>Tokens: {message?.usage?.total_tokens}</MessageMetadata> | ||
} | ||
|
||
if (generating) { | ||
return null | ||
} | ||
|
||
if (message.role === 'assistant') { | ||
return ( | ||
<MessageMetadata> | ||
Tokens: {message?.usage?.total_tokens} | ↑{message?.usage?.prompt_tokens} | ↓{message?.usage?.completion_tokens} | ||
</MessageMetadata> | ||
) | ||
} | ||
|
||
return null | ||
} | ||
|
||
const MessageMetadata = styled.div` | ||
font-size: 12px; | ||
color: var(--color-text-2); | ||
user-select: text; | ||
margin: 2px 0; | ||
` | ||
|
||
export default MessgeTokens |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters