diff --git a/components/ConfigManager.vue b/components/ConfigManager.vue index 5ba9a99..b946f27 100644 --- a/components/ConfigManager.vue +++ b/components/ConfigManager.vue @@ -11,6 +11,7 @@ const { config, aiApiBase, + webSearchApiBase, showConfigManager: showModal, } = storeToRefs(useConfigStore()) const { t } = useI18n() @@ -66,6 +67,7 @@ // Only kept for easy reference in i18n Ally _help: t('settings.webSearch.providers.firecrawl.help'), link: 'https://www.firecrawl.dev/app/api-keys', + supportsCustomApiBase: true, }, ]) const selectedAiProvider = computed(() => @@ -121,6 +123,7 @@ config.value.ai.model = model } + // Automatically fetch AI models list watch( () => [ config.value.ai.provider, @@ -134,6 +137,24 @@ }, { immediate: true }, ) + // Reset AI config when provider changed + watch( + () => config.value.ai.provider, + () => { + config.value.ai.apiKey = '' + config.value.ai.apiBase = '' + config.value.ai.model = '' + config.value.ai.contextSize = undefined + }, + ) + // Reset web search config when provider changed + watch( + () => config.value.webSearch.provider, + () => { + config.value.webSearch.apiKey = '' + config.value.webSearch.apiBase = '' + }, + ) defineExpose({ show() { @@ -250,17 +271,30 @@ - + + + +