feat: add cherryin in provider type options (#10891)

This commit is contained in:
defi-failure 2025-10-22 21:32:33 +08:00 committed by GitHub
parent f088069fb3
commit 4a38f2e8b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,6 +24,7 @@ const PopupContainer: React.FC<Props> = ({ provider, resolve }) => {
const [open, setOpen] = useState(true)
const [name, setName] = useState(provider?.name || '')
const [type, setType] = useState<ProviderType>(provider?.type || 'openai')
const [displayType, setDisplayType] = useState<string>(provider?.type || 'openai')
const [logo, setLogo] = useState<string | null>(null)
const [logoPickerOpen, setLogoPickerOpen] = useState(false)
const [dropdownOpen, setDropdownOpen] = useState(false)
@ -245,15 +246,20 @@ const PopupContainer: React.FC<Props> = ({ provider, resolve }) => {
</Form.Item>
<Form.Item label={t('settings.provider.add.type')} style={{ marginBottom: 0 }}>
<Select
value={type}
onChange={setType}
value={displayType}
onChange={(value: string) => {
setDisplayType(value)
// special case for cherryin-type, map to new-api internally
setType(value === 'cherryin-type' ? 'new-api' : (value as ProviderType))
}}
options={[
{ label: 'OpenAI', value: 'openai' },
{ label: 'OpenAI-Response', value: 'openai-response' },
{ label: 'Gemini', value: 'gemini' },
{ label: 'Anthropic', value: 'anthropic' },
{ label: 'Azure OpenAI', value: 'azure-openai' },
{ label: 'New API', value: 'new-api' }
{ label: 'New API', value: 'new-api' },
{ label: 'CherryIN', value: 'cherryin-type' }
]}
/>
</Form.Item>