chore: update FUN-Codex and FUN-Claude provider models (#522)
FUN-Codex: add GPT models (5.5, 5.4, 5.4-mini, 5.3-codex, 5.3-codex-spark) FUN-Claude: replace with actual Claude models from API (opus-4-7 down to 3-5-haiku) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,7 @@ export interface AvailableModelGroup {
|
||||
base_url: string
|
||||
models: string[]
|
||||
api_key: string
|
||||
builtin?: boolean
|
||||
/** 可选:模型 ID -> 元数据(preview/disabled)。目前仅 Copilot 提供。 */
|
||||
model_meta?: Record<string, { preview?: boolean; disabled?: boolean }>
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ const chatStore = useChatStore()
|
||||
const message = useMessage()
|
||||
const dialog = useDialog()
|
||||
|
||||
const isCustom = computed(() => props.provider.provider.startsWith('custom:'))
|
||||
const isCustom = computed(() => !props.provider.builtin && props.provider.provider.startsWith('custom:'))
|
||||
const isCopilot = computed(() => props.provider.provider === 'copilot')
|
||||
const displayName = computed(() => props.provider.label)
|
||||
const deleting = ref(false)
|
||||
|
||||
@@ -60,6 +60,13 @@ const presetOptions = computed(() =>
|
||||
modelsStore.allProviders.map(g => ({ label: g.label, value: g.provider })),
|
||||
)
|
||||
|
||||
const FUN_LINK_MAP: Record<string, string> = {
|
||||
'fun-codex': 'https://apikey.fun/register?aff=LIBAPI',
|
||||
'fun-claude': 'https://apikey.fun/register?aff=LIBAPI',
|
||||
}
|
||||
|
||||
const funProviderLink = computed(() => selectedPreset.value ? FUN_LINK_MAP[selectedPreset.value] || '' : '')
|
||||
|
||||
function autoGenerateName(url: string): string {
|
||||
const clean = url.replace(/^https?:\/\//, '').replace(/\/v1\/?$/, '')
|
||||
const host = clean.split('/')[0]
|
||||
@@ -322,6 +329,12 @@ function handleClose() {
|
||||
:placeholder="t('models.chooseProvider')"
|
||||
filterable
|
||||
/>
|
||||
<div v-if="selectedPreset && funProviderLink" class="fun-provider-hint">
|
||||
<a :href="funProviderLink" target="_blank" rel="noopener noreferrer">
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
|
||||
{{ t('models.getApiKey') }}
|
||||
</a>
|
||||
</div>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem v-if="providerType === 'custom'" :label="t('models.name')">
|
||||
@@ -417,6 +430,29 @@ function handleClose() {
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.fun-provider-hint {
|
||||
margin-top: 6px;
|
||||
font-size: 12px;
|
||||
|
||||
a {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 4px 8px;
|
||||
white-space: nowrap;
|
||||
color: var(--accent-primary);
|
||||
text-decoration: none;
|
||||
opacity: 0.7;
|
||||
transition: opacity 0.2s;
|
||||
|
||||
svg {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&:hover { opacity: 1; }
|
||||
}
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
@@ -18,7 +18,10 @@ onMounted(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const isCustom = (provider: string) => provider.startsWith('custom:')
|
||||
const isCustom = (provider: string) => {
|
||||
const g = modelsStore.providers.find(p => p.provider === provider)
|
||||
return !g?.builtin && provider.startsWith('custom:')
|
||||
}
|
||||
|
||||
function getEditKey(provider: string): string {
|
||||
if (!(provider in editKeys.value)) {
|
||||
|
||||
@@ -110,6 +110,10 @@ function openChangelog() {
|
||||
</svg>
|
||||
<span>{{ t("sidebar.search") }}</span>
|
||||
</button>
|
||||
<a class="nav-item fun-link" href="https://apikey.fun/register?aff=LIBAPI" target="_blank" rel="noopener noreferrer">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
|
||||
<span>{{ t('sidebar.apiRelay') }}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -720,4 +724,8 @@ function openChangelog() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fun-link {
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -68,6 +68,7 @@ export default {
|
||||
sidebar: {
|
||||
chat: 'Chat',
|
||||
search: 'Suche',
|
||||
apiRelay: 'API-Relay',
|
||||
history: 'Verlauf',
|
||||
jobs: 'Geplante Aufgaben',
|
||||
models: 'Modelle',
|
||||
|
||||
@@ -70,6 +70,7 @@ export default {
|
||||
sidebar: {
|
||||
chat: 'Chat',
|
||||
search: 'Search',
|
||||
apiRelay: 'API Relay',
|
||||
history: 'History',
|
||||
jobs: 'Jobs',
|
||||
models: 'Models',
|
||||
@@ -331,6 +332,7 @@ export default {
|
||||
custom: 'Custom',
|
||||
selectProvider: 'Select Provider',
|
||||
chooseProvider: 'Choose a provider...',
|
||||
getApiKey: 'Get API Key',
|
||||
name: 'Name',
|
||||
autoGeneratedName: 'Auto-generated from Base URL',
|
||||
baseUrl: 'Base URL',
|
||||
|
||||
@@ -68,6 +68,7 @@ export default {
|
||||
sidebar: {
|
||||
chat: 'Chat',
|
||||
search: 'Buscar',
|
||||
apiRelay: 'API Relay',
|
||||
history: 'Historial',
|
||||
jobs: 'Tareas programadas',
|
||||
models: 'Modelos',
|
||||
|
||||
@@ -68,6 +68,7 @@ export default {
|
||||
sidebar: {
|
||||
chat: 'Discussion',
|
||||
search: 'Rechercher',
|
||||
apiRelay: 'API Relay',
|
||||
history: 'Historique',
|
||||
jobs: 'Taches planifiees',
|
||||
models: 'Modeles',
|
||||
|
||||
@@ -68,6 +68,7 @@ export default {
|
||||
sidebar: {
|
||||
chat: 'チャット',
|
||||
search: '検索',
|
||||
apiRelay: 'APIリレー',
|
||||
history: '履歴',
|
||||
jobs: 'ジョブ',
|
||||
models: 'モデル',
|
||||
|
||||
@@ -68,6 +68,7 @@ export default {
|
||||
sidebar: {
|
||||
chat: '채팅',
|
||||
search: '검색',
|
||||
apiRelay: 'API 릴레이',
|
||||
history: '기록',
|
||||
jobs: '예약 작업',
|
||||
models: '모델',
|
||||
|
||||
@@ -68,6 +68,7 @@ export default {
|
||||
sidebar: {
|
||||
chat: 'Chat',
|
||||
search: 'Pesquisar',
|
||||
apiRelay: 'API Relay',
|
||||
history: 'Historico',
|
||||
jobs: 'Tarefas agendadas',
|
||||
models: 'Modelos',
|
||||
|
||||
@@ -70,6 +70,7 @@ export default {
|
||||
sidebar: {
|
||||
chat: '对话',
|
||||
search: '搜索',
|
||||
apiRelay: '中转站',
|
||||
history: '历史',
|
||||
jobs: '任务',
|
||||
models: '模型',
|
||||
@@ -331,6 +332,7 @@ export default {
|
||||
custom: '自定义',
|
||||
selectProvider: '选择 Provider',
|
||||
chooseProvider: '选择一个 provider...',
|
||||
getApiKey: '获取 API Key',
|
||||
name: '名称',
|
||||
autoGeneratedName: '根据 Base URL 自动生成',
|
||||
baseUrl: 'Base URL',
|
||||
|
||||
@@ -70,6 +70,7 @@ async function handleSaved() {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
|
||||
.models-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
|
||||
Reference in New Issue
Block a user