Skip to content

Commit

Permalink
chore(version): 0.8.25
Browse files Browse the repository at this point in the history
  • Loading branch information
kangfenmao committed Dec 12, 2024
1 parent 2fae6e4 commit 25eb979
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CherryStudio",
"version": "0.8.24",
"version": "0.8.25",
"private": true,
"description": "A powerful AI assistant for producer.",
"main": "./out/main/index.js",
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/src/config/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ import WenxinModelLogo from '@renderer/assets/images/models/wenxin.png'
import WenxinModelLogoDark from '@renderer/assets/images/models/wenxin_dark.png'
import YiModelLogo from '@renderer/assets/images/models/yi.png'
import YiModelLogoDark from '@renderer/assets/images/models/yi_dark.png'
import { getProviderByModel } from '@renderer/services/AssistantService'
import { Model } from '@renderer/types'
import OpenAI from 'openai'

Expand Down Expand Up @@ -1058,5 +1059,6 @@ export function isSupportedModel(model: OpenAI.Models.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'
}
14 changes: 10 additions & 4 deletions src/renderer/src/pages/home/Tabs/SettingsTab.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { CheckOutlined, QuestionCircleOutlined, ReloadOutlined } from '@ant-design/icons'
import { HStack } from '@renderer/components/Layout'
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 { useAssistant } from '@renderer/hooks/useAssistant'
import { useSettings } from '@renderer/hooks/useSettings'
Expand Down Expand Up @@ -351,9 +357,9 @@ const SettingsTab: FC<Props> = (props) => {
menuItemSelectedIcon={<CheckOutlined />}
options={[
{ value: 'Enter', label: 'Enter' },
{ value: 'Shift+Enter', label: `Shift + Enter` },
{ value: 'Ctrl+Enter', label: `Ctrl + Enter` },
{ value: 'Command+Enter', label: `CommandOrControl + Enter` }
{ value: 'Shift+Enter', label: 'Shift + Enter' },
{ value: 'Ctrl+Enter', label: 'Ctrl + Enter' },
{ value: 'Command+Enter', label: `${isMac ? '⌘' : isWindows ? 'Win' : 'Super'} + Enter` }
]}
onChange={(value) => setSendMessageShortcut(value)}
style={{ width: 135 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { LoadingOutlined, MinusOutlined, PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons'
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 { fetchModels } from '@renderer/services/ApiService'
import { Model, Provider } from '@renderer/types'
Expand Down Expand Up @@ -127,6 +128,7 @@ const PopupContainer: React.FC<Props> = ({ provider: _provider, resolve }) => {
<ListItemName>
{model.name}
{isVisionModel(model) && <VisionIcon />}
{isWebSearchModel(model) && <WebSearchIcon />}
{isFreeModel(model) && (
<Tag style={{ marginLeft: 10 }} color="green">
Free
Expand Down
38 changes: 20 additions & 18 deletions src/renderer/src/store/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ const migrateConfig = {
},
'46': (state: RootState) => {
if (
state.settings.translateModelPrompt.includes(
state.settings?.translateModelPrompt?.includes(
'If the target language is the same as the source language, do not translate'
)
) {
Expand All @@ -729,23 +729,25 @@ const migrateConfig = {
return state
},
'48': (state: RootState) => {
state.shortcuts.shortcuts.forEach((shortcut) => {
shortcut.system = shortcut.key !== 'new_topic'
})
state.shortcuts.shortcuts.push({
key: 'toggle_show_assistants',
shortcut: [isMac ? 'Command' : 'Ctrl', '['],
editable: true,
enabled: true,
system: false
})
state.shortcuts.shortcuts.push({
key: 'toggle_show_topics',
shortcut: [isMac ? 'Command' : 'Ctrl', ']'],
editable: true,
enabled: true,
system: false
})
if (state.shortcuts) {
state.shortcuts.shortcuts.forEach((shortcut) => {
shortcut.system = shortcut.key !== 'new_topic'
})
state.shortcuts.shortcuts.push({
key: 'toggle_show_assistants',
shortcut: [isMac ? 'Command' : 'Ctrl', '['],
editable: true,
enabled: true,
system: false
})
state.shortcuts.shortcuts.push({
key: 'toggle_show_topics',
shortcut: [isMac ? 'Command' : 'Ctrl', ']'],
editable: true,
enabled: true,
system: false
})
}
return state
}
}
Expand Down

0 comments on commit 25eb979

Please sign in to comment.