chore: update setting base url also

This commit is contained in:
Faisal Amir 2025-10-03 21:49:42 +07:00
parent 651ba446bf
commit d3ea61b2e9

View File

@ -327,6 +327,28 @@ export const useModelProvider = create<ModelProviderState>()(
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 = [
{