fix(provider): filter bailian do not work
This commit is contained in:
@@ -70,12 +70,17 @@ export const ProviderI18nKeyMap: Record<ProviderEnum, string> = {
|
||||
[ProviderEnum.ZHIPUAI]: 'ai.provider.zhipuai'
|
||||
};
|
||||
|
||||
export const ProviderDescriptionMap: Record<ProviderEnum, string> = {
|
||||
[ProviderEnum.QWEN]: 'qwen, bailian, ali,alicloud,百炼, 阿里, 阿里云百炼'
|
||||
} as Record<ProviderEnum, string>;
|
||||
|
||||
// generate provider list: {label: string;value:string}[]
|
||||
export const maasProviderOptions = Object.entries(ProviderEnum).map(
|
||||
([key, value]) => ({
|
||||
locale: true,
|
||||
label: ProviderI18nKeyMap[value],
|
||||
value: value,
|
||||
description: ProviderDescriptionMap[value] || '',
|
||||
key: value
|
||||
})
|
||||
);
|
||||
|
||||
@@ -34,9 +34,11 @@ const Basic: React.FC<{
|
||||
};
|
||||
|
||||
const filterOption = (input: string, option?: any) => {
|
||||
console.log('filterOption input, option: ', input, option);
|
||||
return (
|
||||
option?.label?.toLowerCase().includes(input.toLowerCase()) ||
|
||||
option?.value?.toLowerCase().includes(input.toLowerCase())
|
||||
option?.value?.toLowerCase().includes(input.toLowerCase()) ||
|
||||
option?.description?.toLowerCase().includes(input.toLowerCase())
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user