feat: add multi model credentials (#24451)

Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
非法操作 2025-08-25 16:12:29 +08:00 • committed by GitHub
commit 6010d5f24c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
65 changed files with 5202 additions and 1814 deletions

View file

@ -13,12 +13,14 @@ type ModelIconProps = {
provider?: Model | ModelProvider
modelName?: string
className?: string
iconClassName?: string
isDeprecated?: boolean
}
const ModelIcon: FC<ModelIconProps> = ({
provider,
className,
modelName,
iconClassName,
isDeprecated = false,
}) => {
const language = useLanguage()
@ -34,7 +36,7 @@ const ModelIcon: FC<ModelIconProps> = ({
if (provider?.icon_small) {
return (
<div className={cn('flex h-5 w-5 items-center justify-center', isDeprecated && 'opacity-50', className)}>
<img alt='model-icon' src={renderI18nObject(provider.icon_small, language)}/>
<img alt='model-icon' src={renderI18nObject(provider.icon_small, language)} className={iconClassName} />
</div>
)
}
@ -44,7 +46,7 @@ const ModelIcon: FC<ModelIconProps> = ({
'flex h-5 w-5 items-center justify-center rounded-md border-[0.5px] border-components-panel-border-subtle bg-background-default-subtle',
className,
)}>
<div className='flex h-5 w-5 items-center justify-center opacity-35'>
<div className={cn('flex h-5 w-5 items-center justify-center opacity-35', iconClassName)}>
<Group className='h-3 w-3 text-text-tertiary' />
</div>
</div>