From d3ea61b2e9d8cfd8ebea34a250ba1ecf4bcbc2d3 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Fri, 3 Oct 2025 21:49:42 +0700 Subject: [PATCH] chore: update setting base url also --- web-app/src/hooks/useModelProvider.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/web-app/src/hooks/useModelProvider.ts b/web-app/src/hooks/useModelProvider.ts index 484b08f97..8e74be32a 100644 --- a/web-app/src/hooks/useModelProvider.ts +++ b/web-app/src/hooks/useModelProvider.ts @@ -327,6 +327,28 @@ export const useModelProvider = create()( if (provider.base_url === 'https://api.anthropic.com') { provider.base_url = 'https://api.anthropic.com/v1' } + + // Update base-url in settings + if (provider.settings) { + const baseUrlSetting = provider.settings.find( + (s) => s.key === 'base-url' + ) + if ( + baseUrlSetting?.controller_props?.value === + 'https://api.anthropic.com' + ) { + baseUrlSetting.controller_props.value = + 'https://api.anthropic.com/v1' + } + if ( + baseUrlSetting?.controller_props?.placeholder === + 'https://api.anthropic.com' + ) { + baseUrlSetting.controller_props.placeholder = + 'https://api.anthropic.com/v1' + } + } + if (!provider.custom_header) { provider.custom_header = [ {