Skip to content

Commit 0cd38a4

Browse files
authored
feat: add Claude Opus 4.1 support and fix anthropic model list dialog (#702)
1 parent d0ee673 commit 0cd38a4

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

src/main/presenter/configPresenter/modelDefaultSettings.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,17 @@ export const defaultModelsSettings: DefaultModelSetting[] = [
589589
},
590590

591591
// Claude系列模型配置
592+
{
593+
id: 'claude-opus-4-1',
594+
name: 'Claude Opus 4.1',
595+
temperature: 0.7,
596+
maxTokens: 32000,
597+
contextLength: 204800,
598+
match: ['claude-opus-4-1', 'claude-opus-4-1-20250805'],
599+
vision: true,
600+
functionCall: true,
601+
reasoning: true
602+
},
592603
{
593604
id: 'claude-opus-4',
594605
name: 'Claude Opus 4',

src/main/presenter/configPresenter/providerModelSettings.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ export const providerModelSettings: Record<string, { models: ProviderModelSettin
3030
// Anthropic提供商特定模型配置
3131
anthropic: {
3232
models: [
33+
{
34+
id: 'claude-opus-4-1',
35+
name: 'Claude Opus 4.1',
36+
temperature: 0.7,
37+
maxTokens: 32000,
38+
contextLength: 204800,
39+
match: ['claude-opus-4-1', 'claude-opus-4-1-20250805'],
40+
vision: true,
41+
functionCall: true,
42+
reasoning: true
43+
},
3344
{
3445
id: 'claude-opus-4',
3546
name: 'Claude Opus 4',

src/renderer/src/components/settings/AnthropicProviderSettingsDetail.vue

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
:provider="provider"
220220
:enabled-models="enabledModels"
221221
:total-models-count="totalModelsCount"
222-
@show-model-list-dialog="openModelCheckDialog"
222+
@show-model-list-dialog="showModelListDialog = true"
223223
@disable-all-models="handleDisableAllModels"
224224
@model-enabled-change="handleModelEnabledChange"
225225
@config-changed="handleConfigChanged"
@@ -288,6 +288,15 @@
288288
</DialogContent>
289289
</Dialog>
290290
</div>
291+
<ProviderDialogContainer
292+
v-model:show-model-list-dialog="showModelListDialog"
293+
:provider="provider"
294+
:provider-models="providerModels"
295+
:custom-models="customModels"
296+
:model-to-disable="null"
297+
:check-result="false"
298+
@model-enabled-change="handleModelEnabledChange"
299+
/>
291300
</section>
292301
</template>
293302

@@ -317,6 +326,7 @@ import { useModelCheckStore } from '@/stores/modelCheck'
317326
import { usePresenter } from '@/composables/usePresenter'
318327
import type { LLM_PROVIDER, RENDERER_MODEL_META } from '@shared/presenter'
319328
import ProviderModelManager from './ProviderModelManager.vue'
329+
import ProviderDialogContainer from './ProviderDialogContainer.vue'
320330
321331
const { t } = useI18n()
322332
@@ -338,6 +348,7 @@ const authMethod = ref<'apikey' | 'oauth'>('apikey')
338348
const apiHost = ref(props.provider.baseUrl || '')
339349
const apiKey = ref(props.provider.apiKey || '')
340350
const showCheckModelDialog = ref(false)
351+
const showModelListDialog = ref(false)
341352
const checkResult = ref<boolean>(false)
342353
const isLoggingIn = ref(false)
343354
const validationResult = ref<{ success: boolean; message: string } | null>(null)
@@ -363,6 +374,18 @@ const totalModelsCount = computed(() => {
363374
return providerModels?.models.length || 0
364375
})
365376
377+
const providerModels = computed((): RENDERER_MODEL_META[] => {
378+
const provider = settingsStore.allProviderModels.find((p) => p.providerId === props.provider.id)
379+
return provider?.models || []
380+
})
381+
382+
const customModels = computed((): RENDERER_MODEL_META[] => {
383+
const providerCustomModels = settingsStore.customModels.find(
384+
(p) => p.providerId === props.provider.id
385+
)
386+
return providerCustomModels?.models || []
387+
})
388+
366389
// 初始化认证方法检测
367390
const detectAuthMethod = async () => {
368391
// 检查provider配置中的认证模式

0 commit comments

Comments
 (0)