feat: Conditionally render reasoning effort control for reasoning models
This commit is contained in:
parent
11bd55701c
commit
f91caff7ec
@ -1843,7 +1843,7 @@ export function isOpenAIoSeries(model: Model): boolean {
|
|||||||
return ['o1', 'o1-2024-12-17'].includes(model.id) || model.id.includes('o3')
|
return ['o1', 'o1-2024-12-17'].includes(model.id) || model.id.includes('o3')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isReasoningModel(model: Model): boolean {
|
export function isReasoningModel(model?: Model): boolean {
|
||||||
if (!model) {
|
if (!model) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import {
|
|||||||
isMac,
|
isMac,
|
||||||
isWindows
|
isWindows
|
||||||
} from '@renderer/config/constant'
|
} from '@renderer/config/constant'
|
||||||
|
import { isReasoningModel } from '@renderer/config/models'
|
||||||
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'
|
||||||
@ -231,6 +232,8 @@ const SettingsTab: FC<Props> = (props) => {
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
)}
|
||||||
|
{isReasoningModel(assistant?.model) && (
|
||||||
|
<>
|
||||||
<SettingDivider />
|
<SettingDivider />
|
||||||
<Row align="middle">
|
<Row align="middle">
|
||||||
<Label>{t('assistants.settings.reasoning_effort')}</Label>
|
<Label>{t('assistants.settings.reasoning_effort')}</Label>
|
||||||
@ -270,6 +273,8 @@ const SettingsTab: FC<Props> = (props) => {
|
|||||||
</SegmentedContainer>
|
</SegmentedContainer>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</SettingGroup>
|
</SettingGroup>
|
||||||
<SettingGroup>
|
<SettingGroup>
|
||||||
<SettingSubtitle style={{ marginTop: 0 }}>{t('settings.messages.title')}</SettingSubtitle>
|
<SettingSubtitle style={{ marginTop: 0 }}>{t('settings.messages.title')}</SettingSubtitle>
|
||||||
@ -534,6 +539,7 @@ export const SettingGroup = styled.div<{ theme?: ThemeMode }>`
|
|||||||
|
|
||||||
// Define the styled component with hover state styling
|
// Define the styled component with hover state styling
|
||||||
const SegmentedContainer = styled.div`
|
const SegmentedContainer = styled.div`
|
||||||
|
margin-top: 5px;
|
||||||
.ant-segmented-item {
|
.ant-segmented-item {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user