feat: add AI provider SiliconFlow
This commit is contained in:
@ -3,6 +3,7 @@ import type { Locale } from '~/components/LangSwitcher.vue'
|
||||
|
||||
export type ConfigAiProvider =
|
||||
| 'openai-compatible'
|
||||
| 'siliconflow'
|
||||
| 'openrouter'
|
||||
| 'deepseek'
|
||||
| 'ollama'
|
||||
@ -62,16 +63,20 @@ export const useConfigStore = defineStore('config', () => {
|
||||
const isConfigValid = computed(() => validateConfig(config.value))
|
||||
|
||||
const aiApiBase = computed(() => {
|
||||
if (config.value.ai.provider === 'openrouter') {
|
||||
return config.value.ai.apiBase || 'https://openrouter.ai/api/v1'
|
||||
const { ai } = config.value
|
||||
if (ai.provider === 'openrouter') {
|
||||
return ai.apiBase || 'https://openrouter.ai/api/v1'
|
||||
}
|
||||
if (config.value.ai.provider === 'deepseek') {
|
||||
return config.value.ai.apiBase || 'https://api.deepseek.com/v1'
|
||||
if (ai.provider === 'deepseek') {
|
||||
return ai.apiBase || 'https://api.deepseek.com/v1'
|
||||
}
|
||||
if (config.value.ai.provider === 'ollama') {
|
||||
return config.value.ai.apiBase || 'http://localhost:11434/v1'
|
||||
if (ai.provider === 'ollama') {
|
||||
return ai.apiBase || 'http://localhost:11434/v1'
|
||||
}
|
||||
return config.value.ai.apiBase || 'https://api.openai.com/v1'
|
||||
if (ai.provider === 'siliconflow') {
|
||||
return ai.apiBase || 'https://api.siliconflow.cn/v1'
|
||||
}
|
||||
return ai.apiBase || 'https://api.openai.com/v1'
|
||||
})
|
||||
|
||||
const showConfigManager = ref(false)
|
||||
|
Reference in New Issue
Block a user