feat: support infiniai

This commit is contained in:
zhuyu Yao
2025-03-06 01:15:03 +08:00
committed by zhuyu Yao
parent 10b4f81e7f
commit 744f487585
7 changed files with 27 additions and 1 deletions

View File

@ -51,6 +51,15 @@
link: 'https://cloud.siliconflow.cn/i/J0NHrrX8',
linkText: 'cloud.siliconflow.cn',
},
{
label: t('settings.ai.providers.infiniai.title'),
help: 'settings.ai.providers.infiniai.description',
// Only kept for easy reference in i18n Ally
_help: t('settings.ai.providers.infiniai.description'),
value: 'infiniai',
link: 'https://cloud.infini-ai.com/genstudio/model?deepsearch',
linkText: 'cloud.infini-ai.com',
},
{
label: 'DeepSeek',
value: 'deepseek',

View File

@ -22,6 +22,7 @@ export const useAiModel = () => {
} else if (
config.ai.provider === 'deepseek' ||
config.ai.provider === 'siliconflow' ||
config.ai.provider === 'infiniai' ||
// Special case if model name includes 'deepseek'
// This ensures compatibilty with providers like Siliconflow
config.ai.model?.toLowerCase().includes('deepseek')

View File

@ -4,6 +4,7 @@ import type { Locale } from '@/components/LangSwitcher.vue'
export type ConfigAiProvider =
| 'openai-compatible'
| 'siliconflow'
| 'infiniai'
| 'openrouter'
| 'deepseek'
| 'ollama'
@ -84,6 +85,9 @@ export const useConfigStore = defineStore('config', () => {
if (ai.provider === 'siliconflow') {
return ai.apiBase || 'https://api.siliconflow.cn/v1'
}
if (ai.provider === 'infiniai') {
return ai.apiBase || 'https://cloud.infini-ai.com/maas/v1'
}
return ai.apiBase || 'https://api.openai.com/v1'
})
const webSearchApiBase = computed(() => {