feat: add migration for cohere provider
This commit is contained in:
parent
d3ea61b2e9
commit
7fd83e0bf8
@ -362,6 +362,34 @@ export const useModelProvider = create<ModelProviderState>()(
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (provider.provider === 'cohere') {
|
||||||
|
if (provider.base_url === 'https://api.cohere.ai/compatibility/v1') {
|
||||||
|
provider.base_url = 'https://api.cohere.ai/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.cohere.ai/compatibility/v1'
|
||||||
|
) {
|
||||||
|
baseUrlSetting.controller_props.value =
|
||||||
|
'https://api.cohere.ai/v1'
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
baseUrlSetting?.controller_props?.placeholder ===
|
||||||
|
'https://api.cohere.ai/compatibility/v1'
|
||||||
|
) {
|
||||||
|
baseUrlSetting.controller_props.placeholder =
|
||||||
|
'https://api.cohere.ai/v1'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user