chore(version): 0.8.25

This commit is contained in:
kangfenmao 2024-12-12 14:27:08 +08:00
parent 2fae6e4a3e
commit 25eb97902b
5 changed files with 37 additions and 25 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "CherryStudio", "name": "CherryStudio",
"version": "0.8.24", "version": "0.8.25",
"private": true, "private": true,
"description": "A powerful AI assistant for producer.", "description": "A powerful AI assistant for producer.",
"main": "./out/main/index.js", "main": "./out/main/index.js",

View File

@ -121,6 +121,7 @@ import WenxinModelLogo from '@renderer/assets/images/models/wenxin.png'
import WenxinModelLogoDark from '@renderer/assets/images/models/wenxin_dark.png' import WenxinModelLogoDark from '@renderer/assets/images/models/wenxin_dark.png'
import YiModelLogo from '@renderer/assets/images/models/yi.png' import YiModelLogo from '@renderer/assets/images/models/yi.png'
import YiModelLogoDark from '@renderer/assets/images/models/yi_dark.png' import YiModelLogoDark from '@renderer/assets/images/models/yi_dark.png'
import { getProviderByModel } from '@renderer/services/AssistantService'
import { Model } from '@renderer/types' import { Model } from '@renderer/types'
import OpenAI from 'openai' import OpenAI from 'openai'
@ -1058,5 +1059,6 @@ export function isSupportedModel(model: OpenAI.Models.Model): boolean {
} }
export function isWebSearchModel(model: Model): boolean { export function isWebSearchModel(model: Model): boolean {
return model?.provider === 'gemini' && model?.id === 'gemini-2.0-flash-exp' const provider = getProviderByModel(model)
return (provider.id === 'gemini' || provider?.type === 'gemini') && model?.id === 'gemini-2.0-flash-exp'
} }

View File

@ -1,7 +1,13 @@
import { CheckOutlined, QuestionCircleOutlined, ReloadOutlined } from '@ant-design/icons' import { CheckOutlined, QuestionCircleOutlined, ReloadOutlined } from '@ant-design/icons'
import { HStack } from '@renderer/components/Layout' import { HStack } from '@renderer/components/Layout'
import Scrollbar from '@renderer/components/Scrollbar' import Scrollbar from '@renderer/components/Scrollbar'
import { DEFAULT_CONTEXTCOUNT, DEFAULT_MAX_TOKENS, DEFAULT_TEMPERATURE } from '@renderer/config/constant' import {
DEFAULT_CONTEXTCOUNT,
DEFAULT_MAX_TOKENS,
DEFAULT_TEMPERATURE,
isMac,
isWindows
} from '@renderer/config/constant'
import { codeThemes } from '@renderer/context/SyntaxHighlighterProvider' import { codeThemes } from '@renderer/context/SyntaxHighlighterProvider'
import { useAssistant } from '@renderer/hooks/useAssistant' import { useAssistant } from '@renderer/hooks/useAssistant'
import { useSettings } from '@renderer/hooks/useSettings' import { useSettings } from '@renderer/hooks/useSettings'
@ -351,9 +357,9 @@ const SettingsTab: FC<Props> = (props) => {
menuItemSelectedIcon={<CheckOutlined />} menuItemSelectedIcon={<CheckOutlined />}
options={[ options={[
{ value: 'Enter', label: 'Enter' }, { value: 'Enter', label: 'Enter' },
{ value: 'Shift+Enter', label: `Shift + Enter` }, { value: 'Shift+Enter', label: 'Shift + Enter' },
{ value: 'Ctrl+Enter', label: `Ctrl + Enter` }, { value: 'Ctrl+Enter', label: 'Ctrl + Enter' },
{ value: 'Command+Enter', label: `CommandOrControl + Enter` } { value: 'Command+Enter', label: `${isMac ? '⌘' : isWindows ? 'Win' : 'Super'} + Enter` }
]} ]}
onChange={(value) => setSendMessageShortcut(value)} onChange={(value) => setSendMessageShortcut(value)}
style={{ width: 135 }} style={{ width: 135 }}

View File

@ -1,6 +1,7 @@
import { LoadingOutlined, MinusOutlined, PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons' import { LoadingOutlined, MinusOutlined, PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons'
import VisionIcon from '@renderer/components/Icons/VisionIcon' import VisionIcon from '@renderer/components/Icons/VisionIcon'
import { getModelLogo, isVisionModel, SYSTEM_MODELS } from '@renderer/config/models' import WebSearchIcon from '@renderer/components/Icons/WebSearchIcon'
import { getModelLogo, isVisionModel, isWebSearchModel, SYSTEM_MODELS } from '@renderer/config/models'
import { useProvider } from '@renderer/hooks/useProvider' import { useProvider } from '@renderer/hooks/useProvider'
import { fetchModels } from '@renderer/services/ApiService' import { fetchModels } from '@renderer/services/ApiService'
import { Model, Provider } from '@renderer/types' import { Model, Provider } from '@renderer/types'
@ -127,6 +128,7 @@ const PopupContainer: React.FC<Props> = ({ provider: _provider, resolve }) => {
<ListItemName> <ListItemName>
{model.name} {model.name}
{isVisionModel(model) && <VisionIcon />} {isVisionModel(model) && <VisionIcon />}
{isWebSearchModel(model) && <WebSearchIcon />}
{isFreeModel(model) && ( {isFreeModel(model) && (
<Tag style={{ marginLeft: 10 }} color="green"> <Tag style={{ marginLeft: 10 }} color="green">
Free Free

View File

@ -712,7 +712,7 @@ const migrateConfig = {
}, },
'46': (state: RootState) => { '46': (state: RootState) => {
if ( if (
state.settings.translateModelPrompt.includes( state.settings?.translateModelPrompt?.includes(
'If the target language is the same as the source language, do not translate' 'If the target language is the same as the source language, do not translate'
) )
) { ) {
@ -729,23 +729,25 @@ const migrateConfig = {
return state return state
}, },
'48': (state: RootState) => { '48': (state: RootState) => {
state.shortcuts.shortcuts.forEach((shortcut) => { if (state.shortcuts) {
shortcut.system = shortcut.key !== 'new_topic' state.shortcuts.shortcuts.forEach((shortcut) => {
}) shortcut.system = shortcut.key !== 'new_topic'
state.shortcuts.shortcuts.push({ })
key: 'toggle_show_assistants', state.shortcuts.shortcuts.push({
shortcut: [isMac ? 'Command' : 'Ctrl', '['], key: 'toggle_show_assistants',
editable: true, shortcut: [isMac ? 'Command' : 'Ctrl', '['],
enabled: true, editable: true,
system: false enabled: true,
}) system: false
state.shortcuts.shortcuts.push({ })
key: 'toggle_show_topics', state.shortcuts.shortcuts.push({
shortcut: [isMac ? 'Command' : 'Ctrl', ']'], key: 'toggle_show_topics',
editable: true, shortcut: [isMac ? 'Command' : 'Ctrl', ']'],
enabled: true, editable: true,
system: false enabled: true,
}) system: false
})
}
return state return state
} }
} }